DG Kernel (ActiveX) Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
What is new
Upgrading Native Apps
Licensing
Collapse ModelsModels
Collapse DG Kernel ControlsDG Kernel Controls
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Collapse General GeometryGeneral Geometry
Collapse ModelModel
Collapse ViewView
Collapse General ComputingGeneral Computing
Collapse Samples and TutorialsSamples and Tutorials
Collapse GraphicsGraphics
Collapse Math ObjectsMath Objects
Collapse DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation Links Go to DGKC docs Search Documentation


IDIObjGenerator Interface

Create
Create2
Create3
Create4

IDIObjGenerator serves as a constructor of objects. 

IDIObjGenerator is implemented by DIObjGenerator.

There are two ways of obtaining IDIObjectGenerator: 

1. Created an Object Generator object directly as described in Object Generator topic and query IDIObjectGenerator from it.

2. Query DIObjGenerator from IModel interface. For this method to work the IModel must be obtained from the DG Kernel component using GetModel method.

See also Object Array sample, Cannon sample, Interface List


HRESULT Create(EObjectType eType, IUnknown **ppIUnknown)

Parameters

eType - [in] member of the Object type enumeration

ppIUnknown - [out, retval] pointer to variable, which will receive IUnknown interface, implemented by the created object. Normally actual type of the returned interface is different (but inherited from) IUnknown. For example, in case eType = eObjTypeLine it is ILine interface.  

Returns

S_OK in case of success.

Remarks:

Call to this method will create an object of type eType and will query from it a default interface, specific for the type, which will be returned in ppIUnknown.


HRESULT Create2(EObjectType eType, VARIANT* item)

Parameters

eType - [in] member of the Object type enumeration

item - [out, retval] reference to a VARIANT variable, which will receive IUnknown interface, implemented by the created object. Normally actual type of the returned interface is different (but inherited from) IUnknown. For example, in case eType = eObjTypeLine it is ILine interface. 

Returns

S_OK in case of success.

Remarks:

Create2 is an overloaded version of the Create method, provided for environments, which do not recognize IUnknown type.


HRESULT Create3(char* type, IUnknown** iUnknown)

Parameters

type - [in] type name of the object. See remarks

iUnknown - [out, retval] pointer to variable, which will receive IUnknown interface, implemented by the created object. Normally actual type of the returned interface is different (but inherited from) IUnknown. For example, in case eType = eObjTypeLine it is ILine interface.  

Returns

S_OK in case of success.

Remarks:

Create3 is another version of the Create method added in version 4.0 for wrapped OCCT types. The type parameter is described in documentation of relevant interfaces. For OCCT - related interfaces the name coincides with name of the interface with front I letter removed. For example to create a 3D  circle use:

IKO_gp_Circ* iCurc = NULL;  iDIObjGenerator->Create3("KO_gp_Circ", (IUnknown**)&iCirc);               (Native C++)

IKO_gp_Circ iCirc = (IKO_gp_Circ) iDIObjGenerator.Create3("KO_gp_Circ");                                           (C#)

Dim iCurc As IKO_gp_Circ =  iDIObjGenerator.Create3("KO_gp_Circ")                                                    (Visual Basic .NET)

The method also creates the following native KC objects:

Type Returned interface
"VirtualView" IVirtualView
"Dictionary_KC" IDictionary_KC

HRESULT Create4(char* type, IUnknown *iParam, IUnknown **iUnknown)

iParam - a parameter specific for the requested type.

Type Expected iParam type
"BRepEdge_DG" ICurve_DG
"BRepWire_DG" ICurve_DG
"BRepFace_DG" IBRepWire_DG or IUVSurface_DG

See Create3() above for description of the other parameters