Computer Assisted Medical Intervention Tool Kit  version 6.0
Loading...
Searching...
No Matches
StructuralComponentProperties Class Reference

A class that manages the structural component properties. More...

#include <StructuralComponentProperties.h>

Public Types

enum  Color {
  DEFAULT , RED , GREEN , BLUE ,
  GRAY , OTHER
}
 Default color settings. More...

Public Member Functions

double getAlpha () const
double getBlue () const
Color getColor () const
double getGreen () const
RenderingMode::Mode getMode () const
std::string getModeString () const
 get the string equivalent to the enum rendering mode
double getRed () const
double * getRGB () const
double * getRGBA () const
bool isVisible (const RenderingMode::Mode mode) const
void setAlpha (const double a)
void setBlue (const double b)
void setColor (Color c)
void setGreen (const double g)
void setMode (const RenderingMode::Mode)
void setRed (const double r)
void setRGB (const double *rgb)
void setRGB (const double r, const double g, const double b)
void setRGBA (const double *rgba)
void setRGBA (const double r, const double g, const double b, const double a)
void setVisible (const RenderingMode::Mode, const bool)
 StructuralComponentProperties (PhysicalModel *p)
 defaultcolor is gray
 StructuralComponentProperties (PhysicalModel *p, const Color c)
 use a Color constant to set the color
 StructuralComponentProperties (PhysicalModel *p, const Color c, const std::string n)
 StructuralComponentProperties (PhysicalModel *p, const double *rgb)
 use a double[3] array to set the color
 StructuralComponentProperties (PhysicalModel *p, const double *rgb, const std::string n)
 StructuralComponentProperties (PhysicalModel *p, const double r, const double g, const double b)
 use 3 floats to set the color
 StructuralComponentProperties (PhysicalModel *p, const double r, const double g, const double b, const std::string n)
 StructuralComponentProperties (PhysicalModel *p, const std::string n)
 StructuralComponentProperties (PhysicalModel *p, physicalModel::StructuralComponent xmlSC)
virtual void xmlPrint (std::ostream &)
 print to an output stream in "pseaudo" XML format.
 ~StructuralComponentProperties ()
Public Member Functions inherited from Properties
std::string getName () const
 get the name (be careful, this method DOES NOT return a copy, so you got the direct ptr to the name!!!)
PhysicalModelgetPhysicalModel () const
 get the physical model
 Properties (const std::string n="")
 A nice simple constructor, with a given name.
 Properties (PhysicalModel *, const std::string n="")
 Another nice constructor, with the PM and a name.
void setName (std::string)
 set the name (use the string = operator)
void setPhysicalModel (PhysicalModel *)
 set the physical model
virtual ~Properties ()=default
 The default destructor.
void xmlToFields (xsd::cxx::tree::attribute_set< char > attrs)
 convert the xml node parameters to data fields
unsigned int numberOfFields () const
 get the number of extra fields found in the PML
bool isAField (std::string attName) const
 check if the field exist in the XML document, return false if it does not
std::string getField (unsigned int) const
 get the name of field of given index
double getDouble (std::string attName)
 field accessor: get the field attName as a double value, if field does not exist, 0.0 is return
int getInt (std::string attName) const
 field accessor: get the field attName as an int value, if field does not exist, 0 is return
bool getBool (std::string attName) const
 field accessor: get the field attName as a bool value, if field does not exist, false is return
std::string getString (std::string attName) const
 field accessor: get the field attName as a string value, if field does not exist, empty string is return
void get (std::string attName, std::string &attVal) const
 field accessor: get the field attName as a string value in attVal, if field does not exist, empty string is return
void set (std::string attName, double val)
 field modificator: set field attName using a double value
void set (std::string attName, int val)
 field modificator: set field attName using an int value
void set (std::string attName, bool val)
 field modificator: set field attName using a bool value
void set (std::string attName, std::string val)
 field modificator: set field attName using a string value

Additional Inherited Members

std::map< std::string, std::string > fields
 map containing all the different fields (name, value stored as string )

Detailed Description

A class that manages the structural component properties.

Member Enumeration Documentation

◆ Color

Default color settings.

Enumerator
DEFAULT 

no color given, decided by the GUI

RED 

full complete flashy red

GREEN 

full complete flashy green

BLUE 

full complete flashy blue

GRAY 

classic gray

OTHER 

color is defined using RGBA

Constructor & Destructor Documentation

◆ StructuralComponentProperties() [1/9]

StructuralComponentProperties::StructuralComponentProperties ( PhysicalModel * p,
const Color c )
inline

use a Color constant to set the color

References Properties::Properties(), setColor(), setMode(), and RenderingMode::WIREFRAME_AND_SURFACE.

◆ StructuralComponentProperties() [2/9]

◆ StructuralComponentProperties() [3/9]

StructuralComponentProperties::StructuralComponentProperties ( PhysicalModel * p,
const Color c,
const std::string n )
inline

◆ StructuralComponentProperties() [4/9]

StructuralComponentProperties::StructuralComponentProperties ( PhysicalModel * p,
const double * rgb )
inline

use a double[3] array to set the color

References Properties::Properties(), setAlpha(), setMode(), setRGB(), and RenderingMode::WIREFRAME_AND_SURFACE.

◆ StructuralComponentProperties() [5/9]

StructuralComponentProperties::StructuralComponentProperties ( PhysicalModel * p,
const double * rgb,
const std::string n )
inline

◆ StructuralComponentProperties() [6/9]

StructuralComponentProperties::StructuralComponentProperties ( PhysicalModel * p,
const double r,
const double g,
const double b )
inline

◆ StructuralComponentProperties() [7/9]

StructuralComponentProperties::StructuralComponentProperties ( PhysicalModel * p,
const double r,
const double g,
const double b,
const std::string n )
inline

◆ StructuralComponentProperties() [8/9]

StructuralComponentProperties::StructuralComponentProperties ( PhysicalModel * p)
inline

◆ StructuralComponentProperties() [9/9]

StructuralComponentProperties::StructuralComponentProperties ( PhysicalModel * p,
const std::string n )
inline

◆ ~StructuralComponentProperties()

StructuralComponentProperties::~StructuralComponentProperties ( )
inline

Member Function Documentation

◆ getAlpha()

double StructuralComponentProperties::getAlpha ( ) const
inline

◆ getBlue()

double StructuralComponentProperties::getBlue ( ) const
inline

◆ getColor()

StructuralComponentProperties::Color StructuralComponentProperties::getColor ( ) const
inline

◆ getGreen()

double StructuralComponentProperties::getGreen ( ) const
inline

◆ getMode()

RenderingMode::Mode StructuralComponentProperties::getMode ( ) const
inline

◆ getModeString()

std::string StructuralComponentProperties::getModeString ( ) const
inline

get the string equivalent to the enum rendering mode

◆ getRed()

double StructuralComponentProperties::getRed ( ) const
inline

◆ getRGB()

double * StructuralComponentProperties::getRGB ( ) const
inline

◆ getRGBA()

double * StructuralComponentProperties::getRGBA ( ) const
inline

◆ isVisible()

bool StructuralComponentProperties::isVisible ( const RenderingMode::Mode mode) const
inline

◆ setAlpha()

void StructuralComponentProperties::setAlpha ( const double a)
inline

◆ setBlue()

void StructuralComponentProperties::setBlue ( const double b)
inline

References OTHER.

Referenced by setRGB(), and setRGBA().

◆ setColor()

◆ setGreen()

void StructuralComponentProperties::setGreen ( const double g)
inline

References OTHER.

Referenced by setRGB(), and setRGBA().

◆ setMode()

◆ setRed()

void StructuralComponentProperties::setRed ( const double r)
inline

References OTHER.

Referenced by setRGB(), and setRGBA().

◆ setRGB() [1/2]

void StructuralComponentProperties::setRGB ( const double * rgb)
inline

◆ setRGB() [2/2]

void StructuralComponentProperties::setRGB ( const double r,
const double g,
const double b )
inline

References OTHER, setBlue(), setGreen(), and setRed().

◆ setRGBA() [1/2]

void StructuralComponentProperties::setRGBA ( const double * rgba)
inline

References OTHER, and setRGBA().

◆ setRGBA() [2/2]

void StructuralComponentProperties::setRGBA ( const double r,
const double g,
const double b,
const double a )
inline

◆ setVisible()

void StructuralComponentProperties::setVisible ( const RenderingMode::Mode m,
const bool b )
inline

◆ xmlPrint()

void StructuralComponentProperties::xmlPrint ( std::ostream & o)
virtual

print to an output stream in "pseaudo" XML format.

This method is to be implemented in the subclass (StructuralComponentProperties). It HAS to call the beginXML() at the beginning and the endXML() at the end.

References Properties::fields, Properties::getName(), and RenderingMode::NONE.


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