Commit 2b18c8b4 authored by Kyle Lutz's avatar Kyle Lutz
Browse files

Add QUERY type for vtkSelectionNode

Change-Id: I494ddef84e216560dc2c6d203b60ad29b3b1d4fd
parent 93b15a76
...@@ -60,6 +60,7 @@ vtkSelectionNode::vtkSelectionNode() ...@@ -60,6 +60,7 @@ vtkSelectionNode::vtkSelectionNode()
{ {
this->SelectionData = vtkDataSetAttributes::New(); this->SelectionData = vtkDataSetAttributes::New();
this->Properties = vtkInformation::New(); this->Properties = vtkInformation::New();
this->QueryString = 0;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
...@@ -70,6 +71,7 @@ vtkSelectionNode::~vtkSelectionNode() ...@@ -70,6 +71,7 @@ vtkSelectionNode::~vtkSelectionNode()
{ {
this->SelectionData->Delete(); this->SelectionData->Delete();
} }
this->SetQueryString(0);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
...@@ -189,6 +191,7 @@ void vtkSelectionNode::ShallowCopy(vtkSelectionNode* input) ...@@ -189,6 +191,7 @@ void vtkSelectionNode::ShallowCopy(vtkSelectionNode* input)
this->Initialize(); this->Initialize();
this->Properties->Copy(input->Properties, 0); this->Properties->Copy(input->Properties, 0);
this->SelectionData->ShallowCopy(input->SelectionData); this->SelectionData->ShallowCopy(input->SelectionData);
this->SetQueryString(input->GetQueryString());
this->Modified(); this->Modified();
} }
...@@ -202,6 +205,7 @@ void vtkSelectionNode::DeepCopy(vtkSelectionNode* input) ...@@ -202,6 +205,7 @@ void vtkSelectionNode::DeepCopy(vtkSelectionNode* input)
this->Initialize(); this->Initialize();
this->Properties->Copy(input->Properties, 1); this->Properties->Copy(input->Properties, 1);
this->SelectionData->DeepCopy(input->SelectionData); this->SelectionData->DeepCopy(input->SelectionData);
this->SetQueryString(input->GetQueryString());
this->Modified(); this->Modified();
} }
......
...@@ -123,7 +123,8 @@ public: ...@@ -123,7 +123,8 @@ public:
FRUSTUM, FRUSTUM,
LOCATIONS, LOCATIONS,
THRESHOLDS, THRESHOLDS,
BLOCKS // used to select blocks within a composite dataset. BLOCKS, // used to select blocks within a composite dataset.
QUERY
}; };
//ETX //ETX
...@@ -157,6 +158,11 @@ public: ...@@ -157,6 +158,11 @@ public:
virtual void SetFieldType(int type); virtual void SetFieldType(int type);
virtual int GetFieldType(); virtual int GetFieldType();
// Description:
// Set/Get the query expression string.
vtkSetStringMacro(QueryString);
vtkGetStringMacro(QueryString);
// Description: // Description:
// For location selection of points, if distance is greater than this reject. // For location selection of points, if distance is greater than this reject.
static vtkInformationDoubleKey* EPSILON(); static vtkInformationDoubleKey* EPSILON();
...@@ -242,6 +248,7 @@ protected: ...@@ -242,6 +248,7 @@ protected:
vtkInformation* Properties; vtkInformation* Properties;
vtkDataSetAttributes* SelectionData; vtkDataSetAttributes* SelectionData;
char* QueryString;
private: private:
vtkSelectionNode(const vtkSelectionNode&); // Not implemented. vtkSelectionNode(const vtkSelectionNode&); // Not implemented.
......
...@@ -69,6 +69,7 @@ vtkSelectionSource::vtkSelectionSource() ...@@ -69,6 +69,7 @@ vtkSelectionSource::vtkSelectionSource()
this->CompositeIndex = -1; this->CompositeIndex = -1;
this->HierarchicalLevel = -1; this->HierarchicalLevel = -1;
this->HierarchicalIndex = -1; this->HierarchicalIndex = -1;
this->QueryString = 0;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
...@@ -504,6 +505,13 @@ int vtkSelectionSource::RequestData( ...@@ -504,6 +505,13 @@ int vtkSelectionSource::RequestData(
selectionList->Delete(); selectionList->Delete();
} }
if(this->ContentType == vtkSelectionNode::QUERY)
{
oProperties->Set(vtkSelectionNode::CONTENT_TYPE(), this->ContentType);
oProperties->Set(vtkSelectionNode::FIELD_TYPE(), this->FieldType);
output->SetQueryString(this->QueryString);
}
oProperties->Set(vtkSelectionNode::CONTAINING_CELLS(), oProperties->Set(vtkSelectionNode::CONTAINING_CELLS(),
this->ContainingCells); this->ContainingCells);
......
...@@ -122,6 +122,12 @@ public: ...@@ -122,6 +122,12 @@ public:
vtkGetMacro(HierarchicalLevel, int); vtkGetMacro(HierarchicalLevel, int);
vtkSetMacro(HierarchicalIndex, int); vtkSetMacro(HierarchicalIndex, int);
vtkGetMacro(HierarchicalIndex, int); vtkGetMacro(HierarchicalIndex, int);
// Description:
// Set/Get the query expression string.
vtkSetStringMacro(QueryString);
vtkGetStringMacro(QueryString);
protected: protected:
vtkSelectionSource(); vtkSelectionSource();
~vtkSelectionSource(); ~vtkSelectionSource();
...@@ -146,6 +152,7 @@ protected: ...@@ -146,6 +152,7 @@ protected:
int HierarchicalIndex; int HierarchicalIndex;
char *ArrayName; char *ArrayName;
int ArrayComponent; int ArrayComponent;
char *QueryString;
private: private:
vtkSelectionSource(const vtkSelectionSource&); // Not implemented. vtkSelectionSource(const vtkSelectionSource&); // Not implemented.
......
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