/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2004-2012 HUBzero Foundation, LLC * * Author: Leif Delgass */ #include #include #include #include #include #include #include #include #include #include "Box.h" #include "Trace.h" using namespace VtkVis; Box::Box() : Shape() { } Box::~Box() { TRACE("Deleting Box"); } void Box::update() { if (_box == NULL) { _box = vtkSmartPointer::New(); } if (_pdMapper == NULL) { _pdMapper = vtkSmartPointer::New(); _pdMapper->SetResolveCoincidentTopologyToPolygonOffset(); _pdMapper->ScalarVisibilityOff(); } _pdMapper->SetInputConnection(_box->GetOutputPort()); initProp(); getActor()->SetMapper(_pdMapper); _pdMapper->Update(); } void Box::flipNormals(bool state) { if (_box == NULL || _pdMapper == NULL) return; if (state) { vtkSmartPointer filter = vtkSmartPointer::New(); filter->ReverseCellsOn(); filter->ReverseNormalsOn(); filter->SetInputConnection(_box->GetOutputPort()); _pdMapper->SetInputConnection(filter->GetOutputPort()); } else { _pdMapper->SetInputConnection(_box->GetOutputPort()); } }