KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Expand 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
Expand 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
Expand Open Cascade TechnologyOpen Cascade Technology
Expand DataData
Expand MovementMovement
Expand FramesFrames
Expand Oriented ObjectsOriented Objects
Expand SectionsSections
Collapse GeneralGeneral
Expand Container InterfacesContainer Interfaces
IObject_KC
ITypeBasic_KC2
IModelSearch_KC
IBitmap
IBlob
IKCContext
IKCContext2
IError_KC
IKCStack
ILineStyle_KC
IMenu_KC
IMenuItem_KC
IGlobalAPI_KC
IControlInitialisationContext_KC
IRange
IRectangleAxisAligned_KC
ITechnology_DG
Expand Topological InterfacesTopological Interfaces
Expand Viewing InterfacesViewing Interfaces
Expand Lines And CurvesLines And Curves
Expand Symmetry InterfacesSymmetry Interfaces
Expand Clipping plane interfacesClipping plane interfaces
Expand AlgorithmsAlgorithms
Expand 2D Geometry2D Geometry
Expand Programming Samples and TutorialsProgramming Samples and Tutorials
Expand 3D Debugger3D Debugger
Expand DeploymentDeployment
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > KernelCAD Components > Interfaces > General > IObject_KC
IObject_KC Interface

IObject_KC Interface

IsEqual
GetHash
Copy
Replicate
Convert
Execute

IObject_KC interface represents generic properties of a software object. It can be queried from Sections and other object, 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 sections 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 section copied from a point set section only section 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 sections 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) alredy 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 = iSection                  'Assuming iSection is a a href="../../3DSection.aspx">3DS or SOR section

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

Dim iSectMesh As ISection = iObjectNew

will convert any section which has  surface to Mesh Section


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] - Succes 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 MeshSection 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 suppllied 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 dispalyed 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