DGKC Control Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
What is new
Licensing
Expand ModelsModels
Collapse DG Kernel ControlDG Kernel Control
Expand API ReferenceAPI Reference
Expand Samples and TutorialsSamples and Tutorials
Expand GraphicsGraphics
Expand Math ObjectsMath Objects
Expand DeprecatedDeprecated
Redistribution
Model Viewer
Support
Skip Navigation LinksHome Page > DG Kernel Control > Programmatic Functionality > Queries Go to ActiveX docs Search Documentation


Interface Queries

Operation of obtaining an interface from an object with  .As<>, Query<> is called Simple Query. Example:

ICircle_DG iCircle;     		//... Initialise etc.
ICurve_DG iCurve = iCircle.As<ICurve_DG>();      // Circle is a curve
 
IObjectGenerator_DG gen = iModel.Query<IObjectGenerator_DG>();

Query<> and As<> operators are identical in behaviour.

Calls to a method returning an interface like  IEntity_DG iEntity = m_iModel.GetEntityAt(0); are called simple queries as well

Normally to get access to a specific functionality it is needed to traverse several levels in the hierarchy of interfaces. Such a sequence of simple queries is called extended query (or just query). Its description in textual form is called query path. 

Example of a query path: DG Kernel > GetModel() > IModel_DG > GetEntityAt() > IEntity_DG

In some rare situations, the result of a query can depend on the query path. Such queries are called Context-Dependent Query. Description of specific interfaces describes situations when the interface can be involved in a context-dependent query. Context-dependent queries should be carried out without any other queries from the involved interfaces.