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


ITransform Interface

TranslateLoc
ScaleLoc
RotateLoc
Apply
RotateLoc2

The interface allows changing size of objects or translating surface relative to the local frame. Unlike object movement interfaces (I3DObject, IFrame, IFrame2) which move the object along with its local frame as a whole, ITransform modifies parameters of surface of the object because relative position/orientation of the local frame and surface of the object is modified.

ITransform can be queried from the relevant ISection interface.

See also: Interface List


HRESULT TranslateLoc(double vx, double vy, double vz, VARIANT_BOOL includeChildren)

Parameters

vx,vy,vz - [in] Coordinates of the translation vector in local frame of the object.

includeChildren - [in] if true the operation is applied to all children of the object too.

Remarks:

The methods modifies geometry of the object so that it appears translated relative to the local system of coordinates. When includeChildren is true all children of the object are translated by vx,vy,vz along with its local frame. UpdateSurface must be called after this method for the object to be rendered correctly 

Note: sequence of calls IFrame2.Translate(vx, vy, vz) ITransform.TranslateLoc(-vx, -vy, -vz) is equivalent to translation of local frame relative to the object, or in other words repositioning of the local frame. 

For curved patches of 3DS objects scaling may change slightly curvature of patches as exact transformation is not always geometrically possible. 

Translation of  SOR objects translates the surface along the axis in positive or negative direction of z-axis when vx and vy are 0. When vx or vy are not 0 but equal the generatrix  is translated in x and z plane along two-dimensional vector (vx,vz).  


HRESULT ScaleLoc(double scalex, double scaley, double scalez, VARIANT_BOOL includeChildren)

Parameters

scalex, scaley, scalez - [in] multipliers for scaling up or down respective dimension of the object in the local axes. All multipliers must be strictly greater than 0. Dimension of the object will be increased or decreased depending whether the respective multiplier is greater or less than 1. Supplying 1 for a multiplier will leave the dimension unchanged.

includeChildren - [in] if true the operation is applied to all children of the object too.

Return Values

DISP_E_PARAMNOTOPTIONAL if some of the multipliers are near zero (less than 1e-3) or negative.
 
Remarks:

The method modifies geometry of the object so that its size will be multiplied as expressed relative to the local system of coordinates. When, for example, all scalex, scaley, scalez are equal to 2.0 the object will be twice as large, When multipliers are not the same the object will appear stretched or contracted. 

For SOR objects when vx and vy are not equal the object is converted to Mesh Entity type prior the scaling operation. 

UpdateSurface must be called after this method for the object to be rendered correctly.

To scale against a point other that origin of the local frame use TranslateLoc method to translate the object prior the operation. Most often it is needed to call TranslateLoc afterwards with the opposite vector to translate the object back.

When includeChildren is true the operation is applied to all children of the object with scales transformed appropriately to the local frame of the child.


HRESULT RotateLoc(double degrees, DIVect* axis, VARIANT_BOOL frameOrObject)

Parameters

degrees - [in] Angle of rotation in degrees

axis - [in] Axis of rotation in local frame of the object. For 3DS and entity types this parameter is ignored and axis is assumed to be (1, 0, 0) vector.

frameOrObject- [in] if true the local frame is rotated. Otherwise surface of the object is rotated, while the local frame remains unchanged

Return Values

ERROR_INVALID_STATE if the rotation can not be performed for the type of the object.
 
Remarks:

The method modifies relative orientation of local frame of the object and surface of the object. This operation is considered as a geometry change, which means that coordinates and parameters of elements of the surface, like vertex coordinates, will be different.

Some object types, like SOR, can not be rotated. Call to this method in this case returns the error code or throws an exception in high level environments.


HRESULT Apply(IFrame* target, VARIANT_BOOL frameOrObject)

Parameters

target - [in] IFrame, which defines the transformation. See remarks.

frameOrObject- [in] if true the local frame is made identical to target. Otherwise surface of the object is transformed as described in the remarks, while the local frame remains unchanged

Remarks:

If frameOrObject is true the surface of the object remains unchanged relative to the global frame, but local frame becomes identical to target.

If frameOrObject is false the method performs general isometric linear transformation of surface of the object. The surface under transformation is changed as if the object, which implements this ITransform, was moved in space so that its local frame coincides with target. The local frame remains the same in this case relatively to the global axes. In other words a 3D point with global coordinates x, y , z is mapped under the transformation to point with same coordinates in frame target.

Besides using IFrame of an existent object, target can be created standalone as described in IFrame topic. Use IFrame.SetAxes and IFrame.SetOrigin to manipulate the target.


HRESULT RotateLoc2(double degrees, DIPoint* originAxis, DIVect* directionAxis, VARIANT_BOOL frameOrObject, VARIANT_BOOL includeChildren)

Remarks:

This method behaves similarily to RotateLoc() above, except when includeChildren is true children of the object (or their local frames) are rotated around the same axis. Both originAxis and directionAxis must have coordinates relative to the local frame of the object this interface was queried from. originAxis and directionAxis are converted internally to a global vector on the start of the operation