Re: [Pythoncad-developer] New kernel
CAD Application entire developed in Python
Status: Beta
Brought to you by:
matteoboscolo
From: Yagnesh D. <yn...@gm...> - 2010-03-03 08:58:24
|
Were these queries not available in the R37 - - - - - - - - - - Best regards Yagnesh Desai Save a tree...please don't print this e-mail. On Tue, Mar 2, 2010 at 10:12 PM, Matteo Boscolo <mat...@bo...> wrote: > Hi gertwing, > > We need to spatial queries like "give me all entities within (or outside) a > rectangle", needed for a zoom or select functions. > Or "give me the nearest entities from a given point", needed for snap and > selection functions. > ok > > May be you can create this structure in memory at startup looking of the > bounding box … > > Let me know if having the bbox information in the entity table is still > necessary .. > > > >> I don’t’ know how to improve this code >> .. >> >> The name of the layer is inside >> the pickle entity .. so I need to get all the layer and then ask to the >> unpickle elemente the name .. >> >> We can store the entity type >> with the name like this ‘LAYER_MAIN’ or “LAYER_PIPE” >> but I do not like this sort of naming conversion for the entity type. >> >> Any idea? > > We must do the selection based on Id's. > The id is the primary key and is indexed. > > When the drawing is opened PythonCAD retrieved all layers from the database, > this is done by the pyKadKernel.getEntityFromType('LAYER'). > The layer name is presented to the user, the record id is used internally by > PythonCAD. > When a single layer record is needed the id of the record is used to query > the database. > > So instead of > def getEntLayer(self, layerName) > we use > def getEntLayer(self, layerId) > > This way we make full use of the database indexes and it will be lightning > fast. > ok > > I was thinking to load in memory at startup all the layer tree for fast > access to the data … and create a class for manage all the layers.. > > > > Regards, > > Matteo > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Pythoncad-developer mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncad-developer > > |