/usr/include/InsightToolkit/Review/itkGeometricalQuadEdge.h is in libinsighttoolkit3-dev 3.20.1+git20120521-6build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | /*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: itkGeometricalQuadEdge.h
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __itkGeometricalQuadEdge_h
#define __itkGeometricalQuadEdge_h
#include "itkQuadEdge.h"
namespace itk
{
/** \class GeometricalQuadEdge
* \brief This class extends the QuadEdge by adding a reference to the Origin.
*
* The class is implemented in such a way that it can generate its own Dual.
* In a physical edge, there will be four GeometricalQuadEdge. Two of them will
* be Primal and two will be Dual. The Primal ones are parallel to the physical
* edge and their origins relate to the mesh points. The Dual ones are
* orthogonal to the physical edge and their origins relate to the faces at
* each side of the physical edge.
*
* The only purpose of the last paramater of the template is to guarantee that
* the two types GeometricalQuadEdge<...> and GeometricalQuadEdge<...>::Dual
* are always different (in the sense that their typeid() are different). If
* we only had the four first parameters and assume that
* GeometricalQuadEdge<...> gets instantiated with types such that TVRef =
* TFRef and TPrimalData = TDualData then this instantiation
* GeometricalQuadEdge<...> and GeometricalQuadEdge<...>::Dual would be the
* same types (this is simply due to the very definition of
* GeometricalQuadEdge<...>::Dual). This would in turn make the types QEType
* and QEDual of \ref QuadEdgeMesh identical and would prevent any algorithm
* requiring to distinguish those types (e.g. by relying on a
* dynamic_cast<QEType*>) to be effective. This justifies the existence of
* last dummy template parameter and it's default value.
*
* \author Alexandre Gouaillard, Leonardo Florez-Valencia, Eric Boix
*
* This implementation was contributed as a paper to the Insight Journal
* http://insight-journal.org/midas/handle.php?handle=1926/306
*
* \sa QuadEdge
*
* \ingroup MeshObjects
*/
template< typename TVRef, typename TFRef,
typename TPrimalData, typename TDualData,
bool PrimalDual = true >
class GeometricalQuadEdge : public QuadEdge
{
public:
/** Hierarchy typedefs. */
typedef GeometricalQuadEdge Self;
typedef QuadEdge Superclass;
typedef Self* RawPointer;
/**
* Dual type, basically the same type with swapped template
* parameters.
*
*/
typedef GeometricalQuadEdge< TFRef, TVRef,
TDualData, TPrimalData, !PrimalDual > DualType;
/** Input template parameters & values convenient renaming. */
typedef TVRef OriginRefType;
typedef TFRef DualOriginRefType;
typedef TPrimalData PrimalDataType;
typedef TDualData DualDataType;
// Line Cell Id in Mesh Cell Container
// used to go up to LineCell level
typedef TFRef LineCellIdentifier;
public:
/** Iterator types. */
typedef QuadEdgeMeshIteratorGeom< Self > IteratorGeom;
typedef QuadEdgeMeshConstIteratorGeom< Self > ConstIteratorGeom;
/** Basic iterators methods. */
inline itkQEDefineIteratorGeomMethodsMacro( Onext );
inline itkQEDefineIteratorGeomMethodsMacro( Sym );
inline itkQEDefineIteratorGeomMethodsMacro( Lnext );
inline itkQEDefineIteratorGeomMethodsMacro( Rnext );
inline itkQEDefineIteratorGeomMethodsMacro( Dnext );
inline itkQEDefineIteratorGeomMethodsMacro( Oprev );
inline itkQEDefineIteratorGeomMethodsMacro( Lprev );
inline itkQEDefineIteratorGeomMethodsMacro( Rprev );
inline itkQEDefineIteratorGeomMethodsMacro( Dprev );
inline itkQEDefineIteratorGeomMethodsMacro( InvOnext );
inline itkQEDefineIteratorGeomMethodsMacro( InvLnext );
inline itkQEDefineIteratorGeomMethodsMacro( InvRnext );
inline itkQEDefineIteratorGeomMethodsMacro( InvDnext );
/** QE macros. */
itkQEAccessorsMacro( Superclass, Self, DualType );
public:
/** Memory creation methods. */
GeometricalQuadEdge();
virtual ~GeometricalQuadEdge() {};
/** Set methods. */
inline void SetOrigin( const OriginRefType v )
{ m_Origin = v; }
inline void SetDestination( const OriginRefType v )
{ this->GetSym()->SetOrigin( v ); }
inline void SetRight( const DualOriginRefType v )
{ this->GetRot()->SetOrigin( v ); }
inline void SetLeft( const DualOriginRefType v )
{ this->GetInvRot()->SetOrigin( v ); }
/**
* Set the Left() of all the edges in the Lnext() ring of "this"
* with the same given geometrical information.
* @param faceGeom Looks at most maxSize edges in the Lnext() ring.
* @param maxSize Sets at most maxSize edges in the Lnext() ring.
* @return Returns true on success. False otherwise.
*/
bool SetLnextRingWithSameLeftFace( const DualOriginRefType faceGeom,
int maxSize = 100 );
inline void UnsetOrigin() { m_Origin = m_NoPoint; }
inline void UnsetDestination() { this->GetSym()->UnsetOrigin(); }
inline void UnsetRight() { this->GetRot()->UnsetOrigin(); }
inline void UnsetLeft() { this->GetInvRot()->UnsetOrigin(); }
/** Get methods. */
//ORIENTATION_NOTE: this definition of GetLeft (or GetRight)
// implicitely assumes that the Onext order is counter-clockwise !
inline const OriginRefType GetOrigin() const { return( m_Origin ); }
inline const OriginRefType GetDestination() const { return( GetSym()->GetOrigin() ); }
inline const DualOriginRefType GetRight() const { return( GetRot()->GetOrigin() ); }
inline const DualOriginRefType GetLeft() const { return( GetInvRot()->GetOrigin() ); }
/** Boolean accessors. */
bool IsOriginSet() const;
bool IsDestinationSet() const;
bool IsRightSet() const;
bool IsLeftSet() const;
/** Extra data set methods. */
inline void SetPrimalData( const PrimalDataType data )
{ m_Data = data; this->SetPrimalData(); }
inline void SetDualData( const DualDataType data )
{ this->GetRot()->SetPrimalData( data ); }
inline void SetPrimalData() { m_DataSet = true; }
inline void SetDualData() { this->GetRot()->SetPrimalData(); }
inline void UnsetPrimalData() { m_Data = false; }
inline void UnsetDualData() { this->GetRot()->UnsetPrimalData(); }
/** Extra data get methods. */
inline PrimalDataType GetPrimalData() { return( m_Data ); }
inline DualDataType GetDualData()
{ return( this->GetRot()->GetPrimalData() ); }
/** Boolean accessors. */
inline bool IsPrimalDataSet() { return( m_DataSet ); }
inline bool IsDualDataSet()
{ return( this->GetRot()->IsPrimalDataSet() ); }
/**
* @return Returns true when "this" has no faces set on both sides.
* Return false otherwise.
*/
inline bool IsWire()
{ return( !( this->IsLeftSet() ) && !( this->IsRightSet() ) ); }
/**
* @return Returns true when "this" is on the boundary i.e.
* one and only one of the faces is set. Return false
* otherwise.
*/
inline bool IsAtBorder()
{
return( ( this->IsLeftSet() && !this->IsRightSet() ) ||
( !this->IsLeftSet() && this->IsRightSet() ) );
}
/**
* @return Returns true when "this" has faces set on both sides.
* Return false otherwise.
*/
inline bool IsInternal() const
{ return( this->IsLeftSet() && this->IsRightSet() ); }
bool IsOriginInternal() const;
bool IsLnextSharingSameFace( int maxSize = 100 );
bool IsLnextOfTriangle();
bool IsInOnextRing( Self* );
bool IsInLnextRing( Self* );
Self* GetNextBorderEdgeWithUnsetLeft( Self* edgeTest = 0 );
bool InsertAfterNextBorderEdgeWithUnsetLeft( Self* isol,
Self* hint = 0 );
bool ReorderOnextRingBeforeAddFace( Self* second );
/** Disconnection methods. */
inline bool IsOriginDisconnected()
{ return( this == this->GetOnext() ); }
inline bool IsDestinationDisconnected()
{ return( this->GetSym()->IsOriginDisconnected() ); }
inline bool IsDisconnected()
{ return( this->IsOriginDisconnected() &&
this->IsDestinationDisconnected() ); }
void Disconnect();
inline void SetIdent( const LineCellIdentifier& User_Value ) { this->m_LineCellIdent = User_Value; };
inline LineCellIdentifier GetIdent( ) { return( this->m_LineCellIdent ); };
public:
// Reserved OriginRefType designated to represent the absence of Origin
static const OriginRefType m_NoPoint;
protected:
OriginRefType m_Origin; // Geometrical information
PrimalDataType m_Data; // User data associated to this edge.
bool m_DataSet; // Indicates if the data is set.
LineCellIdentifier m_LineCellIdent;
};
}
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkGeometricalQuadEdge.txx"
#endif
#endif
|