Nevron .NET Vision Documentation

Models are transformable elements (derived from the NTransformableElement class) and as such host some transformable content, whose definition is not affected by the transformations applied to the element. Models are used for the hierarchical modeling of complex real world abstractions (see Coordinate Systems for more information).

In the DOM, models are represented by an instance of the NModel abstract class. In general there are only two types of models - primitive models and aggregate models. Aggregate models are assembled from other primitive and/or aggregate models. They use the following class hierarchy:


Common model features

The NModel class adds support for the following common features shared by all models:

Primitive models

Primitive models are leaf elements derived from NModel, which host the content of a single model. All primitive models derive from the base NPrimitiveModel abstract class. Currently there are only two types of primitive models - paths and texts. They use the following class hierarchy:

Common for all primitive models is that they all contain a set of properties beginning with the "Model" prefix, which allow you to directly modify certain aspects of their model definition. For example: the ModelFirstControlPoint property of the NBezierCurvePath primitives controls the position of the bezier curve first control point in model coordinates.

See Paths and Texts for more information.

Aggregate models

Aggregate models are branch elements derived from NModel, which aggregate the content of other primitive and/or aggregate models. All aggregate models derive from the base NAggregateModel abstract class. Aggregate models use the following class hierarchy:


Aggregate models share the following set of common features:

Model Scaling

The only meaningful transform operation, which can be applied to the content of a model is scaling. Model scaling is different from transformation based scaling, since it directly scales the model definition (e.g. alters the models definition, not the transformation of the model). You can perform model scaling with the help of the ScaleModel method of the NModel class.

For a primitive model this will always scale the model definition of this model. For example: calling the ScaleModel method of a NPolygonPath primitive will scale the model points of the polygon. 

Since an aggregate model does not have a model definition of it's own, this operation must somehow resize the aggregated models. The actual way in which an aggregated model is resized depends on the value of it's ResizeInAggregate property (accepts values from the ResizeInAggregate enumeration). If this value is set to UseAggregateSettings the model will be resized in accordance with the aggregate model ResizeAggregatedModels property (accepts values from the ResizeAggregatedModels enumeration).

Although there are a lot of resize modes, they actually specify two aspects of the resize, which must be performed - the type of scaling and whether the model should be repositioned after scaling.

In general there are four type of scaling:

Reposition refers to the ability to specify whether the model pin point must preserve its location relative to the resized aggregate model bounds (i.e. whether the model must be "pinned" to its relative location in the aggregate).


Related Examples
Windows Forms: Document Object Model - Groups - Group Resize
See Also



©2019. Nevron Software LLC.

Send Feedback