Model |
public class ModelMoverVisual3D : ModelVisual3D
The ModelMoverVisual3D type exposes the following members.
Name | Description | |
---|---|---|
ModelMoverVisual3D | Initializes a new instance of the ModelMoverVisual3D class. | |
ModelMoverVisual3D(Vector3D, Vector3D, Vector3D, String) | Initializes a new instance of the ModelMoverVisual3D class with providing custom axes. |
Name | Description | |
---|---|---|
AxisArrowRadius | Gets or sets the radius of the axis arrows. | |
AxisLength | Gets or sets the length of axes that are shown by ModelMover. Default value is 100. | |
AxisRadius | Gets or sets the radius of the axis arrows. | |
IsXAxisShown | Gets or sets a Boolean that specifies if the X axis is shown. Default value is true. | |
IsYAxisShown | Gets or sets a Boolean that specifies if the Y axis is shown. Default value is true. | |
IsZAxisShown | Gets or sets a Boolean that specifies if the Z axis is shown. Default value is true. | |
MoveVector3D | Gets the Vector3D that specifies the amount of move that was performed by the user. | |
Position | Gets or sets Point3D that specifies the position of the ModelMover axis origin. | |
SelectedCursor | Gets or sets a Cursor that is shown when mouse is over the arrow. If set to null, cursor is not changed. Default value is Hand. | |
SelectedMaterial | Gets or sets a Material that is used when mouse is over the arrow. If set to null, the arrow material is not changed. Default value is Yellow DiffuseMaterial. | |
ShowMovablePlanes | Gets or sets boolean that specifies if planes that allow moving object on a plane are visible. Default value is true. | |
XAxisColor | Gets or sets the color of X axis. | |
YAxisColor | Gets or sets the color of Y axis. | |
ZAxisColor | Gets or sets the color of Z axis. |
Name | Description | |
---|---|---|
OnModelMoved | OnModelMoved | |
OnModelMoveEnded | OnModelMoveEnded | |
OnModelMoveStarted | OnModelMoveStarted | |
SetRotation | SetRotation rotates the ModelMoverVisual3D by the specified RotateTransform3D. When set to null, then rotation is removed from the ModelMoverVisual3D. | |
SubscribeWithEventManager3D | SubscribeWithEventManager3D method can be used to use EventManager3D for mouse events processing instead of using UIElement3D for mouse events. This can be used when ModelMoverVisual3D is used inside Ab3d.DXEngine that does not support processing events on UIElement3D objects. In this case the CustomEventsSourceElement on EventManager3D must be set. |
Name | Description | |
---|---|---|
ModelMoved | ModelMoved event is fired when model is moved. Event handler can get the amount of move by getting the value of the MoveVector3D property. | |
ModelMoveEnded | ModelMoveEnded event is fired when moving of the model is stopped. | |
ModelMoveStarted | ModelMoveStarted event is fired when moving of the model is started. |
Name | Description | |
---|---|---|
AxisArrowRadiusProperty | AxisArrowRadiusProperty | |
AxisLengthProperty | AxisLengthProperty | |
AxisRadiusProperty | AxisRadiusProperty | |
DefaultXAxis | X axis that is used by the default constructor (without any parameters or when defined in XAML). | |
DefaultYAxis | Y axis that is used by the default constructor (without any parameters or when defined in XAML). | |
DefaultZAxis | Z axis that is used by the default constructor (without any parameters or when defined in XAML). | |
IsXAxisShownProperty | IsXAxisShownProperty | |
IsYAxisShownProperty | IsYAxisShownProperty | |
IsZAxisShownProperty | IsXAxisShownProperty | |
PositionProperty | PositionProperty | |
ShowMovablePlanesProperty | ShowMovablePlanesProperty | |
XAxisColorProperty | XAxisColorProperty | |
YAxisColorProperty | YAxisColorProperty | |
ZAxisColorProperty | ZAxisColorProperty |
Name | Description | |
---|---|---|
DumpHierarchy |
Display details about the hierarchy of Visual3D children to Debug console (for example to Visual Studio's Immediate window).
(Defined by Extensions) | |
ForEachGeometryModel3D |
Performs the specified action on each GeometryModel3D inside the rootModelVisual3D.
(Defined by Extensions) | |
ForEachVisual3D |
Performs the specified action on each ModelVisual3D inside the rootModelVisual3D.
(Defined by Extensions) | |
GetName |
Gets name of the Visual3D that was previously set by SetName extension method.
(Defined by Extensions) | |
SetName |
Sets Name property to Visual3D. Note that if name is not correct for WPF, it can be corrected (name must start with a letter or the underscore character (_), and must contain only letters, digits, or underscores).
In this case the SetName method will set the corrected name to the object and return false (in this case you can call GetName to get the corrected name). True is returned when the original name is set to the object.
(Defined by Extensions) |
ModelMoverVisual3D is a ModelVisual3D object that shows 3 arrows and 3 planes that can be used by user to move a 3D model with dragging the arrows with the mouse.
By default the ModelMoverVisual3D uses shows the arrows in the direction of the standard WPF's axes. But you can change that with using a ModelMoverVisual3D constructor that takes 3 axes as parameter and define your own direction of axes - for example:
You can even define angles that are not aligned with coordinate axes:
When you are using Ab3d.DXEngine to show your scene, it is recommended to show ModelMoverVisual3D in a Viewport3D that is shown over the DXViewportView (as demonstrated in the ModelMoverOverlaySample sample). Note that in this case you cannot use DirectXOverlay as PresentationType because this will prevent showing the Viewport3D overlay.
If you need to use DirectXOverlay as PresentationType or prefer to show ModelMoverVisual3D inside selected object (as demonstrated in the ModelMoverInsideObjectSample sample), then by default the ModelMoverVisual3D will not work because mouse events on UIElement3D objects that are used inside MouseMoverVisual3D will not work.
To make MouseMoverVisual3D work inside Ab3d.DXEngin, the MouseMoverVisual3D also support using Ab3d.Utilities.EventManager3D for processing mouse events.
To make MouseMoverVisual3D work inside DXEngine, the following code changes need to be done:
1) EventManager3D needs to be created and its CustomEventsSourceElement must be set the DXViewportView or a parent Border or some other parent element that has Background property set.
2) When ModelMoverVisual3D is created, we need to call the SubscribeWithEventManager3D method on the created ModelMoverVisual3D and pass the EventManager3D as parameter.
3) To allow user to click on arrows that are inside the selected model, we need to exclude the selected model from being processed by EventManager3D. This can be done with calling RegisterExcludedVisual3D on EventManager3D.
4) Because we called RegisterExcludedVisual3D, we need to call RemoveExcludedVisual3D after the mouse moving is completed.
See the ModelMoverInsideObjectSample sample that comes with Ab3d.DXEngine samples for more information.