15 #include <UT/UT_Version.h> 17 #if !defined(SESI_OPENVDB) && !defined(SESI_OPENVDB_PRIM) 19 #include <UT/UT_VDBUtils.h> 23 #ifndef __HDK_UT_VDBUtils__ 24 #define __HDK_UT_VDBUtils__ 45 #include <UT/UT_Assert.h> 46 #include <UT/UT_BoundingBox.h> 47 #include <UT/UT_Matrix4.h> 48 #include <UT/UT_Matrix3.h> 49 #include <UT/UT_Matrix2.h> 50 #include <SYS/SYS_Math.h> 61 using namespace openvdb::tools;
62 using namespace openvdb::points;
83 return UT_VDB_POINTINDEX;
85 return UT_VDB_POINTDATA;
87 return UT_VDB_INVALID;
94 switch(UTvdbGetGridType(grid))
112 case UT_VDB_POINTINDEX:
114 case UT_VDB_POINTDATA:
117 return "invalid type";
123 UTvdbGetGridTupleSize(UT_VDBType type)
139 case UT_VDB_POINTINDEX:
140 case UT_VDB_POINTDATA:
153 return UTvdbGetGridTupleSize(UTvdbGetGridType(grid));
158 template <
typename T>
161 static void plusEqual(T &lhs,
const T &rhs)
165 struct UT_VDBMath<bool>
167 static void plusEqual(
bool &lhs,
const bool &rhs)
174 template <
typename Gr
idType>
177 {
return UTverify_cast<
const GridType *>(grid); }
179 template <
typename Gr
idType>
182 {
return UTverify_cast<
GridType *>(grid); }
184 template <
typename Gr
idType>
187 {
return *UTverify_cast<
const GridType *>(&grid); }
189 template <
typename Gr
idType>
192 {
return *UTverify_cast<
GridType *>(&grid); }
194 template <
typename Gr
idType>
195 inline typename GridType::ConstPtr
197 {
return openvdb::gridConstPtrCast<GridType>(grid); }
199 template <
typename Gr
idType>
200 inline typename GridType::Ptr
202 {
return openvdb::gridPtrCast<GridType>(grid); }
207 namespace UT_VDBUtils {
212 template<
typename Gr
idType,
typename OpType,
typename Gr
idBaseType>
214 callTypedGrid(GridBaseType &grid, OpType& op)
216 op.template operator()<
GridType>(UTvdbGridCast<GridType>(grid));
252 #define UT_VDB_DECL_PROCESS_TYPED_GRID(GRID_BASE_T) \ 253 template<typename OpType> \ 255 UTvdbProcessTypedGrid(UT_VDBType grid_type, GRID_BASE_T grid, OpType& op) \ 257 using namespace openvdb; \ 258 using namespace UT_VDBUtils; \ 261 case UT_VDB_FLOAT: callTypedGrid<FloatGrid>(grid, op); break; \ 262 case UT_VDB_DOUBLE: callTypedGrid<DoubleGrid>(grid, op); break; \ 263 case UT_VDB_INT32: callTypedGrid<Int32Grid>(grid, op); break; \ 264 case UT_VDB_INT64: callTypedGrid<Int64Grid>(grid, op); break; \ 265 case UT_VDB_VEC3F: callTypedGrid<Vec3SGrid>(grid, op); break; \ 266 case UT_VDB_VEC3D: callTypedGrid<Vec3DGrid>(grid, op); break; \ 267 case UT_VDB_VEC3I: callTypedGrid<Vec3IGrid>(grid, op); break; \ 268 default: return false; \ 272 template<typename OpType> \ 274 UTvdbProcessTypedGridTopology(UT_VDBType grid_type, GRID_BASE_T grid, OpType& op) \ 276 using namespace openvdb; \ 277 using namespace UT_VDBUtils; \ 280 case UT_VDB_FLOAT: callTypedGrid<FloatGrid>(grid, op); break; \ 281 case UT_VDB_DOUBLE: callTypedGrid<DoubleGrid>(grid, op); break; \ 282 case UT_VDB_INT32: callTypedGrid<Int32Grid>(grid, op); break; \ 283 case UT_VDB_INT64: callTypedGrid<Int64Grid>(grid, op); break; \ 284 case UT_VDB_VEC3F: callTypedGrid<Vec3SGrid>(grid, op); break; \ 285 case UT_VDB_VEC3D: callTypedGrid<Vec3DGrid>(grid, op); break; \ 286 case UT_VDB_VEC3I: callTypedGrid<Vec3IGrid>(grid, op); break; \ 287 case UT_VDB_BOOL: callTypedGrid<BoolGrid>(grid, op); break; \ 288 default: return false; \ 292 template<typename OpType> \ 294 UTvdbProcessTypedGridVec3(UT_VDBType grid_type, GRID_BASE_T grid, OpType& op) \ 296 using namespace openvdb; \ 297 using namespace UT_VDBUtils; \ 300 case UT_VDB_VEC3F: callTypedGrid<Vec3SGrid>(grid, op); break; \ 301 case UT_VDB_VEC3D: callTypedGrid<Vec3DGrid>(grid, op); break; \ 302 case UT_VDB_VEC3I: callTypedGrid<Vec3IGrid>(grid, op); break; \ 303 default: return false; \ 307 template<typename OpType> \ 309 UTvdbProcessTypedGridScalar(UT_VDBType grid_type, GRID_BASE_T grid, OpType& op) \ 311 using namespace openvdb; \ 312 using namespace UT_VDBUtils; \ 315 case UT_VDB_FLOAT: callTypedGrid<FloatGrid>(grid, op); break; \ 316 case UT_VDB_DOUBLE: callTypedGrid<DoubleGrid>(grid, op); break; \ 317 case UT_VDB_INT32: callTypedGrid<Int32Grid>(grid, op); break; \ 318 case UT_VDB_INT64: callTypedGrid<Int64Grid>(grid, op); break; \ 319 default: return false; \ 323 template<typename OpType> \ 325 UTvdbProcessTypedGridReal(UT_VDBType grid_type, GRID_BASE_T grid, OpType& op) \ 327 using namespace openvdb; \ 328 using namespace UT_VDBUtils; \ 331 case UT_VDB_FLOAT: callTypedGrid<FloatGrid>(grid, op); break; \ 332 case UT_VDB_DOUBLE: callTypedGrid<DoubleGrid>(grid, op); break; \ 333 default: return false; \ 337 template<typename OpType> \ 339 UTvdbProcessTypedGridPoint(UT_VDBType grid_type, GRID_BASE_T grid, OpType& op) \ 341 using namespace openvdb; \ 342 using namespace openvdb::tools; \ 343 using namespace openvdb::points; \ 344 using namespace UT_VDBUtils; \ 347 case UT_VDB_POINTINDEX: callTypedGrid<PointIndexGrid>(grid, op); break; \ 348 case UT_VDB_POINTDATA: callTypedGrid<PointDataGrid>(grid, op); break; \ 349 default: return false; \ 355 UT_VDB_DECL_PROCESS_TYPED_GRID(const
openvdb::GridBase *)
356 UT_VDB_DECL_PROCESS_TYPED_GRID(
openvdb::GridBase::ConstPtr)
357 UT_VDB_DECL_PROCESS_TYPED_GRID(
openvdb::GridBase &)
358 UT_VDB_DECL_PROCESS_TYPED_GRID(
openvdb::GridBase *)
359 UT_VDB_DECL_PROCESS_TYPED_GRID(
openvdb::GridBase::Ptr)
365 #define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE, ...) \ 367 RETURN FNAME <GRIDT> (UTvdbGridCast<GRIDT>(GRIDBASE), __VA_ARGS__ ); \ 385 #define UTvdbCallRealType(TYPE, FNAME, GRIDBASE, ...) \ 386 if (TYPE == UT_VDB_FLOAT) \ 387 UT_VDB_CALL(openvdb::FloatGrid,(void),FNAME,GRIDBASE,__VA_ARGS__) \ 388 else if (TYPE == UT_VDB_DOUBLE) \ 389 UT_VDB_CALL(openvdb::DoubleGrid,(void),FNAME,GRIDBASE,__VA_ARGS__) \ 391 #define UTvdbCallScalarType(TYPE, FNAME, GRIDBASE, ...) \ 392 UTvdbCallRealType(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \ 393 else if (TYPE == UT_VDB_INT32) \ 394 UT_VDB_CALL(openvdb::Int32Grid,(void),FNAME,GRIDBASE,__VA_ARGS__) \ 395 else if (TYPE == UT_VDB_INT64) \ 396 UT_VDB_CALL(openvdb::Int64Grid,(void),FNAME,GRIDBASE,__VA_ARGS__) \ 398 #define UTvdbCallVec3Type(TYPE, FNAME, GRIDBASE, ...) \ 399 if (TYPE == UT_VDB_VEC3F) \ 400 UT_VDB_CALL(openvdb::Vec3fGrid,(void),FNAME,GRIDBASE,__VA_ARGS__) \ 401 else if (TYPE == UT_VDB_VEC3D) \ 402 UT_VDB_CALL(openvdb::Vec3dGrid,(void),FNAME,GRIDBASE,__VA_ARGS__) \ 403 else if (TYPE == UT_VDB_VEC3I) \ 404 UT_VDB_CALL(openvdb::Vec3IGrid,(void),FNAME,GRIDBASE,__VA_ARGS__) \ 406 #define UTvdbCallPointType(TYPE, FNAME, GRIDBASE, ...) \ 407 if (TYPE == UT_VDB_POINTINDEX) \ 408 UT_VDB_CALL(openvdb::tools::PointIndexGrid,(void),FNAME,GRIDBASE,__VA_ARGS__) \ 409 else if (TYPE == UT_VDB_POINTDATA) \ 410 UT_VDB_CALL(openvdb::points::PointDataGrid,(void),FNAME,GRIDBASE,__VA_ARGS__) \ 412 #define UTvdbCallBoolType(TYPE, FNAME, GRIDBASE, ...) \ 413 if (TYPE == UT_VDB_BOOL) \ 414 UT_VDB_CALL(openvdb::BoolGrid,(void),FNAME,GRIDBASE,__VA_ARGS__) \ 416 #define UTvdbCallAllType(TYPE, FNAME, GRIDBASE, ...) \ 417 UTvdbCallScalarType(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \ 418 else UTvdbCallVec3Type(TYPE, FNAME, GRIDBASE, __VA_ARGS__); \ 420 #define UTvdbCallAllTopology(TYPE, FNAME, GRIDBASE, ...) \ 421 UTvdbCallScalarType(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \ 422 else UTvdbCallVec3Type(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \ 423 else UTvdbCallBoolType(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \ 445 #define UTvdbReturnRealType(TYPE, FNAME, GRIDBASE, ...) \ 446 if (TYPE == UT_VDB_FLOAT) \ 447 UT_VDB_CALL(openvdb::FloatGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \ 448 else if (TYPE == UT_VDB_DOUBLE) \ 449 UT_VDB_CALL(openvdb::DoubleGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \ 451 #define UTvdbReturnScalarType(TYPE, FNAME, GRIDBASE, ...) \ 452 UTvdbReturnRealType(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \ 453 else if (TYPE == UT_VDB_INT32) \ 454 UT_VDB_CALL(openvdb::Int32Grid,return,FNAME,GRIDBASE,__VA_ARGS__) \ 455 else if (TYPE == UT_VDB_INT64) \ 456 UT_VDB_CALL(openvdb::Int64Grid,return,FNAME,GRIDBASE,__VA_ARGS__) \ 458 #define UTvdbReturnVec3Type(TYPE, FNAME, GRIDBASE, ...) \ 459 if (TYPE == UT_VDB_VEC3F) \ 460 UT_VDB_CALL(openvdb::Vec3fGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \ 461 else if (TYPE == UT_VDB_VEC3D) \ 462 UT_VDB_CALL(openvdb::Vec3dGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \ 463 else if (TYPE == UT_VDB_VEC3I) \ 464 UT_VDB_CALL(openvdb::Vec3IGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \ 466 #define UTvdbReturnPointType(TYPE, FNAME, GRIDBASE, ...) \ 467 if (TYPE == UT_VDB_POINTINDEX) \ 468 UT_VDB_CALL(openvdb::tools::PointIndexGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \ 469 else if (TYPE == UT_VDB_POINTDATA) \ 470 UT_VDB_CALL(openvdb::points::PointDataGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \ 472 #define UTvdbReturnBoolType(TYPE, FNAME, GRIDBASE, ...) \ 473 if (TYPE == UT_VDB_BOOL) \ 474 UT_VDB_CALL(openvdb::BoolGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \ 476 #define UTvdbReturnAllType(TYPE, FNAME, GRIDBASE, ...) \ 477 UTvdbReturnScalarType(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \ 478 else UTvdbReturnVec3Type(TYPE, FNAME, GRIDBASE, __VA_ARGS__); \ 480 #define UTvdbReturnAllTopology(TYPE, FNAME, GRIDBASE, ...) \ 481 UTvdbReturnScalarType(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \ 482 else UTvdbReturnVec3Type(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \ 483 else UTvdbReturnBoolType(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \ 493 template <
typename S>
495 UTvdbConvert(
const openvdb::math::Mat4<S> &src)
497 return UT_Matrix4T<S>(src(0,0), src(0,1), src(0,2), src(0,3),
498 src(1,0), src(1,1), src(1,2), src(1,3),
499 src(2,0), src(2,1), src(2,2), src(2,3),
500 src(3,0), src(3,1), src(3,2), src(3,3));
503 template <
typename S>
505 UTvdbConvert(
const openvdb::math::Mat3<S> &src)
507 return UT_Matrix3T<S>(src(0,0), src(0,1), src(0,2),
508 src(1,0), src(1,1), src(1,2),
509 src(2,0), src(2,1), src(2,2));
512 template <
typename S>
514 UTvdbConvert(
const openvdb::math::Mat2<S> &src)
516 return UT_Matrix2T<S>(src(0,0), src(0,1),
523 template <
typename S>
524 openvdb::math::Mat4<S>
525 UTvdbConvert(
const UT_Matrix4T<S> &src)
527 return openvdb::math::Mat4<S>(src(0,0), src(0,1), src(0,2), src(0,3),
528 src(1,0), src(1,1), src(1,2), src(1,3),
529 src(2,0), src(2,1), src(2,2), src(2,3),
530 src(3,0), src(3,1), src(3,2), src(3,3));
532 template <
typename S>
533 openvdb::math::Mat3<S>
534 UTvdbConvert(
const UT_Matrix3T<S> &src)
536 return openvdb::math::Mat3<S>(src(0,0), src(0,1), src(0,2),
537 src(1,0), src(1,1), src(1,2),
538 src(2,0), src(2,1), src(2,2));
540 template <
typename S>
541 openvdb::math::Mat2<S>
542 UTvdbConvert(
const UT_Matrix2T<S> &src)
544 return openvdb::math::Mat2<S>(src(0,0), src(0,1),
551 template <
typename S>
553 UTvdbConvert(
const openvdb::math::Vec4<S> &src)
555 return UT_Vector4T<S>(src.asPointer());
557 template <
typename S>
559 UTvdbConvert(
const openvdb::math::Vec3<S> &src)
561 return UT_Vector3T<S>(src.asPointer());
563 template <
typename S>
565 UTvdbConvert(
const openvdb::math::Vec2<S> &src)
567 return UT_Vector2T<S>(src.asPointer());
573 template <
typename S>
574 openvdb::math::Vec4<S>
575 UTvdbConvert(
const UT_Vector4T<S> &src)
577 return openvdb::math::Vec4<S>(src.data());
579 template <
typename S>
580 openvdb::math::Vec3<S>
581 UTvdbConvert(
const UT_Vector3T<S> &src)
583 return openvdb::math::Vec3<S>(src.data());
585 template <
typename S>
586 openvdb::math::Vec2<S>
587 UTvdbConvert(
const UT_Vector2T<S> &src)
589 return openvdb::math::Vec2<S>(src.data());
595 inline UT_BoundingBoxD
598 return UT_BoundingBoxD(UTvdbConvert(bbox.getStart().asVec3d()),
599 UTvdbConvert(bbox.getEnd().asVec3d()));
604 UTvdbConvert(
const UT_BoundingBoxI &bbox)
607 openvdb::math::Coord(bbox.xmin(), bbox.ymin(), bbox.zmin()),
608 openvdb::math::Coord(bbox.xmax(), bbox.ymax(), bbox.zmax()));
613 inline openvdb::math::Transform::Ptr
614 UTvdbCreateTransform(
const UT_Vector3 &orig,
const UT_Vector3 &voxsize)
617 UT_ASSERT(SYSalmostEqual(voxsize.minComponent(), voxsize.maxComponent()));
618 fpreal vs = voxsize.maxComponent();
619 openvdb::math::Transform::Ptr xform =
620 openvdb::math::Transform::createLinearTransform(vs);
622 xform->postTranslate(UTvdbConvert(orig) + vs / 2);
626 template <
typename T>
627 inline openvdb::math::Vec4<T> SYSabs(
const openvdb::math::Vec4<T> &v1)
628 {
return openvdb::math::Vec4<T>( SYSabs(v1[0]),
634 template <
typename T>
635 inline openvdb::math::Vec3<T> SYSabs(
const openvdb::math::Vec3<T> &v1)
636 {
return openvdb::math::Vec3<T>( SYSabs(v1[0]),
641 template <
typename T>
642 inline openvdb::math::Vec2<T> SYSabs(
const openvdb::math::Vec2<T> &v1)
643 {
return openvdb::math::Vec2<T>( SYSabs(v1[0]),
648 template <
typename T>
649 inline openvdb::math::Vec4<T> SYSmin(
const openvdb::math::Vec4<T> &v1,
const openvdb::math::Vec4<T> &v2)
650 {
return openvdb::math::Vec4<T>( SYSmin(v1[0], v2[0]),
651 SYSmin(v1[1], v2[1]),
652 SYSmin(v1[2], v2[2]),
656 template <
typename T>
657 inline openvdb::math::Vec4<T> SYSmax(
const openvdb::math::Vec4<T> &v1,
const openvdb::math::Vec4<T> &v2)
658 {
return openvdb::math::Vec4<T>( SYSmax(v1[0], v2[0]),
659 SYSmax(v1[1], v2[1]),
660 SYSmax(v1[2], v2[2]),
664 template <
typename T>
665 inline openvdb::math::Vec4<T> SYSmin(
const openvdb::math::Vec4<T> &v1,
const openvdb::math::Vec4<T> &v2,
const openvdb::math::Vec4<T> &v3)
666 {
return openvdb::math::Vec4<T>( SYSmin(v1[0], v2[0], v3[0]),
667 SYSmin(v1[1], v2[1], v3[1]),
668 SYSmin(v1[2], v2[2], v3[2]),
669 SYSmin(v1[3], v2[3], v3[3])
672 template <
typename T>
673 inline openvdb::math::Vec4<T> SYSmax(
const openvdb::math::Vec4<T> &v1,
const openvdb::math::Vec4<T> &v2,
const openvdb::math::Vec4<T> &v3)
674 {
return openvdb::math::Vec4<T>( SYSmax(v1[0], v2[0], v3[0]),
675 SYSmax(v1[1], v2[1], v3[1]),
676 SYSmax(v1[2], v2[2], v3[2]),
677 SYSmax(v1[3], v2[3], v3[3])
680 template <
typename T>
681 inline openvdb::math::Vec3<T> SYSmin(
const openvdb::math::Vec3<T> &v1,
const openvdb::math::Vec3<T> &v2)
682 {
return openvdb::math::Vec3<T>( SYSmin(v1[0], v2[0]),
683 SYSmin(v1[1], v2[1]),
687 template <
typename T>
688 inline openvdb::math::Vec3<T> SYSmax(
const openvdb::math::Vec3<T> &v1,
const openvdb::math::Vec3<T> &v2)
689 {
return openvdb::math::Vec3<T>( SYSmax(v1[0], v2[0]),
690 SYSmax(v1[1], v2[1]),
694 template <
typename T>
695 inline openvdb::math::Vec3<T> SYSmin(
const openvdb::math::Vec3<T> &v1,
const openvdb::math::Vec3<T> &v2,
const openvdb::math::Vec3<T> &v3)
696 {
return openvdb::math::Vec3<T>( SYSmin(v1[0], v2[0], v3[0]),
697 SYSmin(v1[1], v2[1], v3[1]),
698 SYSmin(v1[2], v2[2], v3[2])
701 template <
typename T>
702 inline openvdb::math::Vec3<T> SYSmax(
const openvdb::math::Vec3<T> &v1,
const openvdb::math::Vec3<T> &v2,
const openvdb::math::Vec3<T> &v3)
703 {
return openvdb::math::Vec3<T>( SYSmax(v1[0], v2[0], v3[0]),
704 SYSmax(v1[1], v2[1], v3[1]),
705 SYSmax(v1[2], v2[2], v3[2])
708 template <
typename T>
709 inline openvdb::math::Vec2<T> SYSmin(
const openvdb::math::Vec2<T> &v1,
const openvdb::math::Vec2<T> &v2)
710 {
return openvdb::math::Vec2<T>( SYSmin(v1[0], v2[0]),
714 template <
typename T>
715 inline openvdb::math::Vec2<T> SYSmax(
const openvdb::math::Vec2<T> &v1,
const openvdb::math::Vec2<T> &v2)
716 {
return openvdb::math::Vec2<T>( SYSmax(v1[0], v2[0]),
720 template <
typename T>
721 inline openvdb::math::Vec2<T> SYSmin(
const openvdb::math::Vec2<T> &v1,
const openvdb::math::Vec2<T> &v2,
const openvdb::math::Vec2<T> &v3)
722 {
return openvdb::math::Vec2<T>( SYSmin(v1[0], v2[0], v3[0]),
723 SYSmin(v1[1], v2[1], v3[1])
726 template <
typename T>
727 inline openvdb::math::Vec2<T> SYSmax(
const openvdb::math::Vec2<T> &v1,
const openvdb::math::Vec2<T> &v2,
const openvdb::math::Vec2<T> &v3)
728 {
return openvdb::math::Vec2<T>( SYSmax(v1[0], v2[0], v3[0]),
729 SYSmax(v1[1], v2[1], v3[1])
733 #endif // __HDK_UT_VDBUtils__ 735 #endif // SESI_OPENVDB || SESI_OPENVDB_PRIM SharedPtr< const GridBase > ConstPtr
Definition: Grid.h:81
Grid< PointDataTree > PointDataGrid
Point data grid.
Definition: PointDataGrid.h:194
Grid< BoolTree > BoolGrid
Common grid types.
Definition: openvdb.h:42
Space-partitioning acceleration structure for points. Partitions the points into voxels to accelerate...
Abstract base class for typed grids.
Definition: Grid.h:77
SharedPtr< GridBase > Ptr
Definition: Grid.h:80
Vec3DGrid Vec3dGrid
Definition: openvdb.h:53
Vec3SGrid Vec3fGrid
Definition: openvdb.h:54
OPENVDB_IMPORT void initialize()
Global registration of basic types.
Grid< Vec3ITree > Vec3IGrid
Definition: openvdb.h:49
BBox< Coord > CoordBBox
Definition: NanoVDB.h:1658
Grid< Int64Tree > Int64Grid
Definition: openvdb.h:46
Grid< Int32Tree > Int32Grid
Definition: openvdb.h:45
Definition: Exceptions.h:13
Container class that associates a tree with a transform and metadata.
Definition: Grid.h:28
GridType
List of types that are currently supported by NanoVDB.
Definition: NanoVDB.h:216
Grid< DoubleTree > DoubleGrid
Definition: openvdb.h:43
Attribute-owned data structure for points. Point attributes are stored in leaf nodes and ordered by v...
bool isType() const
Return true if this grid is of the same type as the template parameter.
Definition: Grid.h:148