Commit ee683d96 authored by T.J. Corona's avatar T.J. Corona

When creating a PV pipeline for created resources, use SMTKSource proxy.

parent a2ef24f4
......@@ -234,6 +234,10 @@ macro(add_pqproxy_custom OUTIFACES OUTSRCS)
endmacro()
add_pqproxy_custom(proxyIfaces proxyIfaceSrcs
TYPE pqSMTKResource
XML_GROUP sources
XML_NAME SMTKSource
TYPE pqSMTKResource
XML_GROUP sources
XML_NAME SMTKModelReader
......
......@@ -181,8 +181,8 @@ pqSMTKResource* pqSMTKBehavior::getPVResource(smtk::resource::ResourcePtr resour
pqServer* server = pqActiveObjects::instance().activeServer();
pqObjectBuilder* builder = pqCore->getObjectBuilder();
result = static_cast<pqSMTKResource*>(builder->createSource("sources", "SMTKResource", server));
vtkSMPropertyHelper(result->getProxy(), "Resource").Set(resource->id().toString().c_str());
result = static_cast<pqSMTKResource*>(builder->createSource("sources", "SMTKSource", server));
vtkSMPropertyHelper(result->getProxy(), "ResourceId").Set(resource->id().toString().c_str());
result->getProxy()->UpdateVTKObjects();
}
......
......@@ -90,6 +90,31 @@
subproxy in the "sources" section below.
-->
<ProxyGroup name="smtk_internal_sources">
<SourceProxy name="SMTKResource" class="vtkSMTKResource" label="SMTK Resource">
<Documentation
short_help="A proxy for an SMTK resource."
long_help="A proxy for an SMTK resource.">
</Documentation>
<StringVectorProperty
name="ResourceId"
command="SetResourceById"
animateable="0"
number_of_elements="1">
<Documentation>
A string representation of a resource Id.
</Documentation>
</StringVectorProperty>
<OutputPort index="0" name="model entities"/>
<OutputPort index="1" name="instance prototypes"/>
<OutputPort index="2" name="instance points"/>
<Hints>
<Representation view="RenderView" type="SMTKModelCompositeRepresentation" />
</Hints>
</SourceProxy>
<SourceProxy name="SMTKModelReader" class="vtkSMTKModelReader" label="SMTK Model Reader">
<Documentation
short_help="Read an SMTK Geometry file."
......@@ -276,8 +301,8 @@
</Documentation>
<StringVectorProperty
name="Resource"
command="SetResource"
name="ResourceId"
command="SetResourceById"
animateable="0"
number_of_elements="1"
panel_visibility="never">
......@@ -292,6 +317,24 @@
</Hints>
</SourceProxy>
<SourceProxy class="vtkSMTKSource" name="SMTKSource">
<SubProxy command="SetVTKResource">
<Proxy name="VTKResource"
proxygroup="smtk_internal_sources"
proxyname="SMTKResource">
</Proxy>
<ExposedProperties>
<Property name="ResourceId" />
</ExposedProperties>
</SubProxy>
<OutputPort index="0" name="entities"/>
<OutputPort index="1" name="instance prototypes"/>
<OutputPort index="2" name="instance points"/>
<Hints>
<Representation view="RenderView" type="SMTKModelCompositeRepresentation" />
</Hints>
</SourceProxy>
<!--
We describe an instance of vtkSMTKSource with a subproxy for each of the
internal sources described in smtk_internal_sources. This pattern
......
......@@ -54,7 +54,7 @@ void vtkSMTKResource::PrintSelf(ostream& os, vtkIndent indent)
<< "\n";
}
void vtkSMTKResource::SetResource(const char* resourceIdStr)
void vtkSMTKResource::SetResourceById(const char* resourceIdStr)
{
vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting resource to "
<< (resourceIdStr ? resourceIdStr : "(null)"));
......
......@@ -37,7 +37,7 @@ public:
static vtkSMTKResource* New();
/// Set the SMTK resource by the string representation of its resource Id.
void SetResource(const char* resourceIdStr);
void SetResourceById(const char* resourceIdStr);
/// Set/get the SMTK resource.
void SetResource(const smtk::resource::ResourcePtr& resource);
......
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