Commit 30b1a51a authored by T.J. Corona's avatar T.J. Corona

vtkModelMultiBlockSource: render model resources, not models.

parent 2755d8e1
......@@ -49,18 +49,6 @@ vtkSmartPointer<vtkAlgorithm> SourceFromModel::operator()(
// Tell our multiblock source to generate VTK polydata for model entities.
source->SetModelResource(modelResource);
// Also, find the first model and tell the multiblock source to render only it.
// From dcthomp:
// TODO: Either we need a separate representation for each model (which is
// IMNSHO a bad idea) or we need to change the multiblock source to work
// without a model. It currently generates tessellations but not all the
// metadata required for color-by modes.
auto models =
modelResource->entitiesMatchingFlagsAs<smtk::model::Models>(smtk::model::MODEL_ENTITY, false);
if (!models.empty())
{
source->SetModelEntityID(models.begin()->entity().toString().c_str());
}
return source;
}
}
......
......@@ -84,9 +84,6 @@ int main(int argc, char* argv[])
vtkNew<vtkRenderer> ren;
vtkNew<vtkRenderWindow> win;
src->SetModelResource(resource);
// TODO: Accept a model name or UUID and tell the src to use it:
// src->SetModelEntityID(
// resource->entitiesMatchingFlagsAs<Models>(MODEL_ENTITY)[0].entity().toString().c_str());
if (debug)
{
win->SetMultiSamples(16);
......
......@@ -73,11 +73,6 @@ public:
smtk::model::ResourcePtr GetModelResource();
void SetModelResource(smtk::model::ResourcePtr);
// Description:
// Model entity ID that this source will be built upon.
vtkSetStringMacro(ModelEntityID);
vtkGetStringMacro(ModelEntityID);
void GetUUID2BlockIdMap(std::map<smtk::common::UUID, vtkIdType>& uuid2mid);
void Dirty();
......@@ -158,7 +153,6 @@ protected:
vtkMultiBlockDataSet* CachedOutputInst;
vtkMultiBlockDataSet* CachedOutputProto;
double DefaultColor[4];
char* ModelEntityID; // Model Entity UUID
int AllowNormalGeneration;
int ShowAnalysisTessellation;
vtkNew<vtkPolyDataNormals> NormalGenerator;
......
......@@ -107,7 +107,6 @@ smtkComponentInitMacro(smtk_extension_vtk_io_mesh_MeshIOVTK)
vtkNew<vtkRenderer> ren;
vtkNew<vtkRenderWindow> win;
src->SetModelResource(model.resource());
src->SetModelEntityID(model.entity().toString().c_str());
src->SetDefaultColor(1., 1., 0., 1.);
map->SetInputConnection(src->GetOutputPort());
act->SetMapper(map.GetPointer());
......
......@@ -142,7 +142,6 @@ smtkComponentInitMacro(smtk_extension_vtk_io_mesh_MeshIOVTK)
vtkNew<vtkRenderer> ren;
vtkNew<vtkRenderWindow> win;
src->SetModelResource(model.resource());
src->SetModelEntityID(model.entity().toString().c_str());
src->SetDefaultColor(1., 1., 0., 1.);
map->SetInputConnection(src->GetOutputPort());
act->SetMapper(map.GetPointer());
......
......@@ -194,7 +194,6 @@ class TestCase:
import smtk.extension.vtk.source
mbs = smtk.extension.vtk.source.vtkModelMultiBlockSource()
mbs.SetModelResource(model.resource())
mbs.SetModelEntityID(str(model.entity()))
# mbs.ShowAnalysisTessellationOff()
addedToScene = self.addToScene(mbs)
mp = addedToScene[2]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment