Go to the documentation of this file.
10 #ifndef vtk_m_rendering_raytracing_Ray_h
11 #define vtk_m_rendering_raytracing_Ray_h
21 #define RAY_COMPLETE 1
22 #define RAY_TERMINATED 2
23 #define RAY_EXITED_MESH 3
24 #define RAY_EXITED_DOMAIN 4
26 #define RAY_ABANDONED 6
27 #define RAY_TUG_EPSILON 0.001
36 template <
typename Precision>
97 std::vector<ChannelBuffer<Precision>>
Buffers;
123 template <
typename Device>
127 self->EnableIntersectionData(Device());
134 template <
typename Device>
176 template <
typename Device>
183 this->Buffers.push_back(buffer);
188 this->
Resize(size, Device());
193 template <
typename Device>
197 self->Resize(size, Device());
204 template <
typename Device>
249 const size_t numBuffers = this->Buffers.size();
250 for (
size_t i = 0; i < numBuffers; ++i)
252 this->Buffers[i].Resize(
NumRays, Device());
262 this->Buffers.push_back(buffer);
268 size_t numBuffers = this->Buffers.size();
270 for (
size_t i = 0; i < numBuffers; ++i)
272 if (this->Buffers[i].GetName() == name)
284 const size_t numBuffers = this->Buffers.size();
287 for (
size_t i = 0; i < numBuffers; ++i)
289 if (this->Buffers[i].GetName() == name)
297 return this->Buffers.at(index);
311 std::cout <<
"Ray " << pixelId <<
"\n";
312 std::cout <<
"Origin "
327 #endif //vtk_m_rendering_raytracing_Ray_h
VTKM_CONT bool HasBuffer(const std::string name)
Definition: Ray.h:266
void Resize(const vtkm::Id newSize)
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::cont::ArrayHandle< vtkm::UInt8 > Status
Definition: Ray.h:95
void EnableIntersectionData()
Definition: Ray.h:132
void SetName(const std::string name)
vtkm::cont::ArrayHandle< Precision > U
Definition: Ray.h:81
vtkm::cont::ArrayHandle< Precision > NormalZ
Definition: Ray.h:85
vtkm::Id DebugHeight
Definition: Ray.h:99
vtkm::cont::ArrayHandle< Precision > Scalar
Definition: Ray.h:86
void EnableIntersectionData(Device)
Definition: Ray.h:135
An ArrayHandle that combines components from other arrays.
Definition: ArrayHandleCompositeVector.h:402
vtkm::cont::ArrayHandle< Precision > OriginZ
Definition: Ray.h:75
VTKM_CONT Ray(const vtkm::Int32 size, Device, bool enableIntersectionData=false)
Definition: Ray.h:177
bool IntersectionDataEnabled
Definition: Ray.h:40
std::vector< ChannelBuffer< Precision > > Buffers
Definition: Ray.h:97
vtkm::cont::ArrayHandle< Precision > NormalY
Definition: Ray.h:84
vtkm::cont::ArrayHandle< Precision > IntersectionX
Definition: Ray.h:68
Mananges a buffer that contains many channels per value (e.g., RGBA values).
Definition: ChannelBuffer.h:45
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::cont::ArrayHandle< Precision > V
Definition: Ray.h:82
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
vtkm::cont::ArrayHandle< Precision > MinDistance
Definition: Ray.h:93
VTKM_CONT ArrayHandleCompositeVector< ArrayTs... > make_ArrayHandleCompositeVector(const ArrayTs &... arrays)
Create a composite vector array from other arrays.
Definition: ArrayHandleCompositeVector.h:430
vtkm::Id DebugWidth
Definition: Ray.h:98
vtkm::cont::ArrayHandle< Precision > DirY
Definition: Ray.h:78
vtkm::cont::ArrayHandle< Precision > OriginX
Definition: Ray.h:73
vtkm::cont::ArrayHandle< vtkm::Id > PixelIdx
Definition: Ray.h:91
vtkm::cont::ArrayHandleCompositeVector< vtkm::cont::ArrayHandle< Precision >, vtkm::cont::ArrayHandle< Precision >, vtkm::cont::ArrayHandle< Precision > > Normal
Definition: Ray.h:54
Definition: RayOperations.h:106
#define VTKM_CONT
Definition: ExportMacros.h:57
VTKM_CONT void Resize(const vtkm::Int32 size, Device)
Definition: Ray.h:205
vtkm::cont::ArrayHandle< Precision > OriginY
Definition: Ray.h:74
vtkm::cont::ArrayHandle< vtkm::Id > HitIdx
Definition: Ray.h:90
VTKM_CONT WritePortalType WritePortal() const
Get an array portal that can be used in the control environment.
Definition: ArrayHandle.h:435
vtkm::cont::ArrayHandle< Precision > IntersectionZ
Definition: Ray.h:70
vtkm::cont::ArrayHandleCompositeVector< vtkm::cont::ArrayHandle< Precision >, vtkm::cont::ArrayHandle< Precision >, vtkm::cont::ArrayHandle< Precision > > Intersection
Definition: Ray.h:48
void PrintRay(vtkm::Id pixelId)
Definition: Ray.h:305
VTKM_CONT ChannelBuffer< Precision > & GetBuffer(const std::string name)
Definition: Ray.h:282
VTKM_CONT void Resize(const vtkm::Int32 size)
Definition: Ray.h:202
vtkm::cont::ArrayHandle< Precision > Distance
Definition: Ray.h:88
vtkm::cont::ArrayHandleCompositeVector< vtkm::cont::ArrayHandle< Precision >, vtkm::cont::ArrayHandle< Precision >, vtkm::cont::ArrayHandle< Precision > > Dir
Definition: Ray.h:66
VTKM_CONT bool operator()(Device, Ray< Precision > *self)
Definition: Ray.h:124
vtkm::cont::ArrayHandle< Precision > IntersectionY
Definition: Ray.h:69
void DisableIntersectionData()
Definition: Ray.h:156
vtkm::Id NumRays
Definition: Ray.h:100
vtkm::cont::ArrayHandle< Precision > DirX
Definition: Ray.h:77
This class is thrown when a VTKm function or method encounters an invalid value that inhibits progres...
Definition: ErrorBadValue.h:25
VTKM_CONT WritePortalType PrepareForOutput(vtkm::Id numberOfValues, vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
Prepares (allocates) this array to be used as an output from an operation in the execution environmen...
Definition: ArrayHandle.h:613
int32_t Int32
Definition: Types.h:160
vtkm::cont::ArrayHandle< Precision > DirZ
Definition: Ray.h:79
VTKM_CONT Ray()
Definition: Ray.h:103
VTKM_CONT bool operator()(Device, Ray< Precision > *self, const vtkm::Int32 size)
Definition: Ray.h:194
VTKM_CONT void AddBuffer(const vtkm::Int32 numChannels, const std::string name)
Definition: Ray.h:257
vtkm::cont::ArrayHandleCompositeVector< vtkm::cont::ArrayHandle< Precision >, vtkm::cont::ArrayHandle< Precision >, vtkm::cont::ArrayHandle< Precision > > Origin
Definition: Ray.h:60
vtkm::cont::ArrayHandle< Precision > NormalX
Definition: Ray.h:83
VTKM_CONT void ReleaseResources() const
Releases all resources in both the control and execution environments.
Definition: ArrayHandle.h:559
vtkm::cont::ArrayHandle< Precision > MaxDistance
Definition: Ray.h:94
VTKM_CONT bool TryExecute(Functor &&functor, Args &&... args)
Try to execute a functor on a set of devices until one succeeds.
Definition: TryExecute.h:244
#define VTKM_IS_DEVICE_ADAPTER_TAG(tag)
Checks that the argument is a proper device adapter tag.
Definition: DeviceAdapterTag.h:164