Page MenuHomePhabricator

Refactor Geometry2DDataVtkMapper3D
Closed, ResolvedPublic

Description

Refactor the Geometry2DDataVtkMapper3D.

(Some) Issues are:
-there are member variables which are only used inside one method
-there are complecated and unnecessary if-else clauses like in l. 486:

else if ( !m_DisplayNormals )
{
  if ( m_NormalsActorAdded )
  {
     [...]
  }
}

which could be simplyfied.
-the methods GenerateData and ProcessNode are very unclear
-there are huge code parts which are out commented
-the method FindPowerOfTwo seems not be to be used at all
-try to simplify the whole mapper

Related Objects

StatusAssignedTask
ResolvedNone
ResolvedNone

Event Timeline

TODO:
-figure out if the method SetDataStorageForTexture is needed

TODO:
-Check if there is a bug for the lines:

p->AddPredicate(mitk::NodePredicateDataType::New("DiffusionImage"));
p->AddPredicate(mitk::NodePredicateDataType::New("TensorImage"));
p->AddPredicate(mitk::NodePredicateDataType::New("QBallImage"));

-Check the reason behind the lines:

std::string cname(node->GetMapper(1)->GetNameOfClass());
if(!cname.compare("CompositeMapper"))
{
  imageMapper = dynamic_cast<ImageMapperGL2D* >( node->GetMapper(3) );
}
  • Cleaned up the method GenerateData
  • removed commented out code parts and unused comments
  • Removed unused method FindPowerOfTwo
  • Added Documentation of SetDataStorageForTexture
  • Changed unnecessary members into local variables

TODO:
-enhance documentation
-try to simplify the whole mapper

  • removed 2 uneccesary lines, lookuptable->SetRange and texture->InterpolateOn

We made the last small fixes and pushed the branch named:
"bug-8146-RefactoringGeometry2DDataVtkMapper3D"

[8529f3]: Merge branch 'bug-8146-RefactoringGeometry2DDataVtkMapper3D'

Merged commits:

2011-05-25 17:43:03 Thomas Kilgus [491414]
Added documentation for used properties, the mapper is using the TNodePredicate now to get all images and cleaned up some more trivial things.


2011-05-25 15:42:50 Thomas Kilgus [895379]
removed uneccesary lines


2011-05-25 14:43:30 Thomas Kilgus [c37ce8]
Changed unnecessary members into local variables.


2011-05-25 14:29:03 Thomas Kilgus [3fb838]
Removed unused method FindPowerOfTwo and added documentation for SetDataStorageForTexture.


2011-05-19 12:03:08 Thomas Kilgus [699ab8]
Cleaned up GenerateData as good as possible


2011-05-18 16:14:19 Thomas Kilgus [4a0d88]
removed unused comments and commented out code


2011-05-18 14:38:57 Thomas Kilgus [e8ac8c]
Merge branch 'bug-7557-UseColorProperty'


2011-05-11 16:37:16 Thomas Kilgus [663f70]
Added Geralds quick fix for the 3D color.