/*============================================================================= NOTE: THIS FILE IS A HANDMADE WRAPPER FOR THE ManagedITK PROJECT. Project: ManagedITK Program: Insight Segmentation & Registration Toolkit Module: itkManagedCell.cxx Language: C++/CLI Author: Dan Mueller Date: $Date$ Revision: $Revision$ Portions of this code are covered under the ITK and VTK copyright. See http://www.itk.org/HTML/Copyright.htm for details. See http://www.kitware.com/VTKCopyright.htm for details. Copyright (c) 2008 Queensland University of Technology (QUT) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. =============================================================================*/ #pragma once #pragma warning( disable : 4635 ) // Disable warnings about XML doc comments #ifndef __itkManagedCell_cxx #define __itkManagedCell_cxx // Include some managed files #include "itkManagedPoint.cxx" // Use some managed namespaces #using #using using namespace System; using namespace System::IO; using namespace System::Reflection; using namespace System::ComponentModel; using namespace System::Diagnostics; namespace itk { ///This enumeration lists all the possible cell types (see itkCellInterface.h). public enum class itkCellTypeEnum { VertexCellType = 0, LineCellType, TriangleCellType, QuadrilateralCellType, PolygonCellType, TetrahedronCellType, HexahedronCellType, QuadraticEdgeCellType, QuadraticTriangleCellType, LastItkCellType, MaxItkCellsType = 255 }; /// ///This class is a managed replacement for itk::CellInterface. /// /// ///Define an abstract interface for cells. Actual cell types derive from this class. /// public ref class itkCell { private: itkCellTypeEnum m_Type; unsigned int m_Dimension; array^ m_PointIds; public: ///Default constructor. itkCell ( ) { } ///Constructor taking a pixel value and index. ///The type of the cell. ///The dimension of the cell. ///The list of point identifiers (indices) defining the cell. itkCell ( itkCellTypeEnum type, unsigned int dim, array< unsigned long >^ pointids ) { this->m_Type = type; this->m_Dimension = dim; this->m_PointIds = pointids; } ///Constructor copying member data from an existing cell. ///The existing cell to copy the data from. itkCell ( itkCell^ cell ) { this->m_Type = cell->Type; this->m_Dimension = cell->Dimension; this->m_PointIds = (array^)cell->PointIds->Clone(); } ///Get the cell type. property virtual itkCellTypeEnum Type { itkCellTypeEnum get() { return this->m_Type; } } ///Get the dimension of the cell. property virtual unsigned int Dimension { unsigned int get() { return this->m_Dimension; } } ///Get the dimension of the cell. property virtual unsigned int NumberOfPoints { unsigned int get() { return static_cast( this->m_PointIds->Length ); } } ///Get the point identifiers (indices) defining the cell. property virtual array^ PointIds { array^ get() { return this->m_PointIds; } } }; // end ref class } // end namespace itk #endif