cisst-saw
Loading...
Searching...
No Matches
msh3PDTreeMesh.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3// ****************************************************************************
4//
5// Copyright (c) 2014, Seth Billings, Russell Taylor, Johns Hopkins University
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 are
10// met:
11//
12// 1. Redistributions of source code must retain the above copyright
13// notice, this list of conditions and the following disclaimer.
14//
15// 2. Redistributions in binary form must reproduce the above copyright
16// notice, this list of conditions and the following disclaimer in the
17// documentation and/or other materials provided with the distribution.
18//
19// 3. Neither the name of the copyright holder nor the names of its
20// contributors may be used to endorse or promote products derived from
21// this software without specific prior written permission.
22//
23// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34//
35// ****************************************************************************
36
37#ifndef _msh3PDTreeMesh_h
38#define _msh3PDTreeMesh_h
39
41#include <cisstMesh/msh3Mesh.h>
42#include <limits>
43
44// Always include last!
45#include <cisstMesh/mshExport.h>
46
48{
49 //
50 // This class implements a PD tree for a mesh shape
51 //
52
53 //--- Variables ---//
54
55 public:
56
59
60 //--- Methods ---//
61
62 public:
63
64 // constructor
65 // mesh - target shape from which to construct the tree
66 // (each triangle of the mesh becomes a datum in the tree)
67 // nThresh - min number of datums to subdivide a node
68 // diagThresh - min physical size to subdivide a node
69 msh3PDTreeMesh(msh3Mesh &mesh, int nThresh, double diagThresh);
70
71 // destructor
72 virtual ~msh3PDTreeMesh();
73
74 //--- Base Class Virtual Methods ---//
75 virtual vct3 DatumSortPoint(int datum) const;
76 virtual void EnlargeBounds(const vctFrm3& F) const;
77 virtual void EnlargeBounds(const vctFrm3& F, msh3PDTreeNode *pNode) const;
78 virtual void EnlargeBounds(const vctFrm3& F, int datum, msh3BoundingBox& BB) const;
79
80
81 //--- Noise Model Methods ---//
82
83 inline vct3x3& DatumCov(int datum) // return measurement noise model for this datum
84 {
85 return Mesh->TriangleCov[datum];
86 }
87 inline vct3x3* DatumCovPtr(int datum) // return measurement noise model for this datum
88 {
89 return &(Mesh->TriangleCov[datum]);
90 }
91
92 inline vct3& DatumCovEig(int datum) // return measurement noise model for this datum
93 {
94 return Mesh->TriangleCovEig[datum];
95 }
96 inline vct3* DatumCovEigPtr(int datum) // return measurement noise model for this datum
97 {
98 return &(Mesh->TriangleCovEig[datum]);
99 }
100
101 // Finds the intersected points of a PDTree given a bounding distance
103 const double boundingDistance,
104 std::vector<int> &faceIdx);
105
106};
107
108#endif
Definition msh3Mesh.h:57
vctDynamicVector< vct3x3 > TriangleCov
Definition msh3Mesh.h:79
vctDynamicVector< vct3 > TriangleCovEig
Definition msh3Mesh.h:80
msh3PDTreeBase()
Definition msh3PDTreeBase.h:92
friend class msh3PDTreeNode
Definition msh3PDTreeBase.h:66
vct3 & DatumCovEig(int datum)
Definition msh3PDTreeMesh.h:92
msh3Mesh * Mesh
Definition msh3PDTreeMesh.h:57
vct3x3 * DatumCovPtr(int datum)
Definition msh3PDTreeMesh.h:87
msh3PDTreeMesh(msh3Mesh &mesh, int nThresh, double diagThresh)
vct3x3 & DatumCov(int datum)
Definition msh3PDTreeMesh.h:83
virtual vct3 DatumSortPoint(int datum) const
virtual void EnlargeBounds(const vctFrm3 &F, int datum, msh3BoundingBox &BB) const
int FindIntersectedPoints(const vct3 &v, const double boundingDistance, std::vector< int > &faceIdx)
vct3 * DatumCovEigPtr(int datum)
Definition msh3PDTreeMesh.h:96
msh3BoundingBox Bounds
Definition msh3PDTreeMesh.h:58
virtual ~msh3PDTreeMesh()
virtual void EnlargeBounds(const vctFrm3 &F, msh3PDTreeNode *pNode) const
virtual void EnlargeBounds(const vctFrm3 &F) const
#define CISST_EXPORT
Definition cmnExportMacros.h:50
vctBoundingBox3 msh3BoundingBox
Definition msh3BoundingBox.h:42
Macros to export the symbols of cisstMesh (in a Dll).
vctFixedSizeMatrix< double, 3, 3 > vct3x3
Definition vctFixedSizeMatrixTypes.h:59
vctFixedSizeVector< double, 3 > vct3
Definition vctFixedSizeVectorTypes.h:46
vctFrameBase< vctRot3 > vctFrm3
Definition vctTransformationTypes.h:137