Skip to content
Snippets Groups Projects
Commit 29ff2942 authored by Hahn, Steven's avatar Hahn, Steven
Browse files

Rename representation.

parent cbadef8f
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@ include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
ADD_PARAVIEW_PLUGIN(MantidParaViewRepresentationSMPlugin "1.0"
SERVER_MANAGER_XML Representation.xml
SERVER_MANAGER_SOURCES
vtkMySpecialRepresentation.cxx
vtkAlignedGeometrySliceRepresentation.cxx
AlignedThreeSliceFilter.cxx
AlignedCutter.cxx)
......
<ServerManagerConfiguration>
<ProxyGroup name="representations">
<RepresentationProxy name="MySpecialRepresentation"
<RepresentationProxy name="AlignedGeometrySliceRepresentation"
base_proxygroup="internal_representations"
base_proxyname="SurfaceRepresentationBase"
class="vtkMySpecialRepresentation"
class="vtkAlignedGeometrySliceRepresentation"
processes="client|renderserver|dataserver">
<Documentation>
MySpecialRepresentation add support to show multiple slices in the view.
This is used by CompositeMySpecialRepresentation.
AlignedGeometrySliceRepresentation add support to show multiple slices in the view.
This is used by CompositeAlignedGeometrySliceRepresentation.
</Documentation>
<InputProperty command="SetInputConnection"
name="Input">
......@@ -27,17 +27,17 @@
<BooleanDomain name="bool" />
</IntVectorProperty>
</RepresentationProxy>
<PVRepresentationProxy name="CompositeMySpecialRepresentation"
<PVRepresentationProxy name="CompositeAlignedGeometrySliceRepresentation"
base_proxygroup="representations"
base_proxyname="GeometryRepresentation"
class="vtkPVCompositeRepresentation"
processes="client|renderserver|dataserver" >
<RepresentationType subproxy="MySpecialRepresentation"
<RepresentationType subproxy="AlignedGeometrySliceRepresentation"
text="Slices" subtype="Surface"/>
<SubProxy>
<Proxy name="MySpecialRepresentation"
<Proxy name="AlignedGeometrySliceRepresentation"
proxygroup="representations"
proxyname="MySpecialRepresentation">
proxyname="AlignedGeometrySliceRepresentation">
</Proxy>
<ShareProperties subproxy="SurfaceRepresentation">
<Exception name="Input" />
......
/*=========================================================================
Program: ParaView
Module: vtkMySpecialRepresentation.cxx
Module: vtkAlignedGeometrySliceRepresentation.cxx
Copyright (c) Kitware, Inc.
All rights reserved.
......@@ -12,8 +12,9 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkMySpecialRepresentation.h"
#include "vtkAlignedGeometrySliceRepresentation.h"
#include "AlignedThreeSliceFilter.h"
#include "vtkActor.h"
#include "vtkAlgorithmOutput.h"
#include "vtkCompositePolyDataMapper2.h"
......@@ -38,28 +39,22 @@
#include "vtkRenderer.h"
#include "vtkSmartPointer.h"
#include "vtkStringArray.h"
#include "AlignedThreeSliceFilter.h"
#include "vtkVector.h"
#include <cassert>
#include <vector>
namespace
{
bool GetNormalsToBasisPlanes(vtkMatrix4x4* changeOfBasisMatrix, vtkVector3d sliceNormals[3])
{
if (!changeOfBasisMatrix)
{
namespace {
bool GetNormalsToBasisPlanes(vtkMatrix4x4 *changeOfBasisMatrix,
vtkVector3d sliceNormals[3]) {
if (!changeOfBasisMatrix) {
sliceNormals[0] = vtkVector3d(1, 0, 0);
sliceNormals[1] = vtkVector3d(0, 1, 0);
sliceNormals[2] = vtkVector3d(0, 0, 1);
}
else
{
} else {
vtkVector3d axisBases[3];
vtkPVChangeOfBasisHelper::GetBasisVectors(
changeOfBasisMatrix, axisBases[0], axisBases[1], axisBases[2]);
for (int cc = 0; cc < 3; cc++)
{
vtkPVChangeOfBasisHelper::GetBasisVectors(changeOfBasisMatrix, axisBases[0],
axisBases[1], axisBases[2]);
for (int cc = 0; cc < 3; cc++) {
sliceNormals[cc] = axisBases[(cc + 1) % 3].Cross(axisBases[(cc + 2) % 3]);
sliceNormals[cc].Normalize();
}
......@@ -67,24 +62,20 @@ bool GetNormalsToBasisPlanes(vtkMatrix4x4* changeOfBasisMatrix, vtkVector3d slic
return true;
}
class vtkGSRGeometryFilter : public vtkPVGeometryFilter
{
class vtkGSRGeometryFilter : public vtkPVGeometryFilter {
std::vector<double> SlicePositions[3];
public:
/// Set positions for slice locations along each of the basis axis.
void SetSlicePositions(int axis, const std::vector<double>& positions)
{
void SetSlicePositions(int axis, const std::vector<double> &positions) {
assert(axis >= 0 && axis <= 2);
if (this->SlicePositions[axis] != positions)
{
if (this->SlicePositions[axis] != positions) {
this->SlicePositions[axis] = positions;
this->Modified();
}
}
static bool CacheBounds(vtkDataObject* dataObject, const double bounds[6])
{
static bool CacheBounds(vtkDataObject *dataObject, const double bounds[6]) {
vtkNew<vtkDoubleArray> boundsArray;
boundsArray->SetName("vtkGSRGeometryFilter_Bounds");
boundsArray->SetNumberOfComponents(6);
......@@ -93,23 +84,20 @@ public:
dataObject->GetFieldData()->AddArray(boundsArray.GetPointer());
return true;
}
static bool ExtractCachedBounds(vtkDataObject* dataObject, double bounds[6])
{
if (dataObject == NULL || dataObject->GetFieldData() == NULL)
{
static bool ExtractCachedBounds(vtkDataObject *dataObject, double bounds[6]) {
if (dataObject == NULL || dataObject->GetFieldData() == NULL) {
return false;
}
vtkFieldData* fd = dataObject->GetFieldData();
vtkFieldData *fd = dataObject->GetFieldData();
// first try OrientedBoundingBox if present. These are more accurate when
// Basis is changed.
if (vtkPVChangeOfBasisHelper::GetBoundingBoxInBasis(dataObject, bounds))
{
if (vtkPVChangeOfBasisHelper::GetBoundingBoxInBasis(dataObject, bounds)) {
return true;
}
if (fd->GetArray("vtkGSRGeometryFilter_Bounds") &&
fd->GetArray("vtkGSRGeometryFilter_Bounds")->GetNumberOfTuples() == 1 &&
fd->GetArray("vtkGSRGeometryFilter_Bounds")->GetNumberOfComponents() == 6)
{
fd->GetArray("vtkGSRGeometryFilter_Bounds")->GetNumberOfTuples() == 1 &&
fd->GetArray("vtkGSRGeometryFilter_Bounds")->GetNumberOfComponents() ==
6) {
fd->GetArray("vtkGSRGeometryFilter_Bounds")->GetTuple(0, bounds);
return (vtkMath::AreBoundsInitialized(bounds) == 1);
}
......@@ -117,15 +105,16 @@ public:
}
public:
static vtkGSRGeometryFilter* New();
static vtkGSRGeometryFilter *New();
vtkTypeMacro(vtkGSRGeometryFilter, vtkPVGeometryFilter);
virtual int RequestData(vtkInformation* req, vtkInformationVector** inputVector,
vtkInformationVector* outputVector) VTK_OVERRIDE
{
vtkSmartPointer<vtkDataObject> inputDO = vtkDataObject::GetData(inputVector[0]);
virtual int RequestData(vtkInformation *req,
vtkInformationVector **inputVector,
vtkInformationVector *outputVector) VTK_OVERRIDE {
vtkSmartPointer<vtkDataObject> inputDO =
vtkDataObject::GetData(inputVector[0]);
vtkSmartPointer<vtkMatrix4x4> changeOfBasisMatrix =
vtkPVChangeOfBasisHelper::GetChangeOfBasisMatrix(inputDO);
vtkPVChangeOfBasisHelper::GetChangeOfBasisMatrix(inputDO);
vtkVector3d sliceNormals[3];
GetNormalsToBasisPlanes(changeOfBasisMatrix, sliceNormals);
......@@ -133,19 +122,17 @@ public:
vtkNew<AlignedThreeSliceFilter> slicer;
slicer->SetInputDataObject(inputDO);
slicer->SetCutOrigins(0, 0, 0);
for (int axis = 0; axis < 3; axis++)
{
slicer->SetNumberOfSlice(axis, static_cast<int>(this->SlicePositions[axis].size()));
for (int axis = 0; axis < 3; axis++) {
slicer->SetNumberOfSlice(
axis, static_cast<int>(this->SlicePositions[axis].size()));
slicer->SetCutNormal(axis, sliceNormals[axis].GetData());
for (size_t cc = 0; cc < this->SlicePositions[axis].size(); cc++)
{
double position[4] = { 0, 0, 0, 1 };
for (size_t cc = 0; cc < this->SlicePositions[axis].size(); cc++) {
double position[4] = {0, 0, 0, 1};
position[axis] = this->SlicePositions[axis][cc];
// The of position specified in the UI is in the coordinate space defined
// by the changeOfBasisMatrix. We need to convert it to cartesian
// space.
if (changeOfBasisMatrix)
{
// The of position specified in the UI is in the coordinate space
// defined by the changeOfBasisMatrix. We need to convert it to
// cartesian space.
if (changeOfBasisMatrix) {
changeOfBasisMatrix->MultiplyPoint(position, position);
position[0] /= position[3];
position[1] /= position[3];
......@@ -161,13 +148,14 @@ public:
}
slicer->Update();
inputVector[0]->GetInformationObject(0)->Set(
vtkDataObject::DATA_OBJECT(), slicer->GetOutputDataObject(0));
vtkDataObject::DATA_OBJECT(), slicer->GetOutputDataObject(0));
int ret = this->Superclass::RequestData(req, inputVector, outputVector);
inputVector[0]->GetInformationObject(0)->Set(vtkDataObject::DATA_OBJECT(), inputDO);
inputVector[0]->GetInformationObject(0)->Set(vtkDataObject::DATA_OBJECT(),
inputDO);
// Add input bounds to the ouput field data so it gets cached for use in
// vtkMySpecialRepresentation::RequestData().
vtkDataObject* output = vtkDataObject::GetData(outputVector, 0);
// vtkAlignedGeometrySliceRepresentation::RequestData().
vtkDataObject *output = vtkDataObject::GetData(outputVector, 0);
double inputBds[6];
vtkGeometryRepresentation::GetBounds(inputDO, inputBds, NULL);
vtkGSRGeometryFilter::CacheBounds(output, inputBds);
......@@ -180,14 +168,13 @@ protected:
virtual ~vtkGSRGeometryFilter() {}
private:
vtkGSRGeometryFilter(const vtkGSRGeometryFilter&);
void operator=(vtkGSRGeometryFilter&);
vtkGSRGeometryFilter(const vtkGSRGeometryFilter &);
void operator=(vtkGSRGeometryFilter &);
};
vtkStandardNewMacro(vtkGSRGeometryFilter);
}
} // namespace
class vtkMySpecialRepresentation::vtkInternals
{
class vtkAlignedGeometrySliceRepresentation::vtkInternals {
public:
double OriginalDataBounds[6];
vtkNew<vtkOutlineSource> OutlineSource;
......@@ -195,11 +182,10 @@ public:
vtkNew<vtkActor> OutlineActor;
};
vtkStandardNewMacro(vtkMySpecialRepresentation);
vtkStandardNewMacro(vtkAlignedGeometrySliceRepresentation);
//----------------------------------------------------------------------------
vtkMySpecialRepresentation::vtkMySpecialRepresentation()
: Internals(new vtkMySpecialRepresentation::vtkInternals())
{
vtkAlignedGeometrySliceRepresentation::vtkAlignedGeometrySliceRepresentation()
: Internals(new vtkAlignedGeometrySliceRepresentation::vtkInternals()) {
this->GeometryFilter->Delete();
this->GeometryFilter = vtkGSRGeometryFilter::New();
this->SetupDefaults();
......@@ -208,113 +194,105 @@ vtkMySpecialRepresentation::vtkMySpecialRepresentation()
}
//----------------------------------------------------------------------------
vtkMySpecialRepresentation::~vtkMySpecialRepresentation()
{
vtkAlignedGeometrySliceRepresentation::
~vtkAlignedGeometrySliceRepresentation() {
delete this->Internals;
this->Internals = NULL;
}
//----------------------------------------------------------------------------
void vtkMySpecialRepresentation::SetupDefaults()
{
void vtkAlignedGeometrySliceRepresentation::SetupDefaults() {
vtkMath::UninitializeBounds(this->Internals->OriginalDataBounds);
this->Superclass::SetupDefaults();
vtkCompositePolyDataMapper2* mapper = vtkCompositePolyDataMapper2::SafeDownCast(this->Mapper);
vtkCompositePolyDataMapper2 *mapper =
vtkCompositePolyDataMapper2::SafeDownCast(this->Mapper);
mapper->SetPointIdArrayName("-");
mapper->SetCellIdArrayName("vtkSliceOriginalCellIds");
mapper->SetCompositeIdArrayName("vtkSliceCompositeIndex");
this->Internals->OutlineMapper->SetInputConnection(
this->Internals->OutlineSource->GetOutputPort());
this->Internals->OutlineActor->SetMapper(this->Internals->OutlineMapper.GetPointer());
this->Internals->OutlineSource->GetOutputPort());
this->Internals->OutlineActor->SetMapper(
this->Internals->OutlineMapper.GetPointer());
this->Internals->OutlineActor->SetUseBounds(0);
this->Internals->OutlineActor->SetVisibility(0);
}
//----------------------------------------------------------------------------
int vtkMySpecialRepresentation::ProcessViewRequest(
vtkInformationRequestKey* request_type, vtkInformation* inInfo, vtkInformation* outInfo)
{
if (this->GetVisibility() == false)
{
int vtkAlignedGeometrySliceRepresentation::ProcessViewRequest(
vtkInformationRequestKey *request_type, vtkInformation *inInfo,
vtkInformation *outInfo) {
if (this->GetVisibility() == false) {
return 0;
}
if (request_type == vtkPVView::REQUEST_UPDATE())
{
vtkGSRGeometryFilter* geomFilter = vtkGSRGeometryFilter::SafeDownCast(this->GeometryFilter);
if (request_type == vtkPVView::REQUEST_UPDATE()) {
vtkGSRGeometryFilter *geomFilter =
vtkGSRGeometryFilter::SafeDownCast(this->GeometryFilter);
assert(geomFilter);
// Propagate slice paramemeters from the view to the representation.
vtkPVMultiSliceView* view = vtkPVMultiSliceView::SafeDownCast(inInfo->Get(vtkPVView::VIEW()));
if (view)
{
for (int mode = X_SLICE_ONLY; mode < ALL_SLICES; mode++)
{
if (this->Mode == mode || this->Mode == ALL_SLICES)
{
vtkPVMultiSliceView *view =
vtkPVMultiSliceView::SafeDownCast(inInfo->Get(vtkPVView::VIEW()));
if (view) {
for (int mode = X_SLICE_ONLY; mode < ALL_SLICES; mode++) {
if (this->Mode == mode || this->Mode == ALL_SLICES) {
geomFilter->SetSlicePositions(mode, view->GetSlices(mode));
}
else
{
} else {
geomFilter->SetSlicePositions(mode, std::vector<double>());
}
}
if (geomFilter->GetMTime() > this->GetMTime())
{
if (geomFilter->GetMTime() > this->GetMTime()) {
this->MarkModified();
}
}
}
int retVal = this->Superclass::ProcessViewRequest(request_type, inInfo, outInfo);
if (retVal && request_type == vtkPVView::REQUEST_UPDATE())
{
vtkPVMultiSliceView* view = vtkPVMultiSliceView::SafeDownCast(inInfo->Get(vtkPVView::VIEW()));
if (view)
{
vtkPVMultiSliceView::SetDataBounds(inInfo, this->Internals->OriginalDataBounds);
int retVal =
this->Superclass::ProcessViewRequest(request_type, inInfo, outInfo);
if (retVal && request_type == vtkPVView::REQUEST_UPDATE()) {
vtkPVMultiSliceView *view =
vtkPVMultiSliceView::SafeDownCast(inInfo->Get(vtkPVView::VIEW()));
if (view) {
vtkPVMultiSliceView::SetDataBounds(inInfo,
this->Internals->OriginalDataBounds);
}
if (this->Mode != ALL_SLICES)
{
if (this->Mode != ALL_SLICES) {
// i.e. being used in vtkPVOrthographicSliceView for showing the
// orthographic slices. We don't parallel rendering those orthographic
// views for now.
vtkPVRenderView::SetDeliverToClientAndRenderingProcesses(inInfo, this, true, true);
vtkPVRenderView::SetDeliverToClientAndRenderingProcesses(inInfo, this,
true, true);
}
}
if (request_type == vtkPVView::REQUEST_RENDER())
{
vtkAlgorithmOutput* producerPort = vtkPVRenderView::GetPieceProducer(inInfo, this);
vtkAlgorithm* algo = producerPort->GetProducer();
vtkDataObject* localData = algo->GetOutputDataObject(producerPort->GetIndex());
if (request_type == vtkPVView::REQUEST_RENDER()) {
vtkAlgorithmOutput *producerPort =
vtkPVRenderView::GetPieceProducer(inInfo, this);
vtkAlgorithm *algo = producerPort->GetProducer();
vtkDataObject *localData =
algo->GetOutputDataObject(producerPort->GetIndex());
vtkSmartPointer<vtkMatrix4x4> changeOfBasisMatrix =
vtkPVChangeOfBasisHelper::GetChangeOfBasisMatrix(localData);
vtkPVChangeOfBasisHelper::GetChangeOfBasisMatrix(localData);
// This is called on the "rendering" nodes. We use this pass to communicate
// the "ModelTransformationMatrix" to the view.
if (vtkPVMultiSliceView* view =
vtkPVMultiSliceView::SafeDownCast(inInfo->Get(vtkPVView::VIEW())))
{
if (vtkPVMultiSliceView *view =
vtkPVMultiSliceView::SafeDownCast(inInfo->Get(vtkPVView::VIEW()))) {
view->SetModelTransformationMatrix(changeOfBasisMatrix);
const char* titles[3] = { NULL, NULL, NULL };
vtkPVChangeOfBasisHelper::GetBasisName(localData, titles[0], titles[1], titles[2]);
for (int axis = 0; axis < 3; ++axis)
{
if (titles[axis] != NULL)
{
const char *titles[3] = {NULL, NULL, NULL};
vtkPVChangeOfBasisHelper::GetBasisName(localData, titles[0], titles[1],
titles[2]);
for (int axis = 0; axis < 3; ++axis) {
if (titles[axis] != NULL) {
vtkPVMultiSliceView::SetAxisTitle(inInfo, axis, titles[axis]);
}
}
double bds[6];
if (vtkGSRGeometryFilter::ExtractCachedBounds(localData, bds))
{
if (vtkGSRGeometryFilter::ExtractCachedBounds(localData, bds)) {
this->Internals->OutlineSource->SetBounds(bds);
this->Internals->OutlineActor->SetUserMatrix(changeOfBasisMatrix);
this->Internals->OutlineActor->SetVisibility(this->ShowOutline ? 1 : 0);
}
else
{
} else {
this->Internals->OutlineActor->SetVisibility(0);
}
}
......@@ -323,17 +301,17 @@ int vtkMySpecialRepresentation::ProcessViewRequest(
}
//----------------------------------------------------------------------------
int vtkMySpecialRepresentation::RequestData(
vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
{
int vtkAlignedGeometrySliceRepresentation::RequestData(
vtkInformation *request, vtkInformationVector **inputVector,
vtkInformationVector *outputVector) {
vtkMath::UninitializeBounds(this->Internals->OriginalDataBounds);
if (this->Superclass::RequestData(request, inputVector, outputVector))
{
if (this->Superclass::RequestData(request, inputVector, outputVector)) {
// If data-bounds are provided in the meta-data, we will report those to the
// slice view so that the slice view shows the data bounds to the user when
// setting up slices.
vtkDataObject* localData = this->CacheKeeper->GetOutputDataObject(0);
vtkGSRGeometryFilter::ExtractCachedBounds(localData, this->Internals->OriginalDataBounds);
vtkDataObject *localData = this->CacheKeeper->GetOutputDataObject(0);
vtkGSRGeometryFilter::ExtractCachedBounds(
localData, this->Internals->OriginalDataBounds);
return 1;
}
......@@ -341,47 +319,42 @@ int vtkMySpecialRepresentation::RequestData(
}
//----------------------------------------------------------------------------
bool vtkMySpecialRepresentation::AddToView(vtkView* view)
{
vtkPVOrthographicSliceView* rview = vtkPVOrthographicSliceView::SafeDownCast(view);
if (rview && this->Mode != ALL_SLICES)
{
rview->GetRenderer(this->Mode + vtkPVOrthographicSliceView::SAGITTAL_VIEW_RENDERER)
->AddActor(this->Actor);
}
else if (vtkPVRenderView* rvview = vtkPVRenderView::SafeDownCast(view))
{
bool vtkAlignedGeometrySliceRepresentation::AddToView(vtkView *view) {
vtkPVOrthographicSliceView *rview =
vtkPVOrthographicSliceView::SafeDownCast(view);
if (rview && this->Mode != ALL_SLICES) {
rview
->GetRenderer(this->Mode +
vtkPVOrthographicSliceView::SAGITTAL_VIEW_RENDERER)
->AddActor(this->Actor);
} else if (vtkPVRenderView *rvview = vtkPVRenderView::SafeDownCast(view)) {
rvview->GetRenderer()->AddActor(this->Internals->OutlineActor.GetPointer());
}
else
{
} else {
return false;
}
return this->Superclass::AddToView(view);
}
//----------------------------------------------------------------------------
bool vtkMySpecialRepresentation::RemoveFromView(vtkView* view)
{
vtkPVOrthographicSliceView* rview = vtkPVOrthographicSliceView::SafeDownCast(view);
if (rview && this->Mode != ALL_SLICES)
{
rview->GetRenderer(this->Mode + vtkPVOrthographicSliceView::SAGITTAL_VIEW_RENDERER)
->RemoveActor(this->Actor);
}
else if (vtkPVRenderView* rvview = vtkPVRenderView::SafeDownCast(view))
{
rvview->GetRenderer()->RemoveActor(this->Internals->OutlineActor.GetPointer());
}
else
{
bool vtkAlignedGeometrySliceRepresentation::RemoveFromView(vtkView *view) {
vtkPVOrthographicSliceView *rview =
vtkPVOrthographicSliceView::SafeDownCast(view);
if (rview && this->Mode != ALL_SLICES) {
rview
->GetRenderer(this->Mode +
vtkPVOrthographicSliceView::SAGITTAL_VIEW_RENDERER)
->RemoveActor(this->Actor);
} else if (vtkPVRenderView *rvview = vtkPVRenderView::SafeDownCast(view)) {
rvview->GetRenderer()->RemoveActor(
this->Internals->OutlineActor.GetPointer());
} else {
return false;
}
return this->Superclass::RemoveFromView(view);
}
//----------------------------------------------------------------------------
void vtkMySpecialRepresentation::PrintSelf(ostream& os, vtkIndent indent)
{
void vtkAlignedGeometrySliceRepresentation::PrintSelf(ostream &os,
vtkIndent indent) {
this->Superclass::PrintSelf(os, indent);
os << indent << "ShowOutline: " << this->ShowOutline << endl;
}
/*=========================================================================
Program: ParaView
Module: vtkMySpecialRepresentation.h
Module: vtkAlignedGeometrySliceRepresentation.h
Copyright (c) Kitware, Inc.
All rights reserved.
......@@ -13,38 +13,33 @@
=========================================================================*/
/**
* @class vtkMySpecialRepresentation
* @class vtkAlignedGeometrySliceRepresentation
* @brief extends vtkGeometryRepresentation to
* add support for showing just specific slices from the dataset.
*
* vtkMySpecialRepresentation extends vtkGeometryRepresentation to show
* slices from the dataset. This is used for vtkPVMultiSliceView and
* vtkAlignedGeometrySliceRepresentation extends vtkGeometryRepresentation to
* show slices from the dataset. This is used for vtkPVMultiSliceView and
* vtkPVOrthographicSliceView.
*/
*/
#ifndef vtkMySpecialRepresentation_h
#define vtkMySpecialRepresentation_h
#ifndef vtkAlignedGeometrySliceRepresentation_h
#define vtkAlignedGeometrySliceRepresentation_h
#include "vtkGeometryRepresentation.h"
class VTKPVCLIENTSERVERCORERENDERING_EXPORT vtkMySpecialRepresentation
: public vtkGeometryRepresentation
{
class VTKPVCLIENTSERVERCORERENDERING_EXPORT
vtkAlignedGeometrySliceRepresentation : public vtkGeometryRepresentation {
public:
static vtkMySpecialRepresentation* New();
vtkTypeMacro(vtkMySpecialRepresentation, vtkGeometryRepresentation);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
virtual int ProcessViewRequest(vtkInformationRequestKey* request_type, vtkInformation* inInfo,
vtkInformation* outInfo) VTK_OVERRIDE;
enum
{
X_SLICE_ONLY,
Y_SLICE_ONLY,
Z_SLICE_ONLY,
ALL_SLICES
};
static vtkAlignedGeometrySliceRepresentation *New();
vtkTypeMacro(vtkAlignedGeometrySliceRepresentation,
vtkGeometryRepresentation);
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE;
virtual int ProcessViewRequest(vtkInformationRequestKey *request_type,
vtkInformation *inInfo,
vtkInformation *outInfo) VTK_OVERRIDE;
enum { X_SLICE_ONLY, Y_SLICE_ONLY, Z_SLICE_ONLY, ALL_SLICES };
vtkSetClampMacro(Mode, int, X_SLICE_ONLY, ALL_SLICES);
vtkGetMacro(Mode, int);
......@@ -57,22 +52,25 @@ public:
//@}
protected:
vtkMySpecialRepresentation();
~vtkMySpecialRepresentation();
vtkAlignedGeometrySliceRepresentation();
~vtkAlignedGeometrySliceRepresentation();
virtual void SetupDefaults() VTK_OVERRIDE;
virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
vtkInformationVector* outputVector) VTK_OVERRIDE;
virtual int RequestData(vtkInformation *request,
vtkInformationVector **inputVector,
vtkInformationVector *outputVector) VTK_OVERRIDE;
virtual bool AddToView(vtkView* view) VTK_OVERRIDE;
virtual bool RemoveFromView(vtkView* view) VTK_OVERRIDE;
virtual bool AddToView(vtkView *view) VTK_OVERRIDE;
virtual bool RemoveFromView(vtkView *view) VTK_OVERRIDE;
private:
vtkMySpecialRepresentation(const vtkMySpecialRepresentation&) VTK_DELETE_FUNCTION;
void operator=(const vtkMySpecialRepresentation&) VTK_DELETE_FUNCTION;
vtkAlignedGeometrySliceRepresentation(
const vtkAlignedGeometrySliceRepresentation &) VTK_DELETE_FUNCTION;
void
operator=(const vtkAlignedGeometrySliceRepresentation &) VTK_DELETE_FUNCTION;
class vtkInternals;
vtkInternals* Internals;
vtkInternals *Internals;
int Mode;
bool ShowOutline;
};
......
......@@ -94,7 +94,8 @@ void MultiSliceView::setupData() {
// Make sure that origsrc exists
if (this->origSrc) {
pqDataRepresentation *drep = builder->createDataRepresentation(
this->origSrc->getOutputPort(0), this->m_mainView,"CompositeMySpecialRepresentation");
this->origSrc->getOutputPort(0), this->m_mainView,
"CompositeAlignedGeometrySliceRepresentation");
vtkSMPropertyHelper(drep->getProxy(), "Representation").Set("Slices");
if (!this->isPeaksWorkspace(this->origSrc)) {
vtkSMPVRepresentationProxy::SetScalarColoring(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment