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


IArc Interface

GetCurvature
SetCurvature
Init
IsValid
MakeValid
SetEndPoint

The interface is implemented by arcs and 2D straight lines. To access 2D end points of the arc query ILine2D from this interface. Use IArcEx queried from this to perform additional calculations related to arc.

IArc interface is returned from other interfaces which give access to more complex objects. To create a standalone arc to for some calculations call IObjectGenerator_DG.Create("Arc"). The returned IUnknown reference has actual type IArc. Use query if your environment does not allow direct cast.

Implements also: IArcEx, IObject_DG.

See also Interface List


HRESULT GetCurvature(double* curv)

Parameters

curv - [out] The returned Curvature of the arc

Remarks:

The method returns Curvature of the arc


HRESULT SetCurvature(double curv)

Parameters

curv - [in] New value for Curvature of the arc

Remarks:

The method does no check validity of the resulting arc, assuming that further modifications may follow before usage of the arc object. If arc has been modified with this method the Init method below must be called prior calling enhanced methods ( any method of IArcEx, except of IArcEx.Radius() )


HRESULT Init(VARIANT_BOOL *success)

Parameters

success - [out, retval] The returned success code. True if the arc was valid or false otherwise.

Remarks:

This method updates internal state of the software object. It must be called after any changes to primary properties of the arc (ends and curvature) and before calling enhanced methods exposed by the arc (any method of IArcEx, except of IArcEx.Radius() ). False return code means that the arc is in invalid state and cannot be initialized. To resolve this issue either set curvature to a number in [-d/2, d/2] range, where d is distance between arc ends or reduce distance between ends to 2/Curvature and call the method again. Note that arcs with curvature 0 (straight lines) are always valid.

Note once this method was called successfully (arc is valid) the arc becomes Initialized. Calling this method again for a initialized arc is not an error and does not affect performance.


HRESULT IsValid(VARIANT_BOOL *success*valid))

Parameters

success - [out, retval]  True if the arc is valid or false otherwise.

Remarks:

HRESULT MakeValid(VARIANT_BOOL *modified)

Parameters

modified - [out,retval] True if curvature was modified and the arc has become valid. False if there were no changes because the arc was valid prior the call

Remarks:

The method exits without any changes and returns false if the arc was valid otherwise it modifies curvature of the arc to the nearest valid value and returns true. See Init() for more information.


HRESULT SetEndPoint(int end, double x, double y)

Parameterss

end - [in] 0 for the first end 1 for the second end. No other values are accepted

x, y - [in] New coordinates of the end point

Remarks:

This method modifies the specified end of the arc. As curvature remains unchanges the arc may become invalid. See Init() above for more information.