SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkModelMultiBlockSource Class Reference

A VTK source for exposing model geometry in SMTK Resource as multiblock data. More...

#include <vtkModelMultiBlockSource.h>

Inheritance diagram for vtkModelMultiBlockSource:
[legend]
Collaboration diagram for vtkModelMultiBlockSource:
[legend]

Public Types

enum  ToplevelBlockType {
  AUXILIARY_VOLUMES, AUXILIARY_SURFACES, AUXILIARY_CURVES, AUXILIARY_POINTS,
  AUXILIARY_MIXED, GROUPS, VOLUMES, FACES,
  EDGES, VERTICES, NUMBER_OF_BLOCK_TYPES
}
 
typedef vtkResourceMultiBlockSource Superclass
 
- Public Types inherited from vtkResourceMultiBlockSource
typedef vtkMultiBlockDataSetAlgorithm Superclass
 
using UUID = smtk::common::UUID
 
using SequenceType = int
 Sequence numbers are integers describing how recent a given component's data is.
 

Public Member Functions

 smtkDeclareTracksAllInstances (vtkModelMultiBlockSource)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
virtual int IsA (const char *type)
 
vtkModelMultiBlockSourceNewInstance () const
 
virtual vtkMultiBlockDataSet * GetCachedOutputMBDS ()
 
virtual vtkMultiBlockDataSet * GetCachedOutputInst ()
 
smtk::model::ResourcePtr GetModelResource ()
 Get the SMTK model being displayed.
 
void SetModelResource (const smtk::model::ResourcePtr &)
 Set the SMTK model to be displayed.
 
void GetUUID2BlockIdMap (std::map< smtk::common::UUID, vtkIdType > &uuid2mid)
 Get the map from model entity UUID to the block index in multiblock output.
 
void Dirty ()
 Indicate that the model has changed and should have its VTK representation updated.
 
virtual double * GetDefaultColor ()
 Get the RGBA color for model entities that do not have a color property set. More...
 
virtual void GetDefaultColor (double &, double &, double &, double &)
 Get the RGBA color for model entities that do not have a color property set. More...
 
virtual void GetDefaultColor (double[4])
 Get the RGBA color for model entities that do not have a color property set. More...
 
virtual void SetDefaultColor (double, double, double, double)
 Set the default color (RGBA) for each model entity. More...
 
virtual void SetDefaultColor (double[4])
 Set the default color (RGBA) for each model entity. More...
 
virtual int GetShowAnalysisTessellation ()
 Get which tessellation to output. More...
 
virtual void SetShowAnalysisTessellation (int)
 Set which tessellation to output. More...
 
virtual void ShowAnalysisTessellationOn ()
 Request the analysis tessellation be shown.
 
virtual void ShowAnalysisTessellationOff ()
 Request the display tessellation be shown.
 
virtual int GetAllowNormalGeneration ()
 
virtual void SetAllowNormalGeneration (int)
 
virtual void AllowNormalGenerationOn ()
 
virtual void AllowNormalGenerationOff ()
 
- Public Member Functions inherited from vtkResourceMultiBlockSource
vtkResourceMultiBlockSourceNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
 vtkResourceMultiBlockSource (const vtkResourceMultiBlockSource &)=delete
 
vtkResourceMultiBlockSourceoperator= (const vtkResourceMultiBlockSource &)=delete
 
smtk::resource::ComponentPtr GetComponent (vtkInformation *)
 
smtk::resource::ResourcePtr GetResource ()
 
void SetResource (const smtk::resource::ResourcePtr &)
 
vtkMTimeType GetMTime () override
 We are modified by updated parameters and by updated resource geometry.
 
bool SetCachedData (const UUID &uid, vtkDataObject *data, SequenceType sequenceNumber)
 Given a UUID and a data object, insert it into the cache, overwriting any pre-existing entry. More...
 
SequenceType GetCachedDataSequenceNumber (const UUID &uid) const
 Fetch a cache entry's sequence number.
 
vtkDataObject * GetCachedDataObject (const UUID &uid)
 Fetch a cache entry's data.
 
bool RemoveCacheEntry (const UUID &uid)
 Remove a single cache entry. More...
 
bool RemoveCacheEntriesExcept (const std::set< UUID > &exceptions)
 Remove cache entries not listed in the provided set.
 
void ClearCache ()
 Remove all cache entries (releasing their VTK data objects).
 
int RequestData (vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
 

Static Public Member Functions

static vtkModelMultiBlockSourceNew ()
 
static int IsTypeOf (const char *type)
 
static vtkModelMultiBlockSourceSafeDownCast (vtkObjectBase *o)
 
static const char * GetEntityTagName ()
 
static const char * GetGroupTagName ()
 
static const char * GetVolumeTagName ()
 
static const char * GetAttributeTagName ()
 
template<typename T >
static T GetDataObjectEntityAs (smtk::model::ResourcePtr resource, vtkInformation *info)
 
static void AddPointsAsAttribute (vtkPolyData *data)
 
- Static Public Member Functions inherited from vtkResourceMultiBlockSource
static int IsTypeOf (const char *type)
 
static vtkResourceMultiBlockSourceSafeDownCast (vtkObjectBase *o)
 
static vtkResourceMultiBlockSourceNew ()
 
static vtkInformationStringKey * COMPONENT_ID ()
 Key used to put entity UUID in the meta-data associated with a block.
 
static void SetDataObjectUUID (vtkInformation *, const UUID &)
 Set the COMPONENT_ID key on the given information object to a given UUID.
 
static UUID GetDataObjectUUID (vtkInformation *)
 Return a UUID for the data object.
 
static void SetResourceId (vtkMultiBlockDataSet *dataset, const UUID &)
 Store the resource UUID in the output dataset's top-level block metadata.
 
static UUID GetResourceId (vtkMultiBlockDataSet *dataset)
 Fetch the resource UUID from a dataset's top-level block metadata.
 
static smtk::resource::ComponentPtr GetComponent (const smtk::resource::ResourcePtr &, vtkInformation *)
 Return the component corresponding to the data object.
 
static void DumpBlockStructureWithUUIDs (vtkMultiBlockDataSet *dataset, int indent=0)
 A debug utility to print out the block structure of a multiblock dataset annotated with UUIDs (where present) and data type.
 
static void DumpBlockStructureWithUUIDsInternal (vtkMultiBlockDataSet *dataset, int &counter, int indent=0)
 

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 
vtkSmartPointer< vtkDataObject > GenerateRepresentationFromModel (const smtk::model::EntityRef &entity, bool genNormals)
 Generate a data object representing the entity. It may be polydata, image data, or a multiblock dataset.
 
vtkSmartPointer< vtkPolyData > GenerateRepresentationFromTessellation (const smtk::model::EntityRef &entity, const smtk::model::Tessellation *tess, bool genNormals)
 
vtkSmartPointer< vtkPolyData > GenerateRepresentationFromMeshTessellation (const smtk::model::EntityRef &entity, bool genNormals)
 
void GenerateRepresentationFromModel (vtkPolyData *poly, const smtk::model::EntityRef &entity, bool genNormals)
 Loop over the model generating blocks of polydata.
 
void AddInstanceMetadata (vtkIdType &npts, smtk::model::InstanceSet &modelInstances, const smtk::model::Instance &inst, std::map< smtk::model::EntityRef, vtkIdType > &instancePrototypes)
 Called by GenerateRepresentationFromModel to sum placements across all instances.
 
void PreparePrototypeOutput (vtkMultiBlockDataSet *mbds, vtkMultiBlockDataSet *protoBlocks, std::map< smtk::model::EntityRef, vtkIdType > &instancePrototypes)
 Called by GenerateRepresentationFromModel to create hierarchical multiblock for rendering instance glyphs.
 
void PrepareInstanceOutput (vtkMultiBlockDataSet *instanceBlocks, const smtk::model::InstanceSet &, std::map< smtk::model::EntityRef, vtkIdType > &)
 Called by GenerateRepresentationFromModel to create a polydata per instance.
 
void AddInstancePoints (vtkPolyData *instancePoly, const smtk::model::Instance &inst, std::map< smtk::model::EntityRef, vtkIdType > &instancePrototypes)
 Called by GenerateRepresentationFromModel to add a glyph point per instance location.
 
void GenerateRepresentationFromModel (vtkMultiBlockDataSet *mbds, vtkMultiBlockDataSet *instancePoly, vtkMultiBlockDataSet *protoBlocks, const smtk::model::ResourcePtr &model)
 Create a multiblock with the right structure, find entities with tessellations, and add them.
 
void GenerateRepresentationFromMeshTessellation (vtkPolyData *poly, const smtk::model::EntityRef &entity, bool genNormals)
 
void GenerateRepresentationFromModel (vtkMultiBlockDataSet *mbds, const smtk::model::ResourcePtr &model)
 
int RequestData (vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
 Generate polydata from an smtk::model with tessellation information.
 
void SetCachedOutput (vtkMultiBlockDataSet *, vtkMultiBlockDataSet *, vtkMultiBlockDataSet *)
 
- Protected Member Functions inherited from vtkResourceMultiBlockSource
int RequestDataFromGeometry (vtkInformation *request, vtkInformationVector *outputData, const smtk::extension::vtk::geometry::Geometry &provider)
 If any subclass determines that the resource has an appropriate geometry provider, it can call this method for the body of its RequestData() implementation.
 

Protected Attributes

vtkMultiBlockDataSet * CachedOutputMBDS
 
vtkMultiBlockDataSet * CachedOutputProto
 
vtkMultiBlockDataSet * CachedOutputInst
 
double DefaultColor [4]
 
int AllowNormalGeneration
 
int ShowAnalysisTessellation
 
vtkNew< vtkPolyDataNormals > NormalGenerator
 
std::map< smtk::common::UUID, vtkIdType > UUID2BlockIdMap
 
- Protected Attributes inherited from vtkResourceMultiBlockSource
std::weak_ptr< smtk::resource::ResourceResource
 
std::map< UUID, CacheEntryCache
 
std::set< UUIDVisited
 
smtk::geometry::Geometry::GenerationNumber LastModified { 0 }
 

Additional Inherited Members

- Static Public Attributes inherited from vtkResourceMultiBlockSource
constexpr static SequenceType InvalidSequence = -1
 Reserve a special value for invalid (non-existent) sequence numbers.
 

Detailed Description

A VTK source for exposing model geometry in SMTK Resource as multiblock data.

This filter generates a single block per UUID, for every UUID in model resource with a tessellation entry.

Member Function Documentation

◆ GetDefaultColor() [1/3]

vtkModelMultiBlockSource::GetDefaultColor ( )
virtual

Get the RGBA color for model entities that do not have a color property set.

The default value for DefaultColor is [1., 1., 1., 1.].

◆ GetDefaultColor() [2/3]

vtkModelMultiBlockSource::GetDefaultColor ( double &  r,
double &  g,
double &  b,
double &  a 
)
virtual

Get the RGBA color for model entities that do not have a color property set.

The default value for DefaultColor is [1., 1., 1., 1.].

◆ GetDefaultColor() [3/3]

vtkModelMultiBlockSource::GetDefaultColor ( double  rgba[4])
virtual

Get the RGBA color for model entities that do not have a color property set.

The default value for DefaultColor is [1., 1., 1., 1.].

◆ GetShowAnalysisTessellation()

vtkModelMultiBlockSource::GetShowAnalysisTessellation ( )
virtual

Get which tessellation to output.

The default value is 0 (output the "display" tessellation, which is not suitable for analysis but generally fast to compute). A non-zero value indicates the analysis tessellation will be output if present. If not present, then the display tessellation will be output.

◆ SetDefaultColor() [1/2]

vtkModelMultiBlockSource::SetDefaultColor ( double  r,
double  g,
double  b,
double  a 
)
virtual

Set the default color (RGBA) for each model entity.

This color will be assigned to each cell of each block for entities that do not provide a color float-property.

Setting the alpha component of the default color to a negative number will turn off per-cell color array generation to save space.

See also
vtkModelMultiBlockSource::GetDefaultColor

◆ SetDefaultColor() [2/2]

vtkModelMultiBlockSource::SetDefaultColor ( double  rgba[4])
virtual

Set the default color (RGBA) for each model entity.

This color will be assigned to each cell of each block for entities that do not provide a color float-property.

Setting the alpha component of the default color to a negative number will turn off per-cell color array generation to save space.

See also
vtkModelMultiBlockSource::GetDefaultColor

◆ SetShowAnalysisTessellation()

vtkModelMultiBlockSource::SetShowAnalysisTessellation ( int  tess)
virtual

Set which tessellation to output.

Setting this to a non-zero value will cause the analysis tessellation (if present) to be output. Otherwise, the display tessellation is output.


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