KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Collapse KernelCAD ModelsKernelCAD Models
Collapse KernelCAD ComponentsKernelCAD Components
KernelCAD Control
KernelCAD .NET Control
Methods and Properties
Menu
Model Explorer
Birds Eye View
Programming
Direct User Access
Direct Operations
Interface Queries
Printing Support
Data Types
Modes of KernelCAD Control
DIObjectGenerator class
Properties
FlatObjectArray Poperty
Context
64 bit development
Dual Mode
Initialisation Context
Overlay Editor
Memory Management
Input validation
Collapse Advanced functionalityAdvanced functionality
Collapse InterfacesInterfaces
Alphabetical list
I3DGrid
I3DBugger
I3Dpt
IAxiBase
IAxis
IBoolSection
IBoolSectionEx
IBoundary
IColor
IConstraint
IData
IDiffSurface_KC
IDIFont
IDraw
IDrawUtil
IDraw2
IElem
IElement
IKCLine
ILightSource
ILocation
ILocationEx
IMaterial
IMetrics
IMetrics2
IModel
IModel2
IModelEx
IPatch
IKCPathCollisionDetector
IProfiles
IPropertyArray
IPropertyArray2
IStdShape
IStrip
ISurface
IText
ITexture
ITransform
IUnknown
Collapse Open Cascade TechnologyOpen Cascade Technology
Collapse DataData
Collapse MovementMovement
Collapse FramesFrames
Collapse Oriented ObjectsOriented Objects
Collapse SectionsSections
Collapse GeneralGeneral
Collapse Topological InterfacesTopological Interfaces
Collapse Viewing InterfacesViewing Interfaces
Collapse Lines And CurvesLines And Curves
Collapse Symmetry InterfacesSymmetry Interfaces
Collapse Clipping plane interfacesClipping plane interfaces
Collapse AlgorithmsAlgorithms
Collapse 2D Geometry2D Geometry
Collapse Programming Samples and TutorialsProgramming Samples and Tutorials
Collapse OverviewOverview
Collapse DeploymentDeployment
Collapse .NET Samples.NET Samples
Collapse C++ SamplesC++ Samples
Collapse Visual Basic SamplesVisual Basic Samples
Collapse Delphi SamplesDelphi Samples
Collapse 3D Debugger3D Debugger
Collapse DeploymentDeployment
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > KernelCAD Components > Interfaces > Topological Interfaces > IDIObjGenerator
IDIObjGenerator Interface

IDIObjGenerator Interface

Create
Create2
Create3

DIObjGenerator serves as a constructor of objects. 

DIObjGenerator is implemented by DIObjGenerator. In this release the only object, which can be created using this interface is a line.

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 KernelCAD 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 **iUnknownt)

Parameters

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

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:

Create3 is another version of the Create method aded in version 4.0 for wrapped OCCT types. The type parameter is described in documentation of relevant interfaces. For OCCT - related interfaces the name coinsides 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