DG Kernel (ActiveX) Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
What is new
Upgrading Native Apps
Licensing
Collapse ModelsModels
Models
Persistence
Model Properties
Collapse EntitiesEntities
Collapse GeometryGeometry
Geometry
Collapse BRepBRep
BRep Overview
BRep Geometry
Shapes
Curves
Surfaces
Faces
Wires
Edges
Compounds
Collapse MeshMesh
Mesh Geometry
Mesh
BRep to Mesh Conversion
Curve Geometry
Line Strips
Point Sets
Overlays
Collapse AttributesAttributes
Local Frame
Appearance
Texture
Properties of an Entity
Collapse Model ItemsModel Items
Items
3D Text
Smart Labels
View Points
Collapse MeasurementsMeasurements
Measurements
Persistent Measurements
Grid
Collapse Operations and AlgorithmsOperations and Algorithms
Boolean Operations
Euclidean Shortest Path
Collapse MovementMovement
Movements
Kinematic Entities
Collision Detection
Collapse Import/ExportImport/Export
Import/Export Overview
Data Flow Sample
STL Tree
Collapse DG Kernel ControlsDG Kernel Controls
Components
DG Kernel Control
Collapse Properies, Methods, EventsProperies, Methods, Events
Properies
Methods
Events
Collapse Interactive FunctionalityInteractive Functionality
View
Context Menu
Measurements
Direct User Access
Modes of DG Kernel
Current Entities
Collapse Selection OverviewSelection Overview
Selection
Selection Event
Collapse Auxiliary ViewsAuxiliary Views
Model Explorer
Birds Eye View
Full Screen window
Collapse Programmatic FunctionalityProgrammatic Functionality
Programming
Queries
Data Types
Object Construction
Generator
Component Context
Initialisation Context
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Collapse General GeometryGeneral Geometry
IPointArray_DG
IPointMatrix_DG
IPointCloud_DG
Collapse CurvesCurves
ICurve_DG
ILine_DG
ICircle_DG
IEllipse_DG
IBSplineCurve_DG
IBSplineCurveInterpolator_DG
ICurveFreeForm_DG
IArcSpline3DCurve_DG
Collapse 2D2D
ICurve2d_DG
IBSplineCurve2d_DG
ICircle2d_DG
ILine2d_DG
IArc_DG
Collapse SurfacesSurfaces
IUVSurface_DG
IPartialSplineProps_DG
IBSplineSurface_DG
IBezierSurface_DG
IPartialBezierProps_DG
IRectangularTrimmedSurface_DG
ISurfaceOfRevolution_DG
Collapse Oriented ObjectsOriented Objects
IObjectOriented_DG
IPlane_DG
ISphere_DG
ICylinder_DG
ICone_DG
ITorus_DG
IBox_DG
IPolygon3D_DG
IGeometricObject_DG
Collapse GeneralGeneral
IElement_DG
IStrip_DG
Collapse ModelModel
IModel_DG
Collapse EntitiesEntities
IEntity_DG
IEntityArray_DG
IStdShape_DG
IStdShapeRef_DG
IDraw_DG
IEntity2d_DG
IModel2d_DG
Collapse GeometryGeometry
IGeometry_DG
IPointSetGeometry_DG
ISegmentStripGeometry_DG
ICurveGeometry_DG
ISurfacePoint_DG
ISurfacePointArray_DG
ILabel_DG
ILabelGeometry_DG
ISticky_DG
Collapse BSpline BRep GeometryBSpline BRep Geometry
Collapse Advanced AlgorithmsAdvanced Algorithms
IBRepChamfer_DG
IBRepDraftAngle_DG
IBRepFillet_DG
IFeaturePrism_DG
IBRepShape_DG
IBRepVertex_DG
IBRepEdge_DG
IBRepWire_DG
IBRepFace_DG
IBRepShell_DG
IBRepSolid_DG
IBRepCompositeSolid_DG
IBRepCompound_DG
IShapeArray_DG
IBRepBuilderEx_DG
IWireArrayToSurfaceBuilder_DG
IBRepGeometry_DG
IBRepBuilder_DG
Collapse Mesh GeometryMesh Geometry
IMesh_DG
IMeshGeometry_DG
IVertex_DG
IVertexSegment_DG
ISimplex_DG
IMeshPoint_DG
IMeshAlgor_DG
IDiffSurface_DG
Collapse AppearenceAppearence
IAppearance_DG
IColor
IMaterial_DG
ITexture_DG
ILineStyle_DG
Collapse MovementMovement
Collapse Collision DetectionCollision Detection
IMetrics_DG
IPathCollisionDetector_DG
IKinematicEntity_DG
IMove_DG
IKinematicSet_DG
ICutEffect_DG
ISpinEffect_DG
IConstraint_DG
Collapse ItemsItems
IModelItem_DG
IItemArray_DG
IDynamicScreenItem_DG
IDynamicScreenItemManager_DG
ISmartLabelManager_DG
Collapse Import / ExportImport / Export
IDataContext_DG
ISTLDataContext_DG
Collapse Operations and AgorithmsOperations and Agorithms
IBooleanEntity_DG
IEuclideanShortestPath_DG
Collapse User DataUser Data
IUserData_DG
Collapse ViewView
IView_DG
ISelection_DG
IScene_DG
ILighting_DG
ILightSource_DG
IViewPoint_DG
IViewPointArray_DG
IMeasurement_DG
IRectangleColor_DG
I2DEditor_DG
IVirtualView_DG
Collapse General ComputingGeneral Computing
IObjectGenerator_DG
IControlInitialisationContext_DG
IGlobalAPI_DG
Collections
IUnknown
IObject_DG
IBitmap_DG
IBlob_DG
IContext_DG
IError_DG
IKCStack
IMenu_KC
IMenuItem_KC
IText
IFont_DG
Collapse ViewsViews
View
Scene
Global Axes
Background
3D Background
Collapse Samples and TutorialsSamples and Tutorials
Sample List
.NET Samples
Delphi and C++ Samples
Collapse GraphicsGraphics
Concepts
3D View
Viewing Volume
Eye Frame
Perspective View
Collapse Math ObjectsMath Objects
Mathematical Objects
Planes
Frames
Transforms
Oriented Objects
Boxes
Collapse CurvesCurves
Curve Technologies
Native Curves
Collapse 2D Elements2D Elements
Geometric Elements
Arcs
Line Strips
Collapse DeprecatedDeprecated
Collapse Deprecated GeometryDeprecated Geometry
Collapse 3DS3DS
Profiles
Surface Patches
Surfaces and Patch Strips
Input Validation
Collapse Lines and CurvesLines and Curves
3DS Curves
Surface Of Revolution
Collapse Deprecated API ReferenceDeprecated API Reference
Collapse ModelModel
Collapse SectionSection
IBoundary
Collapse 3DS3DS
IProfiles
IProfiledElement_KC
Redistribution
Model Viewer
Open Source
Support
Skip Navigation Links Go to DGKC docs Search Documentation


ITechnology_DG Interface

GetTechnologyName
GetGlobalObjectPointer
GetPointer
GetInterface
Execute
SetTechnologyToAppCallback
GetInterface2

The interface provides access to technologies used in DG Kernel. It is intended for advanced C++ deveopment where some modification of open source of a third party component is required. It queries major global objects from the component, maps them to DG Kernel entities when possible and establishes communication both ways between DG Kernel based application and the third party component

The interface can be queried from IGlobalAPI_KC with

ITechnology_DG* iTechnology = NULL;
iKcApi->GetTechnology("OCCT", &iTechnology);

Or
iKcApi->GetTechnology("Ogre", &iTechnology);

See also OCCT Bridge sample, Ogre Bridge sample

POSNT type below must be considered as (cast to) void*


HRESULT GetTechnologyName(BSTR* name)

Returns name of this technology ("OCCT" or "Ogre" in this version).

HRESULT GetGlobalObjectPointer(char* type, POSNT* pp)

Parameters

type - [in] Type of the item requested. See remarks

pp - [out,retval] The requested pointer. See remarks

Remarks:

Returns pointer to the specified object in the technolgy. There are no object obtainable in this way in the OCCT technology. For Ogre technology the only valid opion for type is "Root", in which case the returned value is Ogre::Root* pointer of the only Ogre::Root object.


HRESULT GetPointer(IUnknown* objectFrom, char* interfaceNameFrom, char* requestedPointer, POSNT* outPointer)

Parameters

objectFrom - [in] DG Kernel object, which has acces to the requested pointer

interfaceNameFrom - [in] The actual name of the objectFrom interface

requestedPointer - [in] Specifies (enumerates) the requested pointer. See remarks

outPointer - [out,retval] The requested pointer

Remarks:

Maps DG Kernel objects to the technology. Returns pointer to the specified object in the technolgy. objectFrom specifies either DG Kernel view or a specific DG Kernel item, which owns or can be mapped to the requested object. Valid options for input and type of retun are listed below:

OCCT Technology

objectFrom interfaceNameFrom requestedPointer Returned type
IView* "IView" "TDocStd_Application" Handle_AIS_TDocStd_Application*
IView* "IView" "TDocStd_Document" Handle_TDocStd_Document*
IView* "IView" "V3d_Viewer" Handle_V3d_Viewer*
IView* "IView" "AIS_InteractiveContext" Handle_AIS_InteractiveContext*
IEntity_DG* "IEntity_DG" "TopoDS_Shape" TopoDS_Shape*
ISection* "ISection" "TopoDS_Shape" TopoDS_Shape*
ISection* "ISection" "AIS_Shape" Handle_AIS_Shape*

When requestedPointer  is "TDocStd_Application" the returned pointer must be dereferenced immediately and stored like:
POSNT p = NULL;
iTechnology->GetPointer(iView, "IView", "TDocStd_Application", &p);
Handle_TDocStd_Application hApp = *((Handle_TDocStd_Application*)p);

See OcctBridgeView::DoTest() in OCCT Bridge sample

Ogre Technology

objectFrom interfaceNameFrom requestedPointer Returned type
IView* "IView" "RenderWindow" Ogre::RenderWindow*
IView* "IView" "SceneManager" Ogre::SceneManager*
IView* "IView" "Camera" Ogre::Camera*
IView* "IView" "RenderSystem" Ogre::RenderSystem*
IView* "IView" "RootSceneNode" Ogre::RootSceneNode*

Example:
POSNT p = NULL;
iTechnology->GetPointer(iView, "IView", "Camera", &p);
Ogre::Camera* cam = (Ogre::Camera*)p;

See OcctBridgeView::DoTest() in Ogre Bridge sample


HRESULT GetInterface(POSNT pointer, char* pointerType, char* interfaceName, IUnknown** interf)

Parameters

pointer - [in] Pointer to an object in the technology

pointerType - [in] Specifies (enumerates) type of  the technology object

interfaceName - [in] Name of the DG Kernel interface to be obtained.

interf - [out,retval] The requested interface

Remarks:

Returns the specified DG Kernel interface. The method provides reverse mapping of the technology to DG Kernel, where possible.  pointer points to an object in the technology. Valid options for input and type of the retun are listed below:

OCCT Technology

pointer pointerType interfaceName Returned interf
TopoDS_Shape* "TopoDS_Shape" "ISection" ISection*

Ogre Technology

pointer pointerType interfaceName Returned interf
SceneNode* "SceneNode" "ISection" ISection*
SceneNode* "SceneNode" "IItem" IItem*
Renderable* "Renderable" "ISection" ISection*
Renderable* "Renderable" "IItem" IItem*

HRESULT Execute(char* operation, __int64 param0, __int64 param1)

Parameters

operation,param0,param1 - [in] User-defined generic parameters. See remarks

Remarks:

The method provides a way for the DG Kernel based application to call functionality implemented in the technology modules directly. DG Kernel passes the call to the technology object (see below) without any other action.

OCCT Technology

 The call is passed to OcctDgBridge::ExecuteDg(const char* operation, __int64 param0, __int64 param1) method of the OcctDgBridge theOcctDgBridge; global object. The implementation of the method and definition of theOcctDgBridge are located in DG Kernel\ThirdParty\OCCT\src\TDocStd\OcctDgBridge.cxx added to ApplicationFramework\TKLCAF project of the DG Kernel\ThirdParty\OCCT\adm\msvc\vc12\OCCT.sln solution.

The default implementation of OcctDgBridge::ExecuteDg() is used only by the OCCT Bridge sample and can be safely replaced with any custom code

Ogre Technology

The call is passed to the Root::ExecuteDg(const String& operation, __int64 param0, __int64 param1) method of the Ogre::Root class in DG Kernel\ThirdParty\Ogre\ogre\ogremain\src\ogreroot.cpp

The default implementation of Root::ExecuteDg() is used only by the Ogre Bridge sample and can be safely replaced with any custom code


HRESULT SetTechnologyToAppCallback(bool(*func)(__int64 implementationObj, const char* operation, __int64 param0, __int64 param1), __int64 implementnObj)

Parameters

func - [in] Pointer to a callback function, implemented in DG Kernel based application

implementnObj - [in] Any pass through parameter. Its value will be passed as the first parameter to any func calls;

Remarks:

The method provides a way for DG Kernel-based applications to receive calls from modified technology code. To use this functionality:

  • Implement funct in your DG Kernel-based application
  • Call this method on start of your application
  • Call OcctDgBridge::ExecuteApplicationCallbackDg() (OCCT) or Root::ExecuteDg() (Ogre) (See remarks for the Execute method above) from your technology customisation code

The implementnObj parameter is provided for convenience. The suggested use is for identofication of the objects, which implements the callback in case a global function is not convenient. See the Bridge examples. It is not used by DG Kernel.


HRESULT GetInterface2(POSNT pointer, char* pointerType, IUnknown* context, char* interfaceName, IUnknown** interf)

Parameters

pointer - [in] Pointer to an object in the technology

pointerType - [in] Specifies (enumerates) type of  the technology object

context - [in] Additional input parameter. See the table below

interfaceName - [in] Name of the DG Kernel interface to be obtained.

interf - [out,retval] The requested interface

Remarks:

Returns the specified DG Kernel interface. The method provides reverse mapping of the technology to DG Kernel, where possible.  pointer points to an object in the technology. Valid options for input and type of the retun are listed below:

OCCT Technology

pointer pointerType context interfaceName Returned interf
TopoDS_Shape* "TopoDS_Shape" IModel_DG "IBRepShape_DG" IBRepShape_DG*

Ogre Technology

pointer pointerType interfaceName Returned interf
SceneNode* "SceneNode" "ISection" ISection*
SceneNode* "SceneNode" "IItem" IItem*
Renderable* "Renderable" "ISection" ISection*
Renderable* "Renderable" "IItem" IItem*