External Models
Normally a DG Kernel component displays a single model. Sometimes it is
necessary to display different views of the same model, for example
different projections or view points.
This can be achieved with External Models.
External model is a reference to another model which belongs to another instance of a
DG Kernel component or model created and loaded independently. Reference
to an external model cal be added with IView2.AddExternalModel
IView2 can be obtained via: DG Kernel >
GetView >
IView
> IView2
When there is one or more external models attached to the component, where this
IView2 was queried from, on every
UpdateSurface call all objects of
all external models are replicated and new copies are added to the model of the
component. Replicas added by
pervious call to UpdateSurface
are removed before the operation.
Note that objects of the external models are. added "By Value", which means that
any modifications made to the external model appear in this component only after
an UpdateSurface call, not
automatically.
For example, to create an additional two dimensional view, which displays interentity
of the model with a plane:
- Add another DG Kernel control to the form
- During the form load obtain IModel
of the original 3D control: myKernelCAD_3D >
GetModel >
IModel
- Query IView2 from the second control
via: myKernelCAD_2D >
GetView >
IView
> IView2
- Call IView2.AddExternalModel
supplying IModel
obtained on the step 2.
- Setup two dimensional view of the second control as described in
2D Views.
- Call
myKernelCAD_2D.UpdateSurface to create 2D items
See Cross
View Sample for an example.
|