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 
86 class FieldMapping : public RefBase
87 {
88  public:
89 
90  // Typedefs ------------------------------------------------------------------
91 
92  typedef boost::intrusive_ptr<FieldMapping> Ptr;
93 
94  // RTTI replacement ----------------------------------------------------------
95 
98 
99  static const char* classType()
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 // NullFieldMapping
206 //----------------------------------------------------------------------------//
207 
216 //----------------------------------------------------------------------------//
217 
219 {
220 public:
221 
222  // Typedefs ------------------------------------------------------------------
223 
225  typedef boost::intrusive_ptr<NullFieldMapping> Ptr;
226 
227  // RTTI replacement ----------------------------------------------------------
228 
231 
232  static const char* classType()
233  {
234  return "NullFieldMapping";
235  }
236 
237  // Ctors, dtor ---------------------------------------------------------------
238 
241 
243  : FieldMapping()
244  { /* Empty */ }
245  NullFieldMapping(const Box3i &extents)
246  : FieldMapping(extents)
247  { /* Empty */ }
248 
250 
251  // From FieldMapping ---------------------------------------------------------
252 
255 
256  virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const
257  { localToVoxel(wsP, vsP); }
258  virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float /*time*/) const
259  { localToVoxel(wsP, vsP); }
260 
261  virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const
262  { voxelToLocal(vsP, wsP); }
263  virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float /*time*/) const
264  { voxelToLocal(vsP, wsP); }
265 
266  virtual void worldToLocal(const V3d &wsP, V3d &lsP) const
267  { lsP = wsP; }
268  virtual void worldToLocal(const V3d &wsP, V3d &lsP, float /*time*/) const
269  { lsP = wsP; }
270 
271  virtual void localToWorld(const V3d &lsP, V3d &wsP) const
272  { wsP = lsP; }
273  virtual void localToWorld(const V3d &lsP, V3d &wsP, float /*time*/) const
274  { wsP = lsP; }
275 
276  virtual std::string className() const;
277 
278  virtual bool isIdentical(FieldMapping::Ptr other,
279  double tolerance = 0.0) const;
280 
281  virtual V3d wsVoxelSize(int /*i*/, int /*j*/, int /*k*/) const
282  { return V3d(1.0 / m_res.x, 1.0 / m_res.y, 1.0 / m_res.z); }
283 
284  virtual FieldMapping::Ptr clone() const;
285 
287 
288 private:
289 
290  // Typedefs ------------------------------------------------------------------
291 
293  typedef FieldMapping base;
294 
295 };
296 
297 //----------------------------------------------------------------------------//
298 // MatrixFieldMapping
299 //----------------------------------------------------------------------------//
300 
314 //----------------------------------------------------------------------------//
315 
317 {
318 public:
319 
320  // Typedefs ------------------------------------------------------------------
321 
323  typedef boost::intrusive_ptr<MatrixFieldMapping> Ptr;
326 
327  // RTTI replacement ----------------------------------------------------------
328 
331 
332  static const char* classType ()
333  {
334  return "MatrixFieldMapping";
335  }
336 
337  // Ctors, dtor ---------------------------------------------------------------
338 
341 
343  MatrixFieldMapping(const Box3i &extents);
344 
346 
347  // Main methods --------------------------------------------------------------
348 
352  void setLocalToWorld(const M44d &lsToWs);
354  void setLocalToWorld(float t, const M44d &lsToWs);
355 
358  const M44d& localToWorld() const
359  { return m_lsToWs; }
360 
363  const M44d& worldToVoxel() const
364  { return m_wsToVs; }
365 
368  const M44d& voxelToWorld() const
369  { return m_vsToWs; }
370 
373  { return m_lsToWsCurve.samples(); }
374 
377  void makeIdentity();
378 
379  // From FieldMapping ---------------------------------------------------------
380 
383 
384  virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const
385  { m_wsToVs.multVecMatrix(wsP, vsP); }
386  virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float time) const
387  {
388  if (!m_isTimeVarying) {
389  m_wsToVs.multVecMatrix(wsP, vsP);
390  } else {
391  M44d wsToVs = m_vsToWsCurve.linear(time).inverse();
392  wsToVs.multVecMatrix(wsP, vsP);
393  }
394  }
395 
396  virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const
397  { m_vsToWs.multVecMatrix(vsP, wsP); }
398  virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float time) const
399  {
400  if (!m_isTimeVarying) {
401  m_vsToWs.multVecMatrix(vsP, wsP);
402  } else {
403  M44d vsToWs = m_vsToWsCurve.linear(time);
404  vsToWs.multVecMatrix(vsP, wsP);
405  }
406  }
407 
408  virtual void worldToLocal(const V3d &wsP, V3d &lsP) const
409  { m_wsToLs.multVecMatrix(wsP, lsP); }
410  virtual void worldToLocal(const V3d &wsP, V3d &lsP,
411  float time) const
412  {
413  if (!m_isTimeVarying) {
414  m_wsToLs.multVecMatrix(wsP, lsP);
415  } else {
416  M44d wsToLs = m_lsToWsCurve.linear(time).inverse();
417  wsToLs.multVecMatrix(wsP, lsP);
418  }
419  }
420 
421  virtual void localToWorld(const V3d &lsP, V3d &wsP) const
422  { m_lsToWs.multVecMatrix(lsP, wsP); }
423  virtual void localToWorld(const V3d &lsP, V3d &wsP, float time) const
424  {
425  if (!m_isTimeVarying) {
426  m_lsToWs.multVecMatrix(lsP, wsP);
427  } else {
428  M44d lsToWs = m_lsToWsCurve.linear(time);
429  lsToWs.multVecMatrix(lsP, wsP);
430  }
431  }
432 
434  void worldToVoxelDir(const V3d &wsV, V3d &vsV) const
435  { m_wsToVs.multDirMatrix(wsV, vsV); }
436 
438  void voxelToWorldDir(const V3d &vsV, V3d &wsV) const
439  { m_vsToWs.multDirMatrix(vsV, wsV); }
440 
442  void worldToLocalDir(const V3d &wsV, V3d &lsV) const
443  { m_wsToLs.multDirMatrix(wsV, lsV); }
444 
446  void localToWorldDir(const V3d &lsV, V3d &wsV) const
447  { m_lsToWs.multDirMatrix(lsV, wsV); }
448 
449  virtual void extentsChanged();
450 
451  virtual std::string className() const;
452 
453  virtual bool isIdentical(FieldMapping::Ptr other,
454  double tolerance = 0.0) const;
455 
456  virtual V3d wsVoxelSize(int /*i*/, int /*j*/, int /*k*/) const
457  { return m_wsVoxelSize; }
458 
459  virtual FieldMapping::Ptr clone() const;
460 
462 
463 private:
464 
466  void updateTransform();
467 
469  void getLocalToVoxelMatrix(M44d &result);
470 
471  // Data members -------------------------------------------------------------
472 
485 
487  MatrixCurve m_lsToWsCurve;
489  MatrixCurve m_vsToWsCurve;
490 
494 
498 
499  // Typedefs ------------------------------------------------------------------
500 
502  typedef FieldMapping base;
503 };
504 
505 //----------------------------------------------------------------------------//
506 // FrustumFieldMapping
507 //----------------------------------------------------------------------------//
508 
534 //----------------------------------------------------------------------------//
535 
537 {
538 public:
539 
540  // Typedefs ------------------------------------------------------------------
541 
543  typedef boost::intrusive_ptr<FrustumFieldMapping> Ptr;
548 
549  // Exceptions ----------------------------------------------------------------
550 
552 
553  // Enums ---------------------------------------------------------------------
554 
555 
556  enum ZDistribution {
559  UniformDistribution
560  };
561 
562  // RTTI replacement ----------------------------------------------------------
563 
566 
567  static const char* classType ()
568  {
569  return "FrustumFieldMapping";
570  }
571 
572  // Ctors, dtor ---------------------------------------------------------------
573 
576 
578  FrustumFieldMapping(const Box3i &extents);
579 
581 
582  // Main methods --------------------------------------------------------------
583 
590  void setTransforms(const M44d &ssToWs, const M44d &csToWs);
595  void setTransforms(float t, const M44d &ssToWs, const M44d &csToWs);
596 
599  { m_zDistribution = dist; }
602  { return m_zDistribution; }
603 
606  const M44d screenToWorld() const
607  { return m_ssToWsCurve.linear(0.0); }
608 
611  const M44d cameraToWorld() const
612  { return m_csToWsCurve.linear(0.0); }
613 
616  { return m_ssToWsCurve.samples(); }
617 
620  { return m_csToWsCurve.samples(); }
621 
624  { return m_nearCurve.samples(); }
625 
628  { return m_farCurve.samples(); }
629 
631  double nearPlane() const
632  { return m_nearCurve.linear(0.0); }
633 
635  double farPlane() const
636  { return m_farCurve.linear(0.0); }
637 
641  void reset();
642 
643  // From FieldMapping ---------------------------------------------------------
644 
647 
648  virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const;
649  virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float time) const;
650 
651  virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const;
652  virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float time) const;
653 
654  virtual void worldToLocal(const V3d &wsP, V3d &lsP) const;
655  virtual void worldToLocal(const V3d &wsP, V3d &lsP, float time) const;
656 
657  virtual void localToWorld(const V3d &lsP, V3d &wsP) const;
658  virtual void localToWorld(const V3d &lsP, V3d &wsP, float time) const;
659 
660  virtual void extentsChanged();
661 
662  virtual std::string className() const;
663 
664  virtual bool isIdentical(FieldMapping::Ptr other,
665  double tolerance = 0.0) const;
666 
667  virtual V3d wsVoxelSize(int i, int j, int k) const;
668 
669  virtual FieldMapping::Ptr clone() const;
670 
672 
673 private:
674 
676  void computeVoxelSize();
677 
679  void getLocalToVoxelMatrix(M44d &result);
680 
683  void clearCurves();
684 
685  // Data members -------------------------------------------------------------
686 
689 
693  MatrixCurve m_ssToWsCurve;
695  MatrixCurve m_csToWsCurve;
698  MatrixCurve m_lpsToWsCurve;
700  FloatCurve m_nearCurve;
702  FloatCurve m_farCurve;
703 
706  std::vector<V3d> m_wsVoxelSize;
707 
713 
714  // Typedefs ------------------------------------------------------------------
715 
718 
719 };
720 
721 //----------------------------------------------------------------------------//
722 
724 
725 //----------------------------------------------------------------------------//
726 
727 #endif // Include guard
const MatrixCurve::SampleVec & screenToWorldSamples() const
Returns a vector of all motion samples for screen to world transform.
Definition: FieldMapping.h:615
Trivial class, world space is equal to local space, i.e. the field is contained in the unit cube [0...
Definition: FieldMapping.h:218
virtual void worldToLocal(const V3d &wsP, V3d &lsP, float) const
Definition: FieldMapping.h:268
#define FIELD3D_NAMESPACE_HEADER_CLOSE
Definition: ns.h:58
Imath::Box3i Box3i
Definition: SpiMathLib.h:77
ZDistribution zDistribution() const
Returns the z slice distribution.
Definition: FieldMapping.h:601
MatrixFieldMapping class_type
Definition: FieldMapping.h:329
virtual void worldToLocal(const V3d &wsP, V3d &lsP) const
Transform from world space position into local space.
Definition: FieldMapping.h:266
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
virtual V3d wsVoxelSize(int, int, int) const
Returns world-space size of a voxel at the specified coordinate.
Definition: FieldMapping.h:281
FloatCurve m_farCurve
Time-varying far plane. Computed from m_lpsToWsCurve.
Definition: FieldMapping.h:702
virtual void worldToLocal(const V3d &wsP, V3d &lsP) const
Transform from world space position into local space.
Definition: FieldMapping.h:408
M44d m_vsToWs
Voxel space to world space.
Definition: FieldMapping.h:481
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
virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const
Transform from world space position into voxel space.
Definition: FieldMapping.h:384
MatrixCurve m_vsToWsCurve
Time-varying voxel to world space transform.
Definition: FieldMapping.h:489
virtual void worldToLocal(const V3d &wsP, V3d &lsP, float time) const
Definition: FieldMapping.h:410
Contains base class for reference counting with Mutex.
FieldMapping()
Constructor.
virtual void localToWorld(const V3d &lsP, V3d &wsP, float) const
Definition: FieldMapping.h:273
virtual void extentsChanged()
Implement this if the subclass needs to update itself when the resolution changes.
Definition: FieldMapping.h:161
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:598
MatrixCurve m_lsToWsCurve
Time-varying local to world space transform.
Definition: FieldMapping.h:487
double farPlane() const
Returns the far plane.
Definition: FieldMapping.h:635
M44d m_lsToWs
Local space to world space.
Definition: FieldMapping.h:475
double nearPlane() const
Returns the near plane.
Definition: FieldMapping.h:631
const V3d & resolution() const
Returns the resolution.
Definition: FieldMapping.h:131
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
RefBase base
Convenience typedef for referring to base class.
Definition: FieldMapping.h:200
const V3d & origin() const
Returns the origin.
Definition: FieldMapping.h:128
void voxelToWorldDir(const V3d &vsV, V3d &wsV) const
Definition: FieldMapping.h:438
void worldToVoxelDir(const V3d &wsV, V3d &vsV) const
Definition: FieldMapping.h:434
virtual Ptr clone() const =0
Returns a pointer to a copy of the mapping, pure virtual so ensure derived classes properly implement...
void localToWorldDir(const V3d &lsV, V3d &wsV) const
Definition: FieldMapping.h:446
NullFieldMapping class_type
Definition: FieldMapping.h:229
NullFieldMapping(const Box3i &extents)
Definition: FieldMapping.h:245
boost::intrusive_ptr< FieldMapping > Ptr
Definition: FieldMapping.h:92
const M44d cameraToWorld() const
Returns a reference to the camera to world space transform.
Definition: FieldMapping.h:611
static const char * classType()
Definition: FieldMapping.h:332
const FloatCurve::SampleVec & nearPlaneSamples() const
Returns a vector of all motion samples for near plane.
Definition: FieldMapping.h:623
const M44d & voxelToWorld() const
Returns a reference to the voxel to world space transform.
Definition: FieldMapping.h:368
virtual void localToWorld(const V3d &lsP, V3d &wsP, float time) const
Definition: FieldMapping.h:423
MatrixCurve m_lpsToWsCurve
Time-varying local perspective to world space transform. Computed from m_ssToWsCurve.
Definition: FieldMapping.h:698
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:706
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.
const MatrixCurve::SampleVec & cameraToWorldSamples() const
Returns a vector of all motion samples for camera to world transform.
Definition: FieldMapping.h:619
FieldMapping base
Convenience typedef for referring to base class.
Definition: FieldMapping.h:293
virtual V3d wsVoxelSize(int, int, int) const
Returns world-space size of a voxel at the specified coordinate.
Definition: FieldMapping.h:456
virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const
Transform from voxel space position into world space.
Definition: FieldMapping.h:396
boost::intrusive_ptr< NullFieldMapping > Ptr
Convenience typedef.
Definition: FieldMapping.h:225
static const char * classType()
Definition: FieldMapping.h:567
virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float) const
Definition: FieldMapping.h:258
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:712
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:693
static const char * classType()
Definition: FieldMapping.h:99
virtual ~FieldMapping()
Destructor.
virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float) const
Definition: FieldMapping.h:263
virtual void voxelToWorld(const V3d &vsP, V3d &wsP, float time) const
Definition: FieldMapping.h:398
Contains the Curve class which is used to interpolate attributes in time.
virtual void localToWorld(const V3d &lsP, V3d &wsP) const
Transform from local space position into world space.
Definition: FieldMapping.h:271
const MatrixCurve::SampleVec & localToWorldSamples() const
Returns a vector of all motion samples for local to world transform.
Definition: FieldMapping.h:372
Curve< double > FloatCurve
Time-varying float.
Definition: FieldMapping.h:547
const M44d screenToWorld() const
Returns a reference to the screen to world space transform.
Definition: FieldMapping.h:606
#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:700
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...
DEFINE_FIELD_RTTI_ABSTRACT_CLASS
Definition: FieldMapping.h:97
FrustumFieldMapping class_type
Definition: FieldMapping.h:564
Represents the mapping of a field by a perspective transform.
Definition: FieldMapping.h:536
MatrixCurve m_csToWsCurve
Time-varying camera to world space transform.
Definition: FieldMapping.h:695
virtual void localToWorld(const V3d &lsP, V3d &wsP) const
Transform from local space position into world space.
Definition: FieldMapping.h:421
Curve< Imath::M44d > MatrixCurve
Time-varying matrix.
Definition: FieldMapping.h:325
bool m_isTimeVarying
Stores whether the curve has more than one time sample.
Definition: FieldMapping.h:493
ZDistribution
Enumerates the Z slice distribution. .f3d files will store values as an int, so be very careful not t...
Definition: FieldMapping.h:557
FieldMapping base
Convenience typedef for referring to base class.
Definition: FieldMapping.h:717
void worldToLocalDir(const V3d &wsV, V3d &lsV) const
Definition: FieldMapping.h:442
FieldMapping base
Convenience typedef for referring to base class.
Definition: FieldMapping.h:502
virtual void worldToVoxel(const V3d &wsP, V3d &vsP, float time) const
Definition: FieldMapping.h:386
virtual void worldToVoxel(const V3d &wsP, V3d &vsP) const
Transform from world space position into voxel space.
Definition: FieldMapping.h:256
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:688
virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const =0
Transform from voxel space position into world space.
virtual void voxelToWorld(const V3d &vsP, V3d &wsP) const
Transform from voxel space position into world space.
Definition: FieldMapping.h:261
V3d m_wsVoxelSize
Precomputed world-space voxel size. Calculations may assume orthogonal transformation for efficiency...
Definition: FieldMapping.h:497
const M44d & localToWorld() const
Returns a reference to the local to world transform.
Definition: FieldMapping.h:358
Contains Exception base class.
Represents the mapping of a field by a matrix transform.
Definition: FieldMapping.h:316
const M44d & worldToVoxel() const
Returns a reference to the world to voxel space transform.
Definition: FieldMapping.h:363
boost::intrusive_ptr< MatrixFieldMapping > Ptr
Convenience typedef.
Definition: FieldMapping.h:323
void voxelToLocal(const V3d &vsP, V3d &lsP) const
Inverse of localToVoxel.
M44d m_wsToLs
World space to local space.
Definition: FieldMapping.h:478
boost::intrusive_ptr< FrustumFieldMapping > Ptr
Convenience typedef.
Definition: FieldMapping.h:543
M44d m_wsToVs
World space to voxel space.
Definition: FieldMapping.h:484
Curve< Imath::M44d > MatrixCurve
Time-varying matrix.
Definition: FieldMapping.h:545
const FloatCurve::SampleVec & farPlaneSamples() const
Returns a vector of all motion samples for far plane.
Definition: FieldMapping.h:627
void setExtents(const Box3i &extents)
This sets the field extents information to use for defining the local coordinate space.
static const char * classType()
Definition: FieldMapping.h:232