MeshKit  1.0
AF2AlgorithmResult.cpp
Go to the documentation of this file.
00001 #include "meshkit/AF2AlgorithmResult.hpp"
00002 
00003 // C++
00004 #include <cstddef>
00005 
00006 // MeshKit
00007 #include "meshkit/Error.hpp"
00008 
00009 
00010 AF2AlgorithmResult::AF2AlgorithmResult() :
00011      succeeded(false), points(), faces()
00012 {
00013   // nothing more to do
00014 }
00015 
00016 AF2AlgorithmResult::AF2AlgorithmResult(
00017     const std::list<AF2Point3D*> & pointsArg,
00018     const std::list<const AF2Polygon3D*> & facesArg) :
00019     succeeded(true), points(pointsArg), faces(facesArg)
00020 {
00021   // nothing more to do
00022 }
00023 
00024 AF2AlgorithmResult::~AF2AlgorithmResult()
00025 {
00026   typedef std::list<const AF2Polygon3D*>::const_iterator FaceConstItr;
00027   typedef std::list<AF2Point3D*>::const_iterator PointConstItr;
00028 
00029   for (FaceConstItr itr = faces.begin(); itr != faces.end(); ++itr)
00030   {
00031     delete (*itr);
00032   }
00033 
00034   for (PointConstItr itr = points.begin(); itr != points.end(); ++itr)
00035   {
00036     delete (*itr);
00037   }
00038 }
00039 
00040 AF2AlgorithmResult::AF2AlgorithmResult(const AF2AlgorithmResult & toCopy)
00041 {
00042   MeshKit::Error notImpl(MeshKit::MK_NOT_IMPLEMENTED);
00043   notImpl.set_string("AF2AlgorithmResult copy construction is not supported.");
00044   throw notImpl;
00045 }
00046 
00047 AF2AlgorithmResult& AF2AlgorithmResult::operator=(
00048     const AF2AlgorithmResult & rhs)
00049 {
00050   MeshKit::Error notImpl(MeshKit::MK_NOT_IMPLEMENTED);
00051   notImpl.set_string(
00052       "AF2AlgorithmResult assignment operator is not supported.");
00053   throw notImpl;
00054 }
00055 
00056 const std::list<const AF2Polygon3D*>* AF2AlgorithmResult::getFaces() const
00057 {
00058   if (succeeded)
00059   {
00060     return &faces;
00061   }
00062   return NULL;
00063 }
00064 
00065 const std::list<AF2Point3D*>* AF2AlgorithmResult::getPoints() const
00066 {
00067   if (succeeded)
00068   {
00069     return &points;
00070   }
00071   return NULL;
00072 }
00073 
00074 bool AF2AlgorithmResult::isSuccessful() const
00075 {
00076   return succeeded;
00077 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines