# cee::vtfx::Case

class `Case` : public RefCountedObject

  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: VTFx Properties

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

  Public Functions

  `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.

  virtual `~Case`()
  int `id`() const

    Returns the case id.

  int `databaseId`() const

    Returns the id of the database used by this case.

  cee::Str `name`() const

    Sets the case name.

  void `setName`(const cee::Str &name)

    Returns the case name.

  Str `description`() const

    Returns the HTML formatted description text.

  void `setDescription`(const Str &descriptionHtml)

    Sets the case description.

    HTML formatted text is allowed.

  const Image *`snapshot`() const

    Returns the snapshot, i.e.

    preview image for this case.

    Returns NULL if no snapshot image was found.

  void `setSnapshot`(cee::Image *image)

    Sets a snapshot, i.e.

    preview image for this case.

    This image will be embedded into the VTFx file.

  size_t `imageCount`() const

    Returns the number of images in this case.

  cee::Str `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.

  const Image *`image`(size_t imageIndex) const

    Gets the image at index imageIndex.

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

  bool `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.

  const PropertySetCollection *`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: VTFx Properties

  bool `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:

        cee::PtrRef<cee::PropertySetCollection> vtfxProps = new cee::PropertySetCollection;

        // 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: VTFx Properties

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

  bool `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.

  void `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)

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your Docs generative AI assistant. Ask me anything about HOOPS Envision for Desktop or choose a sample question below to start a conversation:

What is HOOPS Envision for Desktop?
What are the latest release notes for HOOPS Envision for Desktop?
How do I start evaluating HOOPS Envision for Desktop?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...