00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef BOOLEAN_OPERATIONS_HH
00025 #define BOOLEAN_OPERATIONS_HH
00026
00027 #include "g-map-vertex.hh"
00028 #include "corefinement-win32.hh"
00029
00039
00040 typedef enum {BO_Union, BO_Intersection,
00041 BO_Difference1, BO_Difference2} TBooleanOperation;
00042
00053 DLL_COREFINEMENT std::ostream & operator << (std::ostream & AStream, TBooleanOperation ABoolOp);
00054
00056
00057 namespace GMap3d
00058 {
00059
00060 class DLL_COREFINEMENT CBooleanOperations
00061 {
00062 public:
00063
00068
00080 CBooleanOperations(CGMapVertex * AMap, CDart * AObject1, CDart * AObject2,
00081 bool ACalculateOrientation = true, int AVertexDI = -1);
00082
00088 virtual ~CBooleanOperations();
00089
00091
00096
00097 CDart * getObject1() const;
00098 CDart * getObject2() const;
00099
00100 void setObject1(CDart * AObject);
00101 void setObject2(CDart * AObject);
00102
00103 bool isComputationPossible() const;
00104
00105 bool computeResults(std::bitset<NB_MARKS> ACopyMarks = 0);
00106
00107 void markResult(TBooleanOperation AOperation, int AMark);
00108 void markAllButResult(TBooleanOperation AOperation, int AMark);
00109 void markResults(TBooleanOperation AOperation, int AKeepMark,
00110 int ADiscardMark);
00111
00112 CDart * getDartFromResult(TBooleanOperation AOperation);
00113 CDart * getDartOutOfResult(TBooleanOperation AOperation);
00114
00115 void keepResult(TBooleanOperation AOperation,
00116 std::list<CDart*> * ACompoundList = NULL);
00117 void keepAllButResult(TBooleanOperation AOperation,
00118 std::list<CDart*> * ACompoundList = NULL);
00119
00121
00122 protected:
00123
00128
00129 CGMapVertex * getMap() const;
00130
00131 int getObject1Mark() const;
00132 int getObject2Mark() const;
00133
00134 bool calculateOrientation() const;
00135 int getVertexDI() const;
00136
00137 void getMarkedCompounds(int AMark, std::list<CDart*> * AList);
00138
00139 virtual bool corefineObjects(std::bitset<NB_MARKS> ACopyMarks) = 0;
00140 virtual void extendMarks() = 0;
00141
00143
00144 private:
00145
00150
00151 CGMapVertex * FMap;
00152
00153 CDart * FObject1;
00154 CDart * FObject2;
00155
00156 int FObject1Mark;
00157 int FObject2Mark;
00158
00159 bool FCalculateOrientation;
00160 int FVertexDI;
00161
00163 };
00164
00165 }
00166
00167 #endif