cee::vtfx::Case Class Reference

A VTFx case. The class represents a case, i.e. the specific visualization of a VTFx database. More...

Public Member Functions

 Case (File *file, const Str &name, int caseId, int databaseId)
 Constructs a new case. More...
 
int id () const
 Returns the case id. More...
 
int databaseId () const
 Returns the id of the database used by this case. More...
 
cee::Str name () const
 Sets the case name. More...
 
void setName (const cee::Str &name)
 Returns the case name. More...
 
Str description () const
 Returns the HTML formatted description text. More...
 
void setDescription (const Str &descriptionHtml)
 Sets the case description. More...
 
const Imagesnapshot () const
 Returns the snapshot, i.e. preview image for this case. More...
 
void setSnapshot (cee::Image *image)
 Sets a snapshot, i.e. preview image for this case. More...
 
size_t imageCount () const
 Returns the number of images in this case. More...
 
cee::Str imageName (size_t imageIndex) const
 Gets the image name of the image at index imageIndex. More...
 
const Imageimage (size_t imageIndex) const
 Gets the image at index imageIndex. More...
 
bool addImage (const cee::Str &imageName, cee::Image *image)
 Adds an image to this case. More...
 
const PropertySetCollectionproperties () const
 Returns the properties for this case. More...
 
bool setProperties (PropertySetCollection *propertySetCollection)
 Sets the properties for this case. More...
 
bool derivedResultsDisabled () const
 Returns true if derived should NOT be created. More...
 
void setDerivedResultsDisabled (bool disable)
 If set to 'true', derived results will NOT be created when the file is read. More...
 
- Public Member Functions inherited from cee::RefCountedObject
void addRef () const
 Increments the reference count for this object. More...
 
void release () const
 Decrements the reference count for this object. More...
 
int refCount () const
 Returns the reference count for this object. More...
 
void setRefCountZero () const
 Sets the ref count to zero, but DOES NOT delete the object. More...
 
Inheritance diagram for cee::vtfx::Case:
cee::RefCountedObject

Detailed Description

A VTFx case. The class represents a case, i.e. the specific visualization of a VTFx database.

A case requires a unique id within the VTFx file. Also it is associated with one database, referenced by the database's id.

The actual visualization is specified by adding properties to the case instance. The properties define settings such as the viewing setup, appearance of parts, mapped scalars, feature extractions, annotations, and much more. See the documentation and examples for further information on supported properties and their usage. See the full listing of case properties on the Properties Documentation.

Moreover, a case provides methods to define an HTML description and snapshot image.

Constructor & Destructor Documentation

cee::vtfx::Case::Case ( File file,
const Str name,
int  caseId,
int  databaseId 
)

Constructs a new case.

The constructor takes the file instance as a parameter. The File will take ownership of the case and ensure that all belonging cases are written to file.

Sets the case name and the case id. The case id must be unique within the file. The database id specifies which database is used by the case.

Member Function Documentation

bool cee::vtfx::Case::addImage ( const cee::Str imageName,
cee::Image image 
)

Adds an image to this case.

The imageName should be unique. If an image with the specified image name already exists, the existing image will be overwritten.

int cee::vtfx::Case::databaseId ( ) const

Returns the id of the database used by this case.

bool cee::vtfx::Case::derivedResultsDisabled ( ) const

Returns true if derived should NOT be created.

Default value is 'false', meaning derived results will be created when the model file is read.

Str cee::vtfx::Case::description ( ) const

Returns the HTML formatted description text.

int cee::vtfx::Case::id ( ) const

Returns the case id.

const Image * cee::vtfx::Case::image ( size_t  imageIndex) const

Gets the image at index imageIndex.

Returns NULL if no image was found for the given index.

size_t cee::vtfx::Case::imageCount ( ) const

Returns the number of images in this case.

cee::Str cee::vtfx::Case::imageName ( size_t  imageIndex) const

Gets the image name of the image at index imageIndex.

Returns an empty string if no image was found for the given index.

cee::Str cee::vtfx::Case::name ( ) const

Sets the case name.

const PropertySetCollection * cee::vtfx::Case::properties ( ) const

Returns the properties for this case.

A PropertySetCollection is a collection of property sets. Each property set is a group of properties for a specific area, for instance part settings or an isosurface.

See the full listing of case properties in the Properties Documentation.

void cee::vtfx::Case::setDerivedResultsDisabled ( bool  disable)

If set to 'true', derived results will NOT be created when the file is read.

Default behavior is creating derived results (disable = false)

void cee::vtfx::Case::setDescription ( const Str descriptionHtml)

Sets the case description.

HTML formatted text is allowed.

void cee::vtfx::Case::setName ( const cee::Str name)

Returns the case name.

bool cee::vtfx::Case::setProperties ( PropertySetCollection propertySetCollection)

Sets the properties for this case.

A PropertySetCollection is a collection of property sets. Each property set is a group of properties for a specific area, for instance part settings or an isosurface.

Example:

// Set part with id 2 (geometry index 0) to invisible
cee::PtrRef<cee::PropertySet> partSettings = new cee::PropertySet("part_settings");
partSettings->setValue("context_geometry_index", static_cast<unsigned int>(0));
partSettings->setValue("context_part_id", 2);
partSettings->setValue("visible", false);
vtfxProps->addPropertySet(partSettings.get());
currentCase->setProperties(*vtfxProps);

See the full listing of case properties in the Properties Documentation.

Returns false if invalid properties were found. Check the log for a list of invalid properties.

void cee::vtfx::Case::setSnapshot ( cee::Image image)

Sets a snapshot, i.e. preview image for this case.

This image will be embedded into the VTFx file.

const Image * cee::vtfx::Case::snapshot ( ) const

Returns the snapshot, i.e. preview image for this case.

Returns NULL if no snapshot image was found.