Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

mitk::BoundingObject Class Reference
[Data Classes]

superclass of all bounding objects (cylinder, cuboid,...) More...

#include <mitkBoundingObject.h>

Inheritance diagram for mitk::BoundingObject:
Inheritance graph
[legend]
Collaboration diagram for mitk::BoundingObject:
Collaboration graph
[legend]

List of all members.

Public Types

typedef BoundingObject Self
typedef mitk::Surface Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
virtual bool IsInside (const mitk::Point3D &p) const =0
virtual mitk::ScalarType GetVolume ()
virtual bool GetPositive ()
virtual void SetPositive (bool _arg)
virtual void PositiveOn ()
virtual void PositiveOff ()
virtual void FitGeometry (Geometry3D *aGeometry3D)
 Sets the Geometry3D of the bounding object to fit the given geometry.

Protected Member Functions

 BoundingObject ()
virtual ~BoundingObject ()
bool WriteXMLData (XMLWriter &xmlWriter)

Protected Attributes

bool m_Positive
 If true, the Boundingobject describes a positive volume, if false a negative volume.

Detailed Description

superclass of all bounding objects (cylinder, cuboid,...)

Manages generic functions and provides an interface for IsInside() calculates a generic bounding box

Definition at line 33 of file mitkBoundingObject.h.


Member Typedef Documentation

typedef itk::SmartPointer<const Self> mitk::BoundingObject::ConstPointer
typedef itk::SmartPointer<Self> mitk::BoundingObject::Pointer

Constructor & Destructor Documentation

mitk::BoundingObject::BoundingObject (  ) [protected]

Definition at line 22 of file mitkBoundingObject.cpp.

References mitk::BaseData::GetGeometry(), mitk::BaseData::GetTimeSlicedGeometry(), mitk::Geometry3D::SetBounds(), and mitk::TimeSlicedGeometry::UpdateInformation().

  : Surface(), m_Positive(true)
{
//  Initialize(1);

  /* bounding box around the unscaled bounding object */ 
  ScalarType bounds[6]={-1,1,-1,1,-1,1};  //{xmin,x_max, ymin,y_max,zmin,z_max}
  GetGeometry()->SetBounds(bounds);
  GetTimeSlicedGeometry()->UpdateInformation();
}
mitk::BoundingObject::~BoundingObject (  ) [protected, virtual]

Definition at line 33 of file mitkBoundingObject.cpp.

{
} 

Member Function Documentation

void mitk::BoundingObject::FitGeometry ( mitk::Geometry3D aGeometry3D ) [virtual]

Sets the Geometry3D of the bounding object to fit the given geometry.

The fit is done once, so if the given geometry changes it will not effect the bounding object.

Definition at line 42 of file mitkBoundingObject.cpp.

References mitk::Geometry3D::GetCenter(), mitk::Geometry3D::GetExtentInMM(), mitk::Geometry3D::GetImageGeometry(), mitk::Geometry3D::GetIndexToWorldTransform(), and mitk::Geometry3D::GetSpacing().

{
  GetGeometry()->SetIdentity();
  GetGeometry()->Compose(aGeometry3D->GetIndexToWorldTransform());

  if(aGeometry3D->GetImageGeometry())
  {
    mitk::Vector3D halfSpacingStep = aGeometry3D->GetSpacing()*0.5;
    GetGeometry()->SetOrigin(aGeometry3D->GetCenter()-halfSpacingStep);
  }
  else
  {
    GetGeometry()->SetOrigin(aGeometry3D->GetCenter());
  }

  mitk::Vector3D size;
  for(unsigned int i=0; i < 3; ++i)
    size[i] = aGeometry3D->GetExtentInMM(i)/2.0;
  GetGeometry()->SetSpacing( size );
  GetTimeSlicedGeometry()->UpdateInformation();
}
virtual const char* mitk::BoundingObject::GetClassName (  ) const [virtual]
virtual bool mitk::BoundingObject::GetPositive (  ) [virtual]
mitk::ScalarType mitk::BoundingObject::GetVolume (  ) [virtual]

Reimplemented in mitk::Cone, mitk::Cuboid, mitk::Cylinder, mitk::Ellipsoid, mitk::ExtrudedContour, and mitk::Plane.

Definition at line 37 of file mitkBoundingObject.cpp.

{
  return 0.0;
}
virtual bool mitk::BoundingObject::IsInside ( const mitk::Point3D &  p ) const [pure virtual]
virtual void mitk::BoundingObject::PositiveOff (  ) [virtual]
virtual void mitk::BoundingObject::PositiveOn (  ) [virtual]
virtual void mitk::BoundingObject::SetPositive ( bool  _arg ) [virtual]
bool mitk::BoundingObject::WriteXMLData ( XMLWriter &  xmlWriter ) [protected]

Member Data Documentation

If true, the Boundingobject describes a positive volume, if false a negative volume.

Definition at line 62 of file mitkBoundingObject.h.


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