SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
vtkConeRepresentation Class Reference

defining the representation for a vtkConeFrustum More...

#include <vtkConeRepresentation.h>

Inheritance diagram for vtkConeRepresentation:
[legend]
Collaboration diagram for vtkConeRepresentation:
[legend]

Classes

struct  Element
 

Public Types

enum  _InteractionState {
  Outside = 0, Moving, PushingBottomFace, PushingTopFace,
  AdjustingBottomRadius, AdjustingTopRadius, MovingBottomHandle, MovingTopHandle,
  MovingWhole, RotatingAxis, Scaling, TranslatingCenter
}
 
typedef vtkWidgetRepresentation Superclass
 Standard methods for the class.
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkConeRepresentationNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
 vtkConeRepresentation (const vtkConeRepresentation &)=delete
 
vtkConeRepresentationoperator= (const vtkConeRepresentation &)=delete
 
bool SetEndpoint (bool isBottom, double x, double y, double z)
 Set/get an endpoint of the cone.
 
bool SetEndpoint (bool isBottom, const vtkVector3d &pt)
 
vtkVector3d GetEndpoint (bool isBottom) const
 
bool SetBottomEndpoint (double x, double y, double z)
 
bool SetBottomEndpoint (const vtkVector3d &pt)
 
vtkVector3d GetBottomEndpoint () const
 
void SetBottomPoint (double x, double y, double z)
 
void SetBottomPoint (double *x) VTK_SIZEHINT(3)
 
double * GetBottomPoint () VTK_SIZEHINT(3)
 
bool SetTopEndpoint (double x, double y, double z)
 
bool SetTopEndpoint (const vtkVector3d &pt)
 
vtkVector3d GetTopEndpoint () const
 
void SetTopPoint (double x, double y, double z)
 
void SetTopPoint (double *x) VTK_SIZEHINT(3)
 
double * GetTopPoint () VTK_SIZEHINT(3)
 
bool SetRadius (bool isBottom, double r)
 Set/get a radius of the cylinder. More...
 
double GetRadius (bool isBottom) const
 
bool SetBottomRadius (double r)
 
double GetBottomRadius () const
 
bool SetTopRadius (double r)
 
double GetTopRadius () const
 
bool SetCylindrical (int)
 Force the cone widget to produce cylinders (i.e., make the two radii identical). More...
 
virtual int GetCylindrical ()
 
virtual void CylindricalOn ()
 
virtual void CylindricalOff ()
 
void SetAlongXAxis (vtkTypeBool)
 Force the cone widget to be aligned with one of the x-y-z axes. More...
 
virtual vtkTypeBool GetAlongXAxis ()
 
virtual void AlongXAxisOn ()
 
virtual void AlongXAxisOff ()
 
void SetAlongYAxis (vtkTypeBool)
 
virtual vtkTypeBool GetAlongYAxis ()
 
virtual void AlongYAxisOn ()
 
virtual void AlongYAxisOff ()
 
void SetAlongZAxis (vtkTypeBool)
 
virtual vtkTypeBool GetAlongZAxis ()
 
virtual void AlongZAxisOn ()
 
virtual void AlongZAxisOff ()
 
void SetDrawCone (vtkTypeBool drawCyl)
 Enable/disable the drawing of the cylinder. More...
 
virtual vtkTypeBool GetDrawCone ()
 
virtual void DrawConeOn ()
 
virtual void DrawConeOff ()
 
virtual void SetResolution (int)
 Set/Get the resolution of the cylinder. More...
 
virtual int GetResolution ()
 
virtual void SetTolerance (double)
 Set/Get the tolerance of the cylinder. More...
 
virtual double GetTolerance ()
 
virtual void SetTubing (vtkTypeBool)
 Turn on/off tubing of the wire outline of the cylinder intersection (against the bounding box). More...
 
virtual vtkTypeBool GetTubing ()
 
virtual void TubingOn ()
 
virtual void TubingOff ()
 
virtual void SetScaleEnabled (vtkTypeBool)
 Turn on/off the ability to scale the widget with the mouse.
 
virtual vtkTypeBool GetScaleEnabled ()
 
virtual void ScaleEnabledOn ()
 
virtual void ScaleEnabledOff ()
 
void GetCone (vtkImplicitConeFrustum *cone)
 Get the implicit function for the cone. More...
 
void UpdatePlacement ()
 Satisfies the superclass API. More...
 
virtual vtkProperty * GetHandleProperty ()
 Get the properties on the axis (line and cone).
 
virtual vtkProperty * GetSelectedHandleProperty ()
 
virtual vtkProperty * GetConeProperty ()
 Get the cylinder properties. More...
 
virtual vtkProperty * GetSelectedConeProperty ()
 
virtual vtkProperty * GetEdgeProperty ()
 Get the property of the intersection edges. More...
 
int ComputeInteractionState (int X, int Y, int modify=0) override
 Methods to interface with the vtkImplicitCylinderWidget.
 
void PlaceWidget (double bounds[6]) override
 
void BuildRepresentation () override
 
void StartWidgetInteraction (double eventPos[2]) override
 
void WidgetInteraction (double newEventPos[2]) override
 
void EndWidgetInteraction (double newEventPos[2]) override
 
double * GetBounds () override
 Methods supporting the rendering process.
 
void GetActors (vtkPropCollection *pc) override
 
void ReleaseGraphicsResources (vtkWindow *) override
 
int RenderOpaqueGeometry (vtkViewport *) override
 
int RenderTranslucentPolygonalGeometry (vtkViewport *) override
 
vtkTypeBool HasTranslucentPolygonalGeometry () override
 
virtual void SetBumpDistance (double)
 Specify a translation distance used by the BumpCone() method. More...
 
virtual double GetBumpDistance ()
 
void BumpCone (int dir, double factor)
 Translate the cylinder in the direction of the view vector by the specified BumpDistance. More...
 
void PushCone (double distance)
 Push the cylinder the distance specified along the view vector. More...
 
virtual void SetInteractionState (int)
 The interaction state may be set from a widget (e.g., vtkImplicitCylinderWidget) or other object. More...
 
virtual void SetRepresentationState (int)
 Sets the visual appearance of the representation based on the state it is in. More...
 
virtual int GetRepresentationState ()
 
void RegisterPickers () override
 
void SwapTopAndBottom ()
 Swap the top and bottom points and radii.
 

Static Public Member Functions

static vtkConeRepresentationNew ()
 Instantiate the class.
 
static int IsTypeOf (const char *type)
 
static vtkConeRepresentationSafeDownCast (vtkObjectBase *o)
 
static std::string InteractionStateToString (int)
 

Protected Types

enum  ElementType {
  ConeFace = 0, BottomFace, TopFace, ConeAxis,
  BottomCurve, TopCurve, BottomHandle, TopHandle,
  NumberOfElements
}
 Visual elements of the representation.
 

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 
void HighlightElement (ElementType elem, int highlight)
 
void HighlightCone (int highlight)
 
void HighlightAxis (int highlight)
 
void HighlightCap (bool isBottom, int highlight)
 
void HighlightCurve (bool isBottom, int highlight)
 
void HighlightHandle (bool isBottom, int highlight)
 
void Rotate (double X, double Y, double *p1, double *p2, double *vpn)
 
void TranslateCone (double *p1, double *p2)
 
void PushCap (bool isBottom, double *p1, double *p2)
 
void AdjustBottomRadius (double X, double Y, double *p1, double *p2)
 
void AdjustTopRadius (double X, double Y, double *p1, double *p2)
 
void TranslateCenter (double *p1, double *p2)
 
void TranslateCenterOnAxis (double *p1, double *p2)
 
void TranslateHandle (bool isBottom, double *p1, double *p2)
 
void Scale (double *p1, double *p2, double X, double Y)
 
void SizeHandles ()
 
void CreateDefaultProperties ()
 

Protected Attributes

std::array< Element, NumberOfElements > Elements
 
int RepresentationState
 
double LastEventPosition [3]
 
double BumpDistance { 0.01 }
 
vtkTypeBool AlongXAxis { 0 }
 
vtkTypeBool AlongYAxis { 0 }
 
vtkTypeBool AlongZAxis { 0 }
 
vtkNew< vtkConeFrustumCone
 
int Resolution { 128 }
 
double Tolerance { 1e-8 }
 
vtkTypeBool ScaleEnabled { 1 }
 
vtkTypeBool DrawCone { 1 }
 
vtkNew< vtkTubeFilter > AxisTuber
 
vtkTypeBool Tubing { 1 }
 
int Cylindrical { 0 }
 
vtkNew< vtkSphereSource > Sphere
 
vtkNew< vtkCellPicker > Picker
 
vtkNew< vtkCellPicker > CylPicker
 
vtkNew< vtkProperty > HandleProperty
 
vtkNew< vtkProperty > SelectedHandleProperty
 
vtkNew< vtkProperty > ConeProperty
 
vtkNew< vtkProperty > SelectedConeProperty
 
vtkNew< vtkProperty > EdgeProperty
 
vtkNew< vtkProperty > SelectedEdgeProperty
 
vtkNew< vtkBox > BoundingBox
 
vtkNew< vtkGlyph3DMapper > BottomHandleMapper
 
vtkNew< vtkGlyph3DMapper > TopHandleMapper
 
vtkNew< vtkTransform > Transform
 

Detailed Description

defining the representation for a vtkConeFrustum

This class is a concrete representation for the vtkConeWidget. It represents a finite cylinder defined by 2 radii and 2 endpoints. This cylinder representation can be manipulated by using the vtkConeWidget to adjust the radii and endpoints.

See also
vtkConeWidget

Member Function Documentation

◆ BumpCone()

void vtkConeRepresentation::BumpCone ( int  dir,
double  factor 
)

Translate the cylinder in the direction of the view vector by the specified BumpDistance.

The dir parameter controls which direction the pushing occurs, either in the same direction as the view vector, or when negative, in the opposite direction. The factor controls what percentage of the bump is used.

◆ GetCone()

void vtkConeRepresentation::GetCone ( vtkImplicitConeFrustum cone)

Get the implicit function for the cone.

The user must provide an instance vtkImplicitConeFrustum; upon return, it will be set to the difference between an infinite cone and the two cutting planes. The returned implicit can be used by a variety of filters to perform clipping, cutting, and selection of data.

◆ GetConeProperty()

virtual vtkProperty* vtkConeRepresentation::GetConeProperty ( )
virtual

Get the cylinder properties.

The properties of the cylinder when selected and unselected can be manipulated.

◆ GetEdgeProperty()

virtual vtkProperty* vtkConeRepresentation::GetEdgeProperty ( )
virtual

Get the property of the intersection edges.

(This property also applies to the edges when tubed.)

◆ PushCone()

void vtkConeRepresentation::PushCone ( double  distance)

Push the cylinder the distance specified along the view vector.

Positive values are in the direction of the view vector; negative values are in the opposite direction. The distance value is expressed in world coordinates.

◆ SetAlongXAxis()

void vtkConeRepresentation::SetAlongXAxis ( vtkTypeBool  var)

Force the cone widget to be aligned with one of the x-y-z axes.

If one axis is set on, the other two will be set off. Remember that when the state changes, a ModifiedEvent is invoked. This can be used to snap the cylinder to the axes if it is originally not aligned.

◆ SetBumpDistance()

virtual void vtkConeRepresentation::SetBumpDistance ( double  )
virtual

Specify a translation distance used by the BumpCone() method.

Note that the distance is normalized; it is the fraction of the length of the bounding box of the wire outline.

◆ SetCylindrical()

bool vtkConeRepresentation::SetCylindrical ( int  )

Force the cone widget to produce cylinders (i.e., make the two radii identical).

When set, if the two radii are not already identical, the average radius will be used.

◆ SetDrawCone()

void vtkConeRepresentation::SetDrawCone ( vtkTypeBool  drawCyl)

Enable/disable the drawing of the cylinder.

In some cases the cylinder interferes with the object that it is operating on (e.g., the cylinder interferes with the cut surface it produces resulting in z-buffer artifacts.) By default it is off.

◆ SetInteractionState()

virtual void vtkConeRepresentation::SetInteractionState ( int  )
virtual

The interaction state may be set from a widget (e.g., vtkImplicitCylinderWidget) or other object.

This controls how the interaction with the widget proceeds. Normally this method is used as part of a handshaking process with the widget: First ComputeInteractionState() is invoked that returns a state based on geometric considerations (i.e., cursor near a widget feature), then based on events, the widget may modify this further.

◆ SetRadius()

bool vtkConeRepresentation::SetRadius ( bool  isBottom,
double  r 
)

Set/get a radius of the cylinder.

Negative values are generally a bad idea but not prohibited at this point. They will result in bad surface normals, though.

◆ SetRepresentationState()

void vtkConeRepresentation::SetRepresentationState ( int  state)
virtual

Sets the visual appearance of the representation based on the state it is in.

This state is usually the same as InteractionState.

◆ SetResolution()

virtual void vtkConeRepresentation::SetResolution ( int  )
virtual

Set/Get the resolution of the cylinder.

This is the number of polygonal facets used to approximate the curved cylindrical surface (for rendering purposes). A vtkConeFrustum is used under the hood to provide an exact surface representation.

◆ SetTolerance()

virtual void vtkConeRepresentation::SetTolerance ( double  )
virtual

Set/Get the tolerance of the cylinder.

This how close the endpoints are allowed to be. It is initially set to 1e-8.

Note that this is an absolute distance in world coordinates, so if your scene is very small, you may need to adjust this.

◆ SetTubing()

virtual void vtkConeRepresentation::SetTubing ( vtkTypeBool  )
virtual

Turn on/off tubing of the wire outline of the cylinder intersection (against the bounding box).

The tube thickens the line by wrapping with a vtkTubeFilter.

◆ UpdatePlacement()

void vtkConeRepresentation::UpdatePlacement ( )

Satisfies the superclass API.

This will change the state of the widget to match changes that have been made to the underlying PolyDataSource.


The documentation for this class was generated from the following files: