vtkOSPRayVolumeMapperNode.h 2.04 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkOSPRayVolumeMapperNode.h

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
15
// .NAME vtkOSPRayVolumeMapperNode - links vtkVolumeMapper  to OSPRay
16
// .SECTION Description
17
// Translates vtkVolumeMapper state into OSPRay rendering calls
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

#ifndef vtkOSPRayVolumeMapperNode_h
#define vtkOSPRayVolumeMapperNode_h

#include "vtkRenderingOSPRayModule.h" // For export macro
#include "vtkVolumeMapperNode.h"

namespace osp
{
  struct TransferFunction;
  struct Volume;
}

class VTKRENDERINGOSPRAY_EXPORT vtkOSPRayVolumeMapperNode :
  public vtkVolumeMapperNode
{
public:
  static vtkOSPRayVolumeMapperNode* New();
  vtkTypeMacro(vtkOSPRayVolumeMapperNode, vtkVolumeMapperNode);
  void PrintSelf(ostream& os, vtkIndent indent);
38
39

  //Description:
David DeMarle's avatar
David DeMarle committed
40
  //Make ospray calls to render me.
41
  virtual void Render(bool prepass);
David DeMarle's avatar
David DeMarle committed
42
43
44
45
46

  //Description:
  //TODO: fix me
  //should be controlled by VTK SampleDistance, otherwise
  //should use macros and modify self.
47
  void SetSamplingRate(double rate) { this->SamplingRate = rate; }
48
  double GetSamplingRate() { return this->SamplingRate; }
49

50
51
52
53
protected:
  vtkOSPRayVolumeMapperNode();
  ~vtkOSPRayVolumeMapperNode();

54
  //TODO: SetAndGetters?
55
56
  int NumColors;
  double SamplingRate;
57
58
59

  vtkTimeStamp BuildTime;
  vtkTimeStamp PropertyTime;
60
61

  osp::Volume* OSPRayVolume;
62
  osp::TransferFunction* TransferFunction;
63
64
  std::vector<float> TFVals;
  std::vector<float> TFOVals;
65
66

private:
67
68
  vtkOSPRayVolumeMapperNode(const vtkOSPRayVolumeMapperNode&) VTK_DELETE_FUNCTION;
  void operator=(const vtkOSPRayVolumeMapperNode&) VTK_DELETE_FUNCTION;
69
70
};
#endif