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


IObject_KC Interface

IsEqual
GetHash
Copy
Replicate
Convert
Execute

IObject_KC interface represents generic properties of a software object. It can be queried from Entities and other objects, which not always are geometry-related. See also ITypeBasic_KC Interface

See also Interface List


HRESULT IsEqual(IObject_KC* object, VARIANT_BOOL* equal)

Parameters

object - [in] object to compare

equal - [out, retval] The return value. See remarks.

Remarks:

The method returns true if object and the object, which implements this interface is the same instance of a software object


HRESULT GetHash(int* hash)

Parameters

hash - [out, retval] The return value. See remarks.

Remarks:

Returns hash code, which is a piece of data which identifies the instance. Two objects are identical if and only if their hash codes coincide.


HRESULT Copy(IObject_KC* object)

Parameters

object - [in] object to copy

Remarks:

Copies internal state of object to the object, which implements this interface. If the objects have the same type state of all attributes after this call will be the same. For example if both interfaces where queried from mesh entities their surfaces will be geometrically the same.

When objects have different type the types must be related, in which case only the relevant shared set of attributes will be copied. For example when a mesh entity copied from a point set entity only entity name, local frame, user data and some other information is copied. Use ITypeBasic_KC2.GetCompatibleTypes to enumerate related types

The copy operation is "by value". For example in case of entities coordinates of local frames are copied, not reference to the local frame.


HRESULT Replicate(IObject_KC** object)

Parameters

object - [out, retval] - The returned copy of this object

Remarks:

Returns a new identical copy of the object, which implements this interface.


HRESULT Convert(int typeID, IObject_KC** object)

Parameters

typeID - [in] Identifies the type to convert this object to. Valid values are enumerated in EObjectType

object - [out, retval] - The returned transformed copy of this object

Remarks:

Use this method to cast / downgrade / upgrade an object to a different type. The method creates a new converted copy. This (original) object remains unchanged. Not all types can be converted. Use ITypeBasic_KC2.GetCompatibleTypes to enumerate types to which this object can be converted.

When this object (the object which implements the interface) already has the specified type no new object is created and method returns a copy of this interface

Example. The code below:

Dim iObj As IObject_KC = iEntity                  'Assuming iEntity is a 3DS or SOR entity

Dim iObjectNew As IObject_KC = iObj.Convert( EObjectType.eObjTypeMeshEntity )

Dim iSectMesh As ISection = iObjectNew

will convert any entity which has  surface to Mesh Entity


HRESULT Execute(char* operation, IDictionary_KC* context, VARIANT_BOOL* success)

Parameters

operation-[in] - Name of the operation

context-[in] - Additional parameters or null

object -[out, retval] - Success code

Remarks:

 The functionality provided by this method is documented on per use basis. The method is implemented by some object and some relatively rare operations


HRESULT Execute(char* operation, IDictionary_KC* context, VARIANT_BOOL* success)

Parameters

operation - [in] - Name of the operation. In this release must be only "UpdateTextureFromPerVertexColor"

context - [in] - Additional options for the operation. Can be Nothing (null)

Remarks:

Executes rarely used operations.

UpdateTextureFromPerVertexColor operation

Assuming the object implementing this interface is a MeshEntity with per vertex colors, the operation creates or updates texture of the object, which will contain image of the object viewed from a direction either specified via the context or calculated automatically

Parameters supplied via context:

Name Type Default Description
ImageSizeX Integer 0 or 600 If Both ImageSizeY and ImageSizeY are zero 600 is used
ImageSizeY Integer 0 or 400 If Both ImageSizeY and ImageSizeY are zero 400 is used
IView Interface null If provided must be IView interface, in which case the image for the texture will appear close to the currently displayed in 3D view
DirectionViewX Double 0.0 These three parameters specify direction of view used to generate image for the texture
DirectionViewY Double 0.0 These parameters are not used if the IView interface was provided
DirectionViewZ Double 0.0 The direction must be, similar to normals, outwards away from the object

If neither IView nor DirectionView* parameters are provided the direction of view will be calculated automatically to view the largest nearly flat surface of the object

If only one positive image size is specified the other is calculated automatically using aspect ratio of the visible part of the object. Horizontal side of the image is always oriented along the longer side of the object. Because of this ImageSizeX is expected to be greater than or equal to ImageSizeY

If neither image size is specified a default size is used

This operation is computationally intensive and slow for large image size and meshes. It is recommended to do few experiments starting with small image sizes