Public Member Functions | Public Attributes

MaterialTest Class Reference

List of all members.

Public Member Functions

 MaterialTest ()
void testConstructor ()
void testConstructorWithColorOpacity ()
void testConstructorWithRedGreenBlueOpacity ()
void testConstructorRedGreenBlueColorCoefficientSpecularCoefficientSpecularPowerOpacity ()
void testConstructorColorColorCoefficientSpecularCoefficientSpecularPowerOpacity ()
void testConstructorPropertyRedGreenBlueOpacityAndName ()
void testSetColor ()
void testSetColorCoefficient ()
void testSetSpecularColor ()
void testSetSpecularCoefficient ()
void testSetSpecularPower ()
void testSetOpacity ()
void testSetInterpolation ()
void testSetRepresentation ()
void testSetLineWidth ()
void testInitialize ()
void testOperatorequality ()
void testAssignable ()
void testOperatorAssign ()

Public Attributes

mitk::Material::Pointer myMP

Detailed Description

Simple example for a test for the () class "ClassName".

argc and argv are the command line parameters which were passed to the ADD_TEST command in the CMakeLists.txt file. For the automatic tests, argv is either empty for the simple tests or contains the filename of a test image for the image tests ().

Definition at line 40 of file mitkMaterialTest.cpp.


Constructor & Destructor Documentation

MaterialTest::MaterialTest (  ) [inline]

Definition at line 45 of file mitkMaterialTest.cpp.

References myMP.

{myMP = NULL;}

Member Function Documentation

void MaterialTest::testAssignable (  ) [inline]

Definition at line 327 of file mitkMaterialTest.cpp.

References MITK_TEST_CONDITION, myMP, and mitk::Material::New().

Referenced by mitkMaterialTest().

{
  mitk::Material::Pointer materialProp = mitk::Material::New();
  MITK_TEST_CONDITION(myMP->Assignable(*materialProp),"testing Assignable with Material" )
} 
void MaterialTest::testConstructor (  ) [inline]

Definition at line 47 of file mitkMaterialTest.cpp.

References MITK_TEST_CONDITION_REQUIRED, myMP, and mitk::Material::New().

Referenced by mitkMaterialTest().

  {
    myMP = mitk::Material::New();
    MITK_TEST_CONDITION_REQUIRED(myMP.IsNotNull(),"Testing instantiation")
  }
void MaterialTest::testConstructorColorColorCoefficientSpecularCoefficientSpecularPowerOpacity (  ) [inline]

Definition at line 97 of file mitkMaterialTest.cpp.

References MITK_TEST_CONDITION, MITK_TEST_CONDITION_REQUIRED, myMP, and mitk::Material::New().

Referenced by mitkMaterialTest().

  {
    mitk::Material::Color color;
    color.Set(0, 0, 0);
    vtkFloatingPointType opacity = 1.0f;
    vtkFloatingPointType rgb = 0;
    vtkFloatingPointType colorCoefficient = 0;
    vtkFloatingPointType specularCoefficient = 0;
    vtkFloatingPointType specularPower = 0;

    myMP = mitk::Material::New(rgb, rgb, rgb, colorCoefficient,
      specularCoefficient, specularPower, opacity);
    MITK_TEST_CONDITION_REQUIRED(myMP.IsNotNull(),"Testing instantiation")
    MITK_TEST_CONDITION( color==myMP->GetColor(), "Testing if a Color object was set correctly" )
    MITK_TEST_CONDITION( opacity==myMP->GetOpacity(), "Testing if a Opacity object was set correctly" )
    MITK_TEST_CONDITION( specularCoefficient==myMP->GetSpecularCoefficient(), "Testing if a Coefficient object was set correctly" )
    MITK_TEST_CONDITION( specularPower==myMP->GetSpecularPower(), "Testing if a SpecularPower object was set correctly" )
  }
void MaterialTest::testConstructorPropertyRedGreenBlueOpacityAndName (  ) [inline]

Definition at line 116 of file mitkMaterialTest.cpp.

References MITK_TEST_CONDITION, MITK_TEST_CONDITION_REQUIRED, myMP, and mitk::Material::New().

Referenced by mitkMaterialTest().

  {
    mitk::Material::Pointer reference = myMP;
    vtkFloatingPointType opacity = 1.0f;
    vtkFloatingPointType rgb = 0;
    std::string name = "Hans Wurst";

    myMP = mitk::Material::New(*reference, rgb, rgb, rgb, opacity, name);
    MITK_TEST_CONDITION_REQUIRED(myMP.IsNotNull(),"Testing instantiation")
    MITK_TEST_CONDITION( opacity==myMP->GetOpacity(), "Testing if a Opacity object was set correctly" )
    //MITK_TEST_CONDITION( name.compare(myMP->GetName(),0,9), "Testing if a Name object was set correctly" )
  }
void MaterialTest::testConstructorRedGreenBlueColorCoefficientSpecularCoefficientSpecularPowerOpacity (  ) [inline]

Definition at line 77 of file mitkMaterialTest.cpp.

References MITK_TEST_CONDITION, MITK_TEST_CONDITION_REQUIRED, myMP, and mitk::Material::New().

Referenced by mitkMaterialTest().

  {
    mitk::Material::Color color;
    color.Set(0, 0, 0);
    vtkFloatingPointType opacity = 1.0f;
    vtkFloatingPointType rgb = 0;
    vtkFloatingPointType colorCoefficient = 0;
    vtkFloatingPointType specularCoefficient = 0;
    vtkFloatingPointType specularPower = 0;

    myMP = mitk::Material::New(rgb, rgb, rgb, colorCoefficient,
      specularCoefficient, specularPower, opacity);
    MITK_TEST_CONDITION_REQUIRED(myMP.IsNotNull(),"Testing instantiation")
      MITK_TEST_CONDITION( color==myMP->GetColor(), "Testing if a Color object was set correctly" )
      MITK_TEST_CONDITION( opacity==myMP->GetOpacity(), "Testing if a Opacity object was set correctly" )
      MITK_TEST_CONDITION( specularCoefficient==myMP->GetSpecularCoefficient(), "Testing if a Coefficient object was set correctly" )
      MITK_TEST_CONDITION( specularPower==myMP->GetSpecularPower(), "Testing if a SpecularPower object was set correctly" )
      MITK_TEST_CONDITION( colorCoefficient==myMP->GetColorCoefficient(), "Testing if a colorCoefficient object was set correctly" )
  }
void MaterialTest::testConstructorWithColorOpacity (  ) [inline]

Definition at line 53 of file mitkMaterialTest.cpp.

References MITK_TEST_CONDITION, MITK_TEST_CONDITION_REQUIRED, myMP, and mitk::Material::New().

Referenced by mitkMaterialTest().

  {
    mitk::Color color;
    color.Set(0, 0, 0);
    vtkFloatingPointType opacity = 1.0f;
    myMP = mitk::Material::New(color, opacity);
    MITK_TEST_CONDITION_REQUIRED(myMP.IsNotNull(),"Testing instantiation")
    MITK_TEST_CONDITION( color==myMP->GetColor(), "Testing if a Color object was set correctly" )
    MITK_TEST_CONDITION( opacity==myMP->GetOpacity(), "Testing if a Opacity object was set correctly" )
  }
void MaterialTest::testConstructorWithRedGreenBlueOpacity (  ) [inline]

Definition at line 64 of file mitkMaterialTest.cpp.

References MITK_TEST_CONDITION, MITK_TEST_CONDITION_REQUIRED, myMP, and mitk::Material::New().

Referenced by mitkMaterialTest().

  {
    mitk::Material::Color color;
    color.Set(0, 0, 0);
    vtkFloatingPointType opacity = 1.0f;
    vtkFloatingPointType rgb = 0;

    myMP = mitk::Material::New(rgb, rgb, rgb, opacity);
    MITK_TEST_CONDITION_REQUIRED(myMP.IsNotNull(),"Testing instantiation")
    MITK_TEST_CONDITION( color==myMP->GetColor(), "Testing if a Color object was set correctly" )
    MITK_TEST_CONDITION( opacity==myMP->GetOpacity(), "Testing if a Opacity object was set correctly" )
   }
void MaterialTest::testInitialize (  ) [inline]

Definition at line 213 of file mitkMaterialTest.cpp.

References mitk::Material::Flat, MITK_TEST_CONDITION, myMP, mitk::Material::New(), and mitk::Material::Wireframe.

Referenced by mitkMaterialTest().

{
  mitk::Material::Color color;
  color.Set(0, 0, 0);
  vtkFloatingPointType opacity = 1.0f;
  vtkFloatingPointType rgb = 0;
  vtkFloatingPointType colorCoefficient = 0;
  vtkFloatingPointType specularCoefficient = 0;
  vtkFloatingPointType specularPower = 0;

  myMP = mitk::Material::New(rgb, rgb, rgb, colorCoefficient,
    specularCoefficient, specularPower, opacity);
  vtkFloatingPointType lineWidth = 1;
  myMP->SetLineWidth(lineWidth);
  mitk::Material::RepresentationType representation = mitk::Material::Wireframe;
  myMP->SetRepresentation(representation);mitk::Material::InterpolationType interpolation = mitk::Material::Flat;
  myMP->SetInterpolation(interpolation);
  myMP->SetSpecularColor(color);
  std::string name = "Hans Wurst";
  myMP->SetName(name);
  mitk::Material::Pointer myMP2 = mitk::Material::New();
  myMP2->Initialize(*myMP);
  MITK_TEST_CONDITION(*myMP == *myMP2, "testing equality after .Intitialize")
}
void MaterialTest::testOperatorAssign (  ) [inline]

Definition at line 333 of file mitkMaterialTest.cpp.

References MITK_TEST_CONDITION, myMP, and mitk::Material::New().

Referenced by mitkMaterialTest().

{
  mitk::Material::Pointer myMP2 = mitk::Material::New();
  *myMP2 = *myMP;
  MITK_TEST_CONDITION(*myMP == *myMP2, "Testing Assignment Operator")
}
void MaterialTest::testOperatorequality (  ) [inline]

Definition at line 237 of file mitkMaterialTest.cpp.

References mitk::Material::Flat, MITK_TEST_CONDITION, myMP, mitk::Material::New(), and mitk::Material::Wireframe.

Referenced by mitkMaterialTest().

{
  {
    mitk::Material::Color color;
    color.Set(0, 0, 0);
    vtkFloatingPointType opacity = 1.0f;
    vtkFloatingPointType rgb = 0;
    vtkFloatingPointType colorCoefficient = 0;
    vtkFloatingPointType specularCoefficient = 0;
    vtkFloatingPointType specularPower = 0;

    myMP = mitk::Material::New(rgb, rgb, rgb, colorCoefficient,
      specularCoefficient, specularPower, opacity);
    vtkFloatingPointType lineWidth = 1;
    myMP->SetLineWidth(lineWidth);
    mitk::Material::RepresentationType representation = mitk::Material::Wireframe;
    myMP->SetRepresentation(representation);mitk::Material::InterpolationType interpolation = mitk::Material::Flat;
    myMP->SetInterpolation(interpolation);
    myMP->SetSpecularColor(color);
    std::string name = "Hans Wurst";
    myMP->SetName(name);


    mitk::Material::Color color2;
    color2.Set(0, 0, 0);
    vtkFloatingPointType opacity2 = 1.0f;
    vtkFloatingPointType rgb2 = 0;
    vtkFloatingPointType colorCoefficient2 = 0;
    vtkFloatingPointType specularCoefficient2 = 0;
    vtkFloatingPointType specularPower2 = 0;

    mitk::Material::Pointer myMP2 = mitk::Material::New(rgb2, rgb2, rgb2, colorCoefficient2,
      specularCoefficient2, specularPower2, opacity2);
    vtkFloatingPointType lineWidth2 = 1;
    myMP2->SetLineWidth(lineWidth2);
    mitk::Material::RepresentationType representation2 = mitk::Material::Wireframe;
    myMP2->SetRepresentation(representation2);
    mitk::Material::InterpolationType interpolation2 = mitk::Material::Flat;
    myMP2->SetInterpolation(interpolation2);
    myMP2->SetSpecularColor(color2);
    std::string name2 = "Hans Wurst";
    myMP2->SetName(name2);
    MITK_TEST_CONDITION(*myMP == *myMP2, "testing equality Operator")
  }
  {
    mitk::Material::Color color;
    color.Set(0, 0, 0);
    vtkFloatingPointType opacity = 1.0f;
    vtkFloatingPointType rgb = 0;
    vtkFloatingPointType colorCoefficient = 0;
    vtkFloatingPointType specularCoefficient = 0;
    vtkFloatingPointType specularPower = 0;

    myMP = mitk::Material::New(rgb, rgb, rgb, colorCoefficient,
      specularCoefficient, specularPower, opacity);
    vtkFloatingPointType lineWidth = 1;
    myMP->SetLineWidth(lineWidth);
    mitk::Material::RepresentationType representation = mitk::Material::Wireframe;
    myMP->SetRepresentation(representation);mitk::Material::InterpolationType interpolation = mitk::Material::Flat;
    myMP->SetInterpolation(interpolation);
    myMP->SetSpecularColor(color);
    std::string name = "Hans Wurst";
    myMP->SetName(name);


    mitk::Material::Color color2;
    color2.Set(0, 0, 0);
    vtkFloatingPointType opacity2 = 1.0f;
    vtkFloatingPointType rgb2 = 1;
    vtkFloatingPointType colorCoefficient2 = 0;
    vtkFloatingPointType specularCoefficient2 = 0;
    vtkFloatingPointType specularPower2 = 0;

    mitk::Material::Pointer myMP2 = mitk::Material::New(rgb2, rgb2, rgb2, colorCoefficient2,
      specularCoefficient2, specularPower2, opacity2);
    vtkFloatingPointType lineWidth2 = 1;
    myMP2->SetLineWidth(lineWidth2);
    mitk::Material::RepresentationType representation2 = mitk::Material::Wireframe;
    myMP2->SetRepresentation(representation2);
    mitk::Material::InterpolationType interpolation2 = mitk::Material::Flat;
    myMP2->SetInterpolation(interpolation2);
    myMP2->SetSpecularColor(color2);
    std::string name2 = "Hans Wurst";
    myMP2->SetName(name2);
    MITK_TEST_CONDITION(!(*myMP == *myMP2), "testing equality Operator")
  }
 

}
void MaterialTest::testSetColor (  ) [inline]

Definition at line 128 of file mitkMaterialTest.cpp.

References MITK_TEST_CONDITION, MITK_TEST_CONDITION_REQUIRED, myMP, and mitk::Material::New().

Referenced by mitkMaterialTest().

{
  mitk::Material::Color color;
  color.Set(0,0,0);
  myMP = mitk::Material::New();
  myMP->SetColor(color);
  MITK_TEST_CONDITION_REQUIRED(myMP.IsNotNull(),"Testing instantiation")
  MITK_TEST_CONDITION(color==myMP->GetColor(),"Testing if a color was set correctly")
  color.Set(0,0,0);
  myMP->SetColor(color);
  MITK_TEST_CONDITION(color==myMP->GetColor(),"Testing if a color was set correctly")
}
void MaterialTest::testSetColorCoefficient (  ) [inline]

Definition at line 141 of file mitkMaterialTest.cpp.

References MITK_TEST_CONDITION, myMP, and mitk::Material::New().

Referenced by mitkMaterialTest().

{
  
  vtkFloatingPointType colorCoefficient = 0;
  myMP = mitk::Material::New();
  myMP->SetColorCoefficient(colorCoefficient);
  MITK_TEST_CONDITION(colorCoefficient == myMP->GetColorCoefficient(), "Testing if a colorcoefficent was set correctly")

}
void MaterialTest::testSetInterpolation (  ) [inline]

Definition at line 189 of file mitkMaterialTest.cpp.

References mitk::Material::Flat, MITK_TEST_CONDITION, myMP, and mitk::Material::New().

Referenced by mitkMaterialTest().

{
  myMP = mitk::Material::New();
  mitk::Material::InterpolationType interpolation = mitk::Material::Flat;
  myMP->SetInterpolation(interpolation);
  MITK_TEST_CONDITION(interpolation == myMP->GetInterpolation(), "Testing if a Interpolation was set correctly")
}
void MaterialTest::testSetLineWidth (  ) [inline]

Definition at line 205 of file mitkMaterialTest.cpp.

References MITK_TEST_CONDITION, myMP, and mitk::Material::New().

Referenced by mitkMaterialTest().

{
  myMP = mitk::Material::New();
  vtkFloatingPointType lineWidth = 1;
  myMP->SetLineWidth(lineWidth);
  MITK_TEST_CONDITION(lineWidth==myMP->GetLineWidth(), "Testing if a LineWidth was set correctly")
}
void MaterialTest::testSetOpacity (  ) [inline]

Definition at line 179 of file mitkMaterialTest.cpp.

References MITK_TEST_CONDITION, myMP, and mitk::Material::New().

Referenced by mitkMaterialTest().

{
  myMP = mitk::Material::New();
  vtkFloatingPointType opacity = 1;
  myMP->SetOpacity(opacity);
  MITK_TEST_CONDITION(opacity==myMP->GetOpacity(), "Testing if a Opacity was set correctly")

}
void MaterialTest::testSetRepresentation (  ) [inline]

Definition at line 196 of file mitkMaterialTest.cpp.

References MITK_TEST_CONDITION, myMP, mitk::Material::New(), and mitk::Material::Wireframe.

Referenced by mitkMaterialTest().

{
  myMP = mitk::Material::New();
  mitk::Material::RepresentationType representation = mitk::Material::Wireframe;
  myMP->SetRepresentation(representation);
  MITK_TEST_CONDITION(representation == myMP->GetRepresentation(), "Testing if a Representation was set correctly")

}
void MaterialTest::testSetSpecularCoefficient (  ) [inline]

Definition at line 162 of file mitkMaterialTest.cpp.

References MITK_TEST_CONDITION, myMP, and mitk::Material::New().

Referenced by mitkMaterialTest().

{
  myMP = mitk::Material::New();
  vtkFloatingPointType specularCoefficient = 1;
  myMP->SetSpecularCoefficient(specularCoefficient);
  MITK_TEST_CONDITION(specularCoefficient == myMP->GetSpecularCoefficient(),"Testing if a SpecularCoefficient was set correctly")

}
void MaterialTest::testSetSpecularColor (  ) [inline]

Definition at line 150 of file mitkMaterialTest.cpp.

References MITK_TEST_CONDITION, myMP, and mitk::Material::New().

Referenced by mitkMaterialTest().

{
    mitk::Material::Color color;
    color.Set(0,0,0);
    myMP = mitk::Material::New();
    myMP->SetSpecularColor(color);
    MITK_TEST_CONDITION(color == myMP->GetSpecularColor(),"Testing if a SpecularColor was set correctly")



}
void MaterialTest::testSetSpecularPower (  ) [inline]

Definition at line 170 of file mitkMaterialTest.cpp.

References MITK_TEST_CONDITION, myMP, and mitk::Material::New().

Referenced by mitkMaterialTest().

{
  myMP = mitk::Material::New();
  vtkFloatingPointType specularPower = 1;
  myMP->SetSpecularPower(specularPower);
  MITK_TEST_CONDITION(specularPower==myMP->GetSpecularPower(), "Testing if a SpecularPower was set correctly")


}

Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines