modified lib GPC for header only
worked on 3d traytracing
This commit is contained in:
@@ -17,6 +17,7 @@ private:
|
||||
bool exportCeilings = true;
|
||||
bool exportObstacles = true;
|
||||
bool exportWallTops = false;
|
||||
std::vector<Floorplan::Floor*> exportFloors;
|
||||
|
||||
const Floorplan::IndoorMap* map;
|
||||
|
||||
@@ -28,14 +29,25 @@ public:
|
||||
|
||||
}
|
||||
|
||||
void setExportCeilings(bool exp) {
|
||||
this->exportCeilings = exp;
|
||||
}
|
||||
|
||||
/** limit to-be-exported floors */
|
||||
void setFloors(const std::vector<Floorplan::Floor*> floors) {
|
||||
this->exportFloors = floors;
|
||||
}
|
||||
|
||||
/** get all triangles grouped by obstacle */
|
||||
std::vector<Obstacle3D> triangulize() {
|
||||
|
||||
std::vector<Obstacle3D> res;
|
||||
|
||||
// get the to-be-exported floors (either "all" or "user defined")
|
||||
const std::vector<Floorplan::Floor*>& floors = (exportFloors.empty()) ? (map->floors) : (exportFloors);
|
||||
|
||||
// process each floor
|
||||
for (const Floorplan::Floor* f : map->floors) {
|
||||
for (const Floorplan::Floor* f : floors) {
|
||||
|
||||
// triangulize the floor itself (floor/ceiling)
|
||||
if (exportCeilings) {res.push_back(getTriangles(f));}
|
||||
|
||||
Reference in New Issue
Block a user