Skip to content

Commit

Permalink
Reimplement SetName()
Browse files Browse the repository at this point in the history
Using the same signature as vtkMRMLNode this time.

Also delete all the //-- *** --... comment

See Issue #13642
  • Loading branch information
vovythevov committed Nov 13, 2012
1 parent 748476f commit 6a4d3cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 34 deletions.
18 changes: 2 additions & 16 deletions Modules/Loadable/Armatures/MRML/Core/vtkMRMLBoneNode.cxx
Expand Up @@ -184,22 +184,19 @@ void vtkMRMLBoneNode::CreateBoneDisplayNode()
this->AddAndObserveDisplayNodeID(boneDisplayNode->GetID());
}

//-- Length -----------------------------------------------------------------
//---------------------------------------------------------------------------
double vtkMRMLBoneNode::GetLength()
{
return this->BoneProperties->GetLength();
}

//-- Name -------------------------------------------------------------------
//---------------------------------------------------------------------------
void vtkMRMLBoneNode::SetName(vtkStdString name)
void vtkMRMLBoneNode::SetName(const char* name)
{
this->BoneProperties->SetName(name);
this->Superclass::SetName(name);
}

//-- State ------------------------------------------------------------------
//---------------------------------------------------------------------------
void vtkMRMLBoneNode::SetWidgetState(int state)
{
Expand All @@ -212,7 +209,6 @@ int vtkMRMLBoneNode::GetWidgetState()
return this->BoneProperties->GetWidgetState();
}

//-- Representation ---------------------------------------------------------
namespace
{
int FindBoneRepresentationType(vtkBoneRepresentation* rep)
Expand Down Expand Up @@ -277,7 +273,6 @@ void vtkMRMLBoneNode::SetBoneRepresentationType(int type)
this->Modified();
}

//-- Color -------------------------------------------------------------------
//---------------------------------------------------------------------------
void vtkMRMLBoneNode::SetBoneColor(int rgb[3])
{
Expand All @@ -300,7 +295,6 @@ void vtkMRMLBoneNode::GetBoneColor(int rgb[3])
rgb[2] = static_cast<int>(doubleRGB[2] * 255);
}

//-- Opacity ----------------------------------------------------------------
//---------------------------------------------------------------------------
void vtkMRMLBoneNode::SetOpacity(double opacity)
{
Expand All @@ -327,7 +321,6 @@ double vtkMRMLBoneNode::GetOpacity()
return this->GetBoneRepresentation()->GetLineProperty()->GetOpacity();
}

//-- Distance ---------------------------------------------------------------
//---------------------------------------------------------------------------
double vtkMRMLBoneNode::GetDistance()
{
Expand All @@ -344,7 +337,6 @@ double vtkMRMLBoneNode::GetDistance()
this->BoneProperties->GetBoneRepresentation()->GetWorldTailPosition()));
}

//-- Roll -------------------------------------------------------------------
//---------------------------------------------------------------------------
void vtkMRMLBoneNode::SetRoll(double roll)
{
Expand All @@ -357,7 +349,6 @@ double vtkMRMLBoneNode::GetRoll()
return this->BoneProperties->GetRoll();
}

//-- World Positions -------------------------------------------------------
//---------------------------------------------------------------------------
void vtkMRMLBoneNode::SetWorldHeadRest(const double* headPoint)
{
Expand Down Expand Up @@ -426,7 +417,6 @@ void vtkMRMLBoneNode::GetWorldTailPose(double tail[3])
this->BoneProperties->GetWorldTailPose(tail);
}

//-- Local Positions -------------------------------------------------------
//---------------------------------------------------------------------------
void vtkMRMLBoneNode::SetLocalHeadRest(const double* headPoint)
{
Expand Down Expand Up @@ -495,7 +485,7 @@ void vtkMRMLBoneNode::GetLocalTailPose(double tail[3])
this->BoneProperties->GetLocalTailPose(tail);
}

//-- Show Axes --------------------------------------------------------------
//---------------------------------------------------------------------------
void vtkMRMLBoneNode::SetShowAxes(int axesVisibility)
{
this->BoneProperties->SetShowAxes(axesVisibility);
Expand All @@ -507,7 +497,6 @@ int vtkMRMLBoneNode::GetShowAxes()
return this->BoneProperties->GetShowAxes();
}

//-- World to parent transforms ---------------------------------------------
//---------------------------------------------------------------------------
void vtkMRMLBoneNode::SetWorldToParentRestRotation(const double* rotation)
{
Expand Down Expand Up @@ -574,7 +563,6 @@ double* vtkMRMLBoneNode::GetWorldToParentPoseTranslation()
return this->BoneProperties->GetWorldToParentPoseTranslation();
}

//-- Parent to bone transforms ---------------------------------------------
//---------------------------------------------------------------------------
double* vtkMRMLBoneNode::GetParentToBoneRestRotation()
{
Expand All @@ -599,7 +587,6 @@ double* vtkMRMLBoneNode::GetParentToBonePoseTranslation()
return this->BoneProperties->GetParentToBonePoseTranslation();
}

//-- World to bone transforms -----------------------------------------------
//---------------------------------------------------------------------------
double* vtkMRMLBoneNode::GetWorldToBoneRestRotation()
{
Expand Down Expand Up @@ -636,7 +623,6 @@ double* vtkMRMLBoneNode::GetWorldToBoneTailPoseTranslation()
return this->BoneProperties->GetWorldToBoneTailPoseTranslation();
}

//-- Parenthood -------------------------------------------------------------
//---------------------------------------------------------------------------
void vtkMRMLBoneNode::SetShowParenthood(int parenthood)
{
Expand Down
21 changes: 3 additions & 18 deletions Modules/Loadable/Armatures/MRML/Core/vtkMRMLBoneNode.h
Expand Up @@ -99,15 +99,12 @@ class VTK_BENDER_ARMATURES_MRML_CORE_EXPORT vtkMRMLBoneNode
/// \sa CreateDefaultStorageNode()
void CreateBoneDisplayNode();

// -- Length ----------------------------------------------------------------
/// Get the bone length.
double GetLength();

// -- Name ----------------------------------------------------------------
/// Set/Get the bone roll.
void SetName(vtkStdString name);
/// Set the bone name.
virtual void SetName(const char* name);

// -- State ----------------------------------------------------------------
/// Set/Get the bone roll.
void SetWidgetState(int state);
int GetWidgetState();
Expand All @@ -123,37 +120,31 @@ class VTK_BENDER_ARMATURES_MRML_CORE_EXPORT vtkMRMLBoneNode
};
//ETX

// -- Representation -------------------------------------------------------
/// Set/Get the bone representation.
void SetBoneRepresentation(vtkBoneRepresentation* rep);
vtkBoneRepresentation* GetBoneRepresentation();

/// Helper function to set the representation.
/// 1 for vtkCylinderBoneRepresentation, 2 for vtkDoubleConeBoneRepresentation,
/// otherwise vtkBoneRepresentation.
void SetBoneRepresentationType(int type); // \TO LOGIC ?
void SetBoneRepresentationType(int type); // \TO DO to logic
vtkGetMacro(BoneRepresentationType, int);

// -- Color ----------------------------------------------------------------
/// Helper function to set/get the representation color.
void SetBoneColor(int rgb[3]);
void GetBoneColor(int rgb[3]);

// -- Opacity --------------------------------------------------------------
/// Helper function to set/get the representation color.
void SetOpacity(double opacity);
double GetOpacity();

// -- Distance -------------------------------------------------------------
/// Helper function to get the distance between head and tail
double GetDistance();

// -- Roll -----------------------------------------------------------------
/// Set/Get the bone roll.
void SetRoll(double roll);
double GetRoll();

//-- World Positions -------------------------------------------------------
/// Set/Get the head/tail position in the world coordinates.
/// \sa GetWorldHeadRest(), GetWorldTailRest()
/// \sa GetWorldHeadPose(), GetWorldTailPose()
Expand All @@ -169,7 +160,6 @@ class VTK_BENDER_ARMATURES_MRML_CORE_EXPORT vtkMRMLBoneNode
double* GetWorldTailPose();
void GetWorldTailPose(double tail[3]);

//-- Local Positions -------------------------------------------------------
/// Set/Get the local head/tail position in the parent coordinates.
/// \sa GetLocalHeadRest(), GetLocalTailRest()
/// \sa GetLocalHeadPose(), GetLocalTailPose()
Expand All @@ -185,12 +175,10 @@ class VTK_BENDER_ARMATURES_MRML_CORE_EXPORT vtkMRMLBoneNode
double* GetLocalTailPose();
void GetLocalTailPose(double tail[3]);

// -- Show Axes -----------------------------------------------------------
/// Set/Get the bone axes visibility.
void SetShowAxes(int axesVisibility);
int GetShowAxes();

// -- World to parent transforms -------------------------------------------
/// Set/Get the world to parent rotations.
/// \sa GetWorldToParentRestRotation(), SetWorldToParentRestTranslation()
/// \sa GetWorldToParentPoseRotation(), SetWorldToParentPoseTranslation()
Expand All @@ -207,7 +195,6 @@ class VTK_BENDER_ARMATURES_MRML_CORE_EXPORT vtkMRMLBoneNode
double* GetWorldToParentRestTranslation();
double* GetWorldToParentPoseTranslation();

// -- Parent to bone transforms --------------------------------------------
/// Get the parent to bone rotations.
/// \sa GetParentToBoneRestRotation(), GetParentToBonePoseRotation()
double* GetParentToBoneRestRotation();
Expand All @@ -218,7 +205,6 @@ class VTK_BENDER_ARMATURES_MRML_CORE_EXPORT vtkMRMLBoneNode
double* GetParentToBoneRestTranslation();
double* GetParentToBonePoseTranslation();

// -- World to bone transforms --------------------------------------------
/// Get the world to bone rotations.
/// \sa GetWorldToBoneHeadRestTranslation()
/// \sa GetWorldToBoneTailRestTranslation()
Expand All @@ -241,7 +227,6 @@ class VTK_BENDER_ARMATURES_MRML_CORE_EXPORT vtkMRMLBoneNode
double* GetWorldToBoneHeadPoseTranslation();
double* GetWorldToBoneTailPoseTranslation();

// -- Parenthood -----------------------------------------------------------
/// Set/Get the bone parenthood.
void SetShowParenthood(int parenthood);
int GetShowParenthood();
Expand Down

0 comments on commit 6a4d3cc

Please sign in to comment.