Field3D
FieldMapping.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------//
2 
3 /*
4  * Copyright (c) 2009 Sony Pictures Imageworks Inc
5  *
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the
17  * distribution. Neither the name of Sony Pictures Imageworks nor the
18  * names of its contributors may be used to endorse or promote
19  * products derived from this software without specific prior written
20  * permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
33  * OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 //----------------------------------------------------------------------------//
37 
44 //----------------------------------------------------------------------------//
45 
46 #ifndef _INCLUDED_Field3D_FieldMapping_H_
47 #define _INCLUDED_Field3D_FieldMapping_H_
48 
49 #include <vector>
50 #include <algorithm>
51 
52 #include "Curve.h"
53 #include "Exception.h"
54 #include "RefCount.h"
55 #include "Types.h"
56 
57 //----------------------------------------------------------------------------//
58 
59 #include "ns.h"
60 
62 
63 //----------------------------------------------------------------------------//
64 // FieldMapping
65 //----------------------------------------------------------------------------//
66 
84 //----------------------------------------------------------------------------//
85 
87 {
88  public:
89 
90  // Typedefs ------------------------------------------------------------------
91 
92  typedef boost::intrusive_ptr<FieldMapping> Ptr;
93 
94  // RTTI replacement ----------------------------------------------------------
95 
98 
99  static const char* staticClassType()
100  {
101  return "FieldMapping";
102  }
103 
104  // Ctors, dtor ---------------------------------------------------------------
105 
108 
110  FieldMapping();
112  FieldMapping(const Box3i &extents);
114  virtual ~FieldMapping();
115 
117 
118  // Main methods --------------------------------------------------------------
119 
125  void setExtents(const Box3i &extents);
126 
128  const V3d& origin() const
129  { return m_origin; }
131  const V3d& resolution() const
132  { return m_res; }
133 
134  // To be implemented by subclasses -------------------------------------------
135 
138 
141  virtual Ptr clone() const = 0;
142 
144  virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const = 0;
145  virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float time) const = 0;
147  virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const = 0;
148  virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float time) const = 0;
150  virtual void worldToLocal(const V3d &wsP, V3d &lsP) const = 0;
151  virtual void worldToLocal(const V3d &wsP, V3d &lsP, float time) const = 0;
153  virtual void localToWorld(const V3d &lsP, V3d &wsP) const = 0;
154  virtual void localToWorld(const V3d &lsP, V3d &wsP, float time) const = 0;
155 
157  virtual V3d wsVoxelSize(int i, int j, int k) const = 0;
158 
161  virtual void extentsChanged()
162  { /* Empty */ }
163 
165  virtual std::string className() const = 0;
166 
168  virtual bool isIdentical(FieldMapping::Ptr other,
169  double tolerance = 0.0) const = 0;
170 
172 
173  // Transform calls -----------------------------------------------------------
174 
177 
180  void localToVoxel(const V3d &lsP, V3d &vsP) const;
182  void voxelToLocal(const V3d &vsP, V3d &lsP) const;
183 
185 
186 protected:
187 
194 
195 private:
196 
197  // Typedefs ------------------------------------------------------------------
198 
200  typedef RefBase base;
201 
202 };
203 
204 //----------------------------------------------------------------------------//
205 // Utilities
206 //----------------------------------------------------------------------------//
207 
211 void worldToVoxel(const Field3D::FieldMapping* mapping,
212  const Box3d &wsBounds,
213  Box3d &vsBounds);
214 
215 //----------------------------------------------------------------------------//
216 // NullFieldMapping
217 //----------------------------------------------------------------------------//
218 
227 //----------------------------------------------------------------------------//
228 
230 {
231 public:
232 
233  // Typedefs ------------------------------------------------------------------
234 
236  typedef boost::intrusive_ptr<NullFieldMapping> Ptr;
237 
238  // RTTI replacement ----------------------------------------------------------
239 
242 
243  static const char* staticClassType()
244  {
245  return "NullFieldMapping";
246  }
247 
248  // Ctors, dtor ---------------------------------------------------------------
249 
252 
254  : FieldMapping()
255  { /* Empty */ }
256  NullFieldMapping(const Box3i &extents)
257  : FieldMapping(extents)
258  { /* Empty */ }
259 
261 
262  // From FieldMapping ---------------------------------------------------------
263 
266 
267  virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const
268  { localToVoxel(wsP, vsP); }
269  virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float /*time*/) const
270  { localToVoxel(wsP, vsP); }
271 
272  virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const
273  { voxelToLocal(vsP, wsP); }
274  virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float /*time*/) const
275  { voxelToLocal(vsP, wsP); }
276 
277  virtual void worldToLocal(const V3d &wsP, V3d &lsP) const
278  { lsP = wsP; }
279  virtual void worldToLocal(const V3d &wsP, V3d &lsP, float /*time*/) const
280  { lsP = wsP; }
281 
282  virtual void localToWorld(const V3d &lsP, V3d &wsP) const
283  { wsP = lsP; }
284  virtual void localToWorld(const V3d &lsP, V3d &wsP, float /*time*/) const
285  { wsP = lsP; }
286 
287  virtual std::string className() const;
288 
289  virtual bool isIdentical(FieldMapping::Ptr other,
290  double tolerance = 0.0) const;
291 
292  virtual V3d wsVoxelSize(int /*i*/, int /*j*/, int /*k*/) const
293  { return V3d(1.0 / m_res.x, 1.0 / m_res.y, 1.0 / m_res.z); }
294 
295  virtual FieldMapping::Ptr clone() const;
296 
298 
299 private:
300 
301  // Typedefs ------------------------------------------------------------------
302 
304  typedef FieldMapping base;
305 
306 };
307 
308 //----------------------------------------------------------------------------//
309 // MatrixFieldMapping
310 //----------------------------------------------------------------------------//
311 
325 //----------------------------------------------------------------------------//
326 
328 {
329 public:
330 
331  // Typedefs ------------------------------------------------------------------
332 
334  typedef boost::intrusive_ptr<MatrixFieldMapping> Ptr;
337 
338  // RTTI replacement ----------------------------------------------------------
339 
342 
343  static const char* staticClassType()
344  {
345  return "MatrixFieldMapping";
346  }
347 
348  // Ctors, dtor ---------------------------------------------------------------
349 
352 
354  MatrixFieldMapping(const Box3i &extents);
355 
357 
358  // Main methods --------------------------------------------------------------
359 
363  void setLocalToWorld(const M44d &lsToWs);
365  void setLocalToWorld(float t, const M44d &lsToWs);
366 
369  const M44d& localToWorld() const
370  { return m_lsToWs; }
371 
374  const M44d& worldToVoxel() const
375  { return m_wsToVs; }
376 
379  const M44d& voxelToWorld() const
380  { return m_vsToWs; }
381 
384  { return m_lsToWsCurve.samples(); }
385 
388  void makeIdentity();
389 
390  // From FieldMapping ---------------------------------------------------------
391 
394 
395  virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const
396  { m_wsToVs.multVecMatrix(wsP, vsP); }
397  virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float time) const
398  {
399  if (!m_isTimeVarying) {
400  m_wsToVs.multVecMatrix(wsP, vsP);
401  } else {
402  M44d wsToVs = m_vsToWsCurve.linear(time).inverse();
403  wsToVs.multVecMatrix(wsP, vsP);
404  }
405  }
406 
407  virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const
408  { m_vsToWs.multVecMatrix(vsP, wsP); }
409  virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float time) const
410  {
411  if (!m_isTimeVarying) {
412  m_vsToWs.multVecMatrix(vsP, wsP);
413  } else {
414  M44d vsToWs = m_vsToWsCurve.linear(time);
415  vsToWs.multVecMatrix(vsP, wsP);
416  }
417  }
418 
419  virtual void worldToLocal(const V3d &wsP, V3d &lsP) const
420  { m_wsToLs.multVecMatrix(wsP, lsP); }
421  virtual void worldToLocal(const V3d &wsP, V3d &lsP,
422  float time) const
423  {
424  if (!m_isTimeVarying) {
425  m_wsToLs.multVecMatrix(wsP, lsP);
426  } else {
427  M44d wsToLs = m_lsToWsCurve.linear(time).inverse();
428  wsToLs.multVecMatrix(wsP, lsP);
429  }
430  }
431 
432  virtual void localToWorld(const V3d &lsP, V3d &wsP) const
433  { m_lsToWs.multVecMatrix(lsP, wsP); }
434  virtual void localToWorld(const V3d &lsP, V3d &wsP, float time) const
435  {
436  if (!m_isTimeVarying) {
437  m_lsToWs.multVecMatrix(lsP, wsP);
438  } else {
439  M44d lsToWs = m_lsToWsCurve.linear(time);
440  lsToWs.multVecMatrix(lsP, wsP);
441  }
442  }
443 
445  void worldToVoxelDir(const V3d &wsV, V3d &vsV) const
446  { m_wsToVs.multDirMatrix(wsV, vsV); }
447 
449  void voxelToWorldDir(const V3d &vsV, V3d &wsV) const
450  { m_vsToWs.multDirMatrix(vsV, wsV); }
451 
453  void worldToLocalDir(const V3d &wsV, V3d &lsV) const
454  { m_wsToLs.multDirMatrix(wsV, lsV); }
455 
457  void localToWorldDir(const V3d &lsV, V3d &wsV) const
458  { m_lsToWs.multDirMatrix(lsV, wsV); }
459 
460  virtual void extentsChanged();
461 
462  virtual std::string className() const;
463 
464  virtual bool isIdentical(FieldMapping::Ptr other,
465  double tolerance = 0.0) const;
466 
467  virtual V3d wsVoxelSize(int /*i*/, int /*j*/, int /*k*/) const
468  { return m_wsVoxelSize; }
469 
470  virtual FieldMapping::Ptr clone() const;
471 
473 
474 private:
475 
477  void updateTransform();
478 
480  void getLocalToVoxelMatrix(M44d &result);
481 
482  // Data members -------------------------------------------------------------
483 
496 
498  MatrixCurve m_lsToWsCurve;
500  MatrixCurve m_vsToWsCurve;
501 
505 
509 
510  // Typedefs ------------------------------------------------------------------
511 
513  typedef FieldMapping base;
514 };
515 
516 //----------------------------------------------------------------------------//
517 // FrustumFieldMapping
518 //----------------------------------------------------------------------------//
519 
545 //----------------------------------------------------------------------------//
546 
548 {
549 public:
550 
551  // Typedefs ------------------------------------------------------------------
552 
554  typedef boost::intrusive_ptr<FrustumFieldMapping> Ptr;
559 
560  // Exceptions ----------------------------------------------------------------
561 
563 
564  // Enums ---------------------------------------------------------------------
565 
566 
567  enum ZDistribution {
570  UniformDistribution
571  };
572 
573  // RTTI replacement ----------------------------------------------------------
574 
577 
578  static const char* staticClassType()
579  {
580  return "FrustumFieldMapping";
581  }
582 
583  // Ctors, dtor ---------------------------------------------------------------
584 
587 
589  FrustumFieldMapping(const Box3i &extents);
590 
592 
593  // Main methods --------------------------------------------------------------
594 
601  void setTransforms(const M44d &ssToWs, const M44d &csToWs);
606  void setTransforms(float t, const M44d &ssToWs, const M44d &csToWs);
607 
610  { m_zDistribution = dist; }
613  { return m_zDistribution; }
614 
617  const M44d screenToWorld() const
618  { return m_ssToWsCurve.linear(0.0); }
619 
622  const M44d cameraToWorld() const
623  { return m_csToWsCurve.linear(0.0); }
624 
627  { return m_ssToWsCurve.samples(); }
628 
631  { return m_csToWsCurve.samples(); }
632 
635  { return m_nearCurve.samples(); }
636 
639  { return m_farCurve.samples(); }
640 
642  double nearPlane() const
643  { return m_nearCurve.linear(0.0); }
644 
646  double farPlane() const
647  { return m_farCurve.linear(0.0); }
648 
652  void reset();
653 
654  // From FieldMapping ---------------------------------------------------------
655 
658 
659  virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const;
660  virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float time) const;
661 
662  virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const;
663  virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float time) const;
664 
665  virtual void worldToLocal(const V3d &wsP, V3d &lsP) const;
666  virtual void worldToLocal(const V3d &wsP, V3d &lsP, float time) const;
667 
668  virtual void localToWorld(const V3d &lsP, V3d &wsP) const;
669  virtual void localToWorld(const V3d &lsP, V3d &wsP, float time) const;
670 
671  virtual void extentsChanged();
672 
673  virtual std::string className() const;
674 
675  virtual bool isIdentical(FieldMapping::Ptr other,
676  double tolerance = 0.0) const;
677 
678  virtual V3d wsVoxelSize(int i, int j, int k) const;
679 
680  virtual FieldMapping::Ptr clone() const;
681 
683 
684 private:
685 
687  void computeVoxelSize();
688 
690  void getLocalToVoxelMatrix(M44d &result);
691 
694  void clearCurves();
695 
696  // Data members -------------------------------------------------------------
697 
700 
704  MatrixCurve m_ssToWsCurve;
706  MatrixCurve m_csToWsCurve;
709  MatrixCurve m_lpsToWsCurve;
711  FloatCurve m_nearCurve;
713  FloatCurve m_farCurve;
714 
717  std::vector<V3d> m_wsVoxelSize;
718 
724 
725  // Typedefs ------------------------------------------------------------------
726 
729 
730 };
731 
732 //----------------------------------------------------------------------------//
733 
735 
736 //----------------------------------------------------------------------------//
737 
738 #endif // Include guard
Trivial class, world space is equal to local space, i.e. the field is contained in the unit cube [0...
Definition: FieldMapping.h:229
const MatrixCurve::SampleVec & cameraToWorldSamples() const
Returns a vector of all motion samples for camera to world transform.
Definition: FieldMapping.h:630
#define FIELD3D_NAMESPACE_HEADER_CLOSE
Definition: ns.h:58
const M44d & voxelToWorld() const
Returns a reference to the voxel to world space transform.
Definition: FieldMapping.h:379
Imath::Box3i Box3i
Definition: SpiMathLib.h:77
MatrixFieldMapping class_type
Definition: FieldMapping.h:340
virtual V3d wsVoxelSize(int, int, int) const
Returns world-space size of a voxel at the specified coordinate.
Definition: FieldMapping.h:292
virtual void worldToLocal(const V3d &wsP, V3d &lsP) const
Transform from world space position into local space.
Definition: FieldMapping.h:419
Imath::M44d M44d
Definition: SpiMathLib.h:82
Contains typedefs for the commonly used types in Field3D.
V3d m_origin
The integer voxel-space origin of the underlying Field object. Is equal to field.extents.min.
Definition: FieldMapping.h:190
FloatCurve m_farCurve
Time-varying far plane. Computed from m_lpsToWsCurve.
Definition: FieldMapping.h:713
virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const
Transform from world space position into voxel space.
Definition: FieldMapping.h:267
M44d m_vsToWs
Voxel space to world space.
Definition: FieldMapping.h:492
virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float) const
Definition: FieldMapping.h:269
static const char * staticClassType()
Definition: FieldMapping.h:99
virtual void localToWorld(const V3d &lsP, V3d &wsP) const =0
Transform from local space position into world space.
FieldMapping class_type
Definition: FieldMapping.h:96
MatrixCurve m_vsToWsCurve
Time-varying voxel to world space transform.
Definition: FieldMapping.h:500
const M44d & localToWorld() const
Returns a reference to the local to world transform.
Definition: FieldMapping.h:369
Contains base class for reference counting with Mutex.
virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const
Transform from voxel space position into world space.
Definition: FieldMapping.h:407
virtual void localToWorld(const V3d &lsP, V3d &wsP) const
Transform from local space position into world space.
Definition: FieldMapping.h:432
virtual void extentsChanged()
Implement this if the subclass needs to update itself when the resolution changes.
Definition: FieldMapping.h:161
virtual V3d wsVoxelSize(int, int, int) const
Returns world-space size of a voxel at the specified coordinate.
Definition: FieldMapping.h:467
Base class for mapping between world-, local- and voxel coordinates.
Definition: FieldMapping.h:86
void setZDistribution(ZDistribution dist)
Sets the z slice distribution.
Definition: FieldMapping.h:609
void voxelToLocal(const V3d &vsP, V3d &lsP) const
Inverse of localToVoxel.
virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float time) const
Definition: FieldMapping.h:397
MatrixCurve m_lsToWsCurve
Time-varying local to world space transform.
Definition: FieldMapping.h:498
virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float time) const
Definition: FieldMapping.h:409
void worldToVoxel(const Field3D::FieldMapping *mapping, const Box3d &wsBounds, Box3d &vsBounds)
Computes a voxel space bounds given a bounding box in world space. This is done by transforming each ...
M44d m_lsToWs
Local space to world space.
Definition: FieldMapping.h:486
void worldToVoxelDir(const V3d &wsV, V3d &vsV) const
Definition: FieldMapping.h:445
ZDistribution zDistribution() const
Returns the z slice distribution.
Definition: FieldMapping.h:612
V3d m_res
The integer voxel-space resolution of the underlying Field object. Is equal to field.extents.max - field.extents.min + 1.
Definition: FieldMapping.h:193
const V3d & resolution() const
Returns the resolution.
Definition: FieldMapping.h:131
static const char * staticClassType()
Definition: FieldMapping.h:578
RefBase base
Convenience typedef for referring to base class.
Definition: FieldMapping.h:200
void localToVoxel(const V3d &lsP, V3d &vsP) const
Transform from local space to voxel space. This is just a multiplication by the resolution of the Fie...
double farPlane() const
Returns the far plane.
Definition: FieldMapping.h:646
virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float) const
Definition: FieldMapping.h:274
virtual Ptr clone() const =0
Returns a pointer to a copy of the mapping, pure virtual so ensure derived classes properly implement...
NullFieldMapping class_type
Definition: FieldMapping.h:240
NullFieldMapping(const Box3i &extents)
Definition: FieldMapping.h:256
boost::intrusive_ptr< FieldMapping > Ptr
Definition: FieldMapping.h:92
const FloatCurve::SampleVec & farPlaneSamples() const
Returns a vector of all motion samples for far plane.
Definition: FieldMapping.h:638
virtual void localToWorld(const V3d &lsP, V3d &wsP, float) const
Definition: FieldMapping.h:284
MatrixCurve m_lpsToWsCurve
Time-varying local perspective to world space transform. Computed from m_ssToWsCurve.
Definition: FieldMapping.h:709
virtual V3d wsVoxelSize(int i, int j, int k) const =0
Returns world-space size of a voxel at the specified coordinate.
std::vector< V3d > m_wsVoxelSize
Precomputed world-space voxel size. Calculations may assume orthogonal transformation for efficiency...
Definition: FieldMapping.h:717
virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const =0
Transform from world space position into voxel space.
virtual bool isIdentical(FieldMapping::Ptr other, double tolerance=0.0) const =0
Whether the mapping is identical to another mapping.
Imath::Box3d Box3d
Definition: SpiMathLib.h:79
FieldMapping base
Convenience typedef for referring to base class.
Definition: FieldMapping.h:304
void voxelToWorldDir(const V3d &vsV, V3d &wsV) const
Definition: FieldMapping.h:449
boost::intrusive_ptr< NullFieldMapping > Ptr
Convenience typedef.
Definition: FieldMapping.h:236
virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const
Transform from world space position into voxel space.
Definition: FieldMapping.h:395
bool m_defaultState
Boolean to tell us if the mapping is in its &#39;default&#39; state. This is needed because the class has a d...
Definition: FieldMapping.h:723
Imath::V3d V3d
Definition: SpiMathLib.h:74
MatrixCurve m_ssToWsCurve
Time-varying local perspective to world space transform This is not used in calculations, but rather as the public interface to the class.
Definition: FieldMapping.h:704
void localToWorldDir(const V3d &lsV, V3d &wsV) const
Definition: FieldMapping.h:457
#define FIELD3D_API
Definition: ns.h:77
const MatrixCurve::SampleVec & localToWorldSamples() const
Returns a vector of all motion samples for local to world transform.
Definition: FieldMapping.h:383
Contains the Curve class which is used to interpolate attributes in time.
virtual void worldToLocal(const V3d &wsP, V3d &lsP, float time) const
Definition: FieldMapping.h:421
virtual void worldToLocal(const V3d &wsP, V3d &lsP, float) const
Definition: FieldMapping.h:279
virtual void localToWorld(const V3d &lsP, V3d &wsP) const
Transform from local space position into world space.
Definition: FieldMapping.h:282
virtual void localToWorld(const V3d &lsP, V3d &wsP, float time) const
Definition: FieldMapping.h:434
const M44d screenToWorld() const
Returns a reference to the screen to world space transform.
Definition: FieldMapping.h:617
static const char * staticClassType()
Definition: FieldMapping.h:343
Curve< double > FloatCurve
Time-varying float.
Definition: FieldMapping.h:558
bool isIdentical(typename Field< Data_T >::Ptr a, typename Field< Data_T >::Ptr b)
Checks whether the span and data in two different fields are identical.
Definition: Field.h:1042
#define DECLARE_FIELD3D_GENERIC_EXCEPTION(name, base_class)
Used to declare a generic but named exception.
Definition: Exception.h:107
FloatCurve m_nearCurve
Time-varying near plane. Computed from m_lpsToWsCurve.
Definition: FieldMapping.h:711
DEFINE_FIELD_RTTI_ABSTRACT_CLASS
Definition: FieldMapping.h:97
const M44d & worldToVoxel() const
Returns a reference to the world to voxel space transform.
Definition: FieldMapping.h:374
FrustumFieldMapping class_type
Definition: FieldMapping.h:575
const MatrixCurve::SampleVec & screenToWorldSamples() const
Returns a vector of all motion samples for screen to world transform.
Definition: FieldMapping.h:626
const V3d & origin() const
Returns the origin.
Definition: FieldMapping.h:128
Represents the mapping of a field by a perspective transform.
Definition: FieldMapping.h:547
MatrixCurve m_csToWsCurve
Time-varying camera to world space transform.
Definition: FieldMapping.h:706
Curve< Imath::M44d > MatrixCurve
Time-varying matrix.
Definition: FieldMapping.h:336
bool m_isTimeVarying
Stores whether the curve has more than one time sample.
Definition: FieldMapping.h:504
ZDistribution
Enumerates the Z slice distribution. .f3d files will store values as an int, so be very careful not t...
Definition: FieldMapping.h:568
virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const
Transform from voxel space position into world space.
Definition: FieldMapping.h:272
FieldMapping base
Convenience typedef for referring to base class.
Definition: FieldMapping.h:728
FieldMapping base
Convenience typedef for referring to base class.
Definition: FieldMapping.h:513
void worldToLocalDir(const V3d &wsV, V3d &lsV) const
Definition: FieldMapping.h:453
virtual std::string className() const =0
Returns the FieldMapping type name. Used when writing/reading from disk.
virtual void worldToLocal(const V3d &wsP, V3d &lsP) const =0
Transform from world space position into local space.
std::vector< Sample > SampleVec
Definition: Curve.h:85
ZDistribution m_zDistribution
Slice distribution type.
Definition: FieldMapping.h:699
static const char * staticClassType()
Definition: FieldMapping.h:243
virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const =0
Transform from voxel space position into world space.
V3d m_wsVoxelSize
Precomputed world-space voxel size. Calculations may assume orthogonal transformation for efficiency...
Definition: FieldMapping.h:508
Contains Exception base class.
Represents the mapping of a field by a matrix transform.
Definition: FieldMapping.h:327
double nearPlane() const
Returns the near plane.
Definition: FieldMapping.h:642
boost::intrusive_ptr< MatrixFieldMapping > Ptr
Convenience typedef.
Definition: FieldMapping.h:334
const FloatCurve::SampleVec & nearPlaneSamples() const
Returns a vector of all motion samples for near plane.
Definition: FieldMapping.h:634
M44d m_wsToLs
World space to local space.
Definition: FieldMapping.h:489
boost::intrusive_ptr< FrustumFieldMapping > Ptr
Convenience typedef.
Definition: FieldMapping.h:554
virtual void worldToLocal(const V3d &wsP, V3d &lsP) const
Transform from world space position into local space.
Definition: FieldMapping.h:277
M44d m_wsToVs
World space to voxel space.
Definition: FieldMapping.h:495
const M44d cameraToWorld() const
Returns a reference to the camera to world space transform.
Definition: FieldMapping.h:622
Curve< Imath::M44d > MatrixCurve
Time-varying matrix.
Definition: FieldMapping.h:556