Back to index

salome-geom  6.5.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
GEOM_VTKTrihedronAxis Class Reference

List of all members.

Public Member Functions

 vtkTypeMacro (GEOM_VTKTrihedronAxis, VTKViewer_Axis)
void SetAxis (const gp_Ax1 &theAxis, const int theRot, vtkFloatingPointType theColor[3])
virtual void Render (vtkRenderer *theRenderer)
virtual void SetSize (vtkFloatingPointType theSize)
gp_Pnt GetOri () const
void SetColor (const vtkFloatingPointType theColor[3])

Static Public Member Functions

static GEOM_VTKTrihedronAxisNew ()

Protected Member Functions

 GEOM_VTKTrihedronAxis ()
 GEOM_VTKTrihedronAxis (const GEOM_VTKTrihedronAxis &)
 ~GEOM_VTKTrihedronAxis ()

Private Attributes

vtkFloatingPointType myOri [3]
vtkMatrix4x4 * myMatrix
vtkTransform * myTrsf

Detailed Description

Definition at line 57 of file GEOM_VTKTrihedron.cxx.


Constructor & Destructor Documentation

Definition at line 85 of file GEOM_VTKTrihedron.cxx.

Here is the call graph for this function:

Definition at line 92 of file GEOM_VTKTrihedron.cxx.

{
  myMatrix->Delete();
  myTrsf->Delete();
}

Member Function Documentation

Definition at line 147 of file GEOM_VTKTrihedron.cxx.

{
  return gp_Pnt( myOri[ 0 ], myOri[ 1 ], myOri[ 2 ] );
}

Here is the caller graph for this function:

Here is the caller graph for this function:

void GEOM_VTKTrihedronAxis::Render ( vtkRenderer *  theRenderer) [virtual]

Definition at line 135 of file GEOM_VTKTrihedron.cxx.

{
  myLineActor->Render( theRenderer );
  myArrowActor->Render( theRenderer );
#ifndef IPAL21440
  myLabelActor->Render( theRenderer );
#endif

  vtkCamera* aCamera = theRenderer->GetActiveCamera();
  SetCamera( aCamera );
}
void GEOM_VTKTrihedronAxis::SetAxis ( const gp_Ax1 &  theAxis,
const int  theRot,
vtkFloatingPointType  theColor[3] 
)

Definition at line 152 of file GEOM_VTKTrihedron.cxx.

{
  gp_Pnt aLoc = theAxis.Location();
  gp_Dir aDir = theAxis.Direction();

  myOri[ 0 ] = aLoc.X();
  myOri[ 1 ] = aLoc.Y();
  myOri[ 2 ] = aLoc.Z();

  myDir[ 0 ] = aDir.X();
  myDir[ 1 ] = aDir.Y();
  myDir[ 2 ] = aDir.Z();

  vtkFloatingPointType aColor[ 3 ] = { 0, 0, 0 };
  aColor[ theRot ] = 1;
  if ( theColor[ 0 ] == -1 )
    VTKViewer_Axis::SetColor( aColor[ 0 ], aColor[ 1 ], aColor[ 2 ] );
  else
    VTKViewer_Axis::SetColor( theColor[ 0 ], theColor[ 1 ], theColor[ 2 ] );

#ifdef IPAL21440
  if      ( theRot == 0 ) myTextMapper->SetInput( "X" );
  else if ( theRot == 1 ) myTextMapper->SetInput( "Y" );
  else if ( theRot == 2 ) myTextMapper->SetInput( "Z" );
#else
  if      ( theRot == 0 ) myVectorText->SetText( "X" );
  else if ( theRot == 1 ) myVectorText->SetText( "Y" );
  else if ( theRot == 2 ) myVectorText->SetText( "Z" );
#endif
}

Here is the call graph for this function:

void GEOM_VTKTrihedronAxis::SetColor ( const vtkFloatingPointType  theColor[3])

Definition at line 185 of file GEOM_VTKTrihedron.cxx.

{
  VTKViewer_Axis::SetColor( theColor[ 0 ], theColor[ 1 ], theColor[ 2 ] );
}

Here is the caller graph for this function:

void GEOM_VTKTrihedronAxis::SetSize ( vtkFloatingPointType  theSize) [virtual]

Definition at line 98 of file GEOM_VTKTrihedron.cxx.

{
  vtkFloatingPointType aPosition[ 3 ] = { myOri[ 0 ] + myDir[ 0 ] * theSize,
                                          myOri[ 1 ] + myDir[ 1 ] * theSize,
                                          myOri[ 2 ] + myDir[ 2 ] * theSize };
                           
  myLineSource->SetPoint1( myOri[ 0 ], myOri[ 1 ], myOri[ 2 ] );
  myLineSource->SetPoint2( aPosition );

  myArrowActor->SetPosition( 0, 0, 0 );
  myArrowActor->SetOrientation( 0, 0, 0 );
  myArrowActor->SetUserMatrix( 0 );
  

  gp_Trsf aTrsf;
  aTrsf.SetDisplacement( gp_Ax3( gp_Pnt( 0, 0, 0 ), gp_Dir( 1, 0, 0 ) ),
                         gp_Ax3( GetOri(), gp_Dir( myDir[ 0 ], myDir[ 1 ], myDir[ 2 ] ) ) );

//   const gp_XYZ& aTrans = aTrsf.TranslationPart();
  gp_Mat aRot = aTrsf.VectorialPart();

  for ( int i = 1; i <= 3; i++ )
    for ( int j = 1; j <= 3; j++ )
      myMatrix->SetElement( i - 1, j - 1, aRot( i, j ) );

  myArrowActor->SetUserMatrix( myMatrix );
  myArrowActor->SetPosition( aPosition );
    
#ifdef IPAL21440
  if( vtkCoordinate* aCoord = myLabelActor->GetPositionCoordinate()->GetReferenceCoordinate() )
    aCoord->SetValue( aPosition );
#else
  myLabelActor->SetPosition( 0, 0, 0 );
  myLabelActor->AddPosition( aPosition );
#endif
}

Here is the call graph for this function:


Member Data Documentation

vtkMatrix4x4* GEOM_VTKTrihedronAxis::myMatrix [private]

Definition at line 79 of file GEOM_VTKTrihedron.cxx.

vtkFloatingPointType GEOM_VTKTrihedronAxis::myOri[3] [private]

Definition at line 78 of file GEOM_VTKTrihedron.cxx.

vtkTransform* GEOM_VTKTrihedronAxis::myTrsf [private]

Definition at line 80 of file GEOM_VTKTrihedron.cxx.


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