It seems that ArcMap keeps a cache for every layer which contains features data and every time wants to refresh layer or apply a change,uses tis cache.As I found,when ArcMap wants to draw a layer from the scratch,sends this query to geodatabase:
select ObjectId,Shape from "featureClassName" [where "layer definition query expression"]
In editing mode,when using snapping,it seems the features data in this cache are used to determine snapping state while mouse movement.I don't know how ArcMap stores spatial data in this cache,in ESRI shape format or as WKB,But I need to retrive these features data.
Is there any way to retrive feature data of a layer using its cache(layer cache) instead of using IFeatureClass::get_Feature method? .....Maybe my idea isn't right and a layer doesn't have any cache(I don't mean cache which is optional for layers and boosts the speed of layer draw),but I'm almost sure spatial data of layers(map) is stored in ArcMap memory somewhere and ArcMap uses it for its operation like snapping during edit operation.Is there any way to access this part of ArcMap data(if really exists)?
Thanks and Regards
Thanks Kirk,bu I don't want to setup a cache,I want to retrieve data from ArcMap cache.ISpatialCacheManager doesn't offer any method for getting a specific data from it.Let me discuss what I mean in more details.
When I put this code inside my program
//C# IFeature ipF=ipMyFeatureClassObject.GetFeature(10);
ArcMap issues a select command to geodatabase,let's suppose:
select * from MyFeatureClassTableName Where ObjectId=10
and gives back a record of data.
In edit mode,ArcMap can't use this method to get spatial data and calculate snapping state for features on the map because of time consuming this method has and snapping calculation needs a high speed data retrieve,also because mouse can moves every where on the map and snapping is enabled for any zoom,all these witnesses shows that spatial data must be available somewhere in memory and I'm looking for a method to access it.
If all these consumptions not come true,so there must be a perfect method that ArcMap uses to retrieve spatial data from geodatabase on the fly(for example 4 or 6 level spatial indexing based on the map extent and use the mouse position to retrieve only part of spatial data while mouse movement very fast,in this way only has access to geodatabase when the smallest indexing area of mouse changes).
I'm dealing with developing a tool like "Sketch Tool and "Edit tool" for a data source other than ArcObject data source and I don't want to setup a cache parallel with ArcMap.if possible I want to use same data which ArcMap stores in memory for this data source.
Now,do you guys think these are true consumptions and if yes is there any way to access ArcMap spatial data in its memory?