Skip to content
Snippets Groups Projects
Commit 125de335 authored by Pascal Engeler's avatar Pascal Engeler
Browse files

started SC loading feature

parent 5a2f8abb
No related branches found
No related tags found
No related merge requests found
...@@ -42,13 +42,13 @@ ...@@ -42,13 +42,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
#define GL_GPU_MEM_INFO_CURRENT_AVAILABLE_MEM_NVX 0x9049 #define GL_GPU_MEM_INFO_CURRENT_AVAILABLE_MEM_NVX 0x9049
/*Paths*/ /*Paths*/
/*HOME*/ /*HOME*/
#define RESOURCEPATH "C:\\Users\\engel\\repos\\arm-designer\\resources\\" //#define RESOURCEPATH "C:\\Users\\engel\\repos\\arm-designer\\resources\\"
/*ZYGOTE*/ /*ZYGOTE*/
//#define RESOURCEPATH "C:\\Users\\Pascal\\repos\\arm-designer\\resources\\" #define RESOURCEPATH "C:\\Users\\Pascal\\repos\\arm-designer\\resources\\"
class ArmDesigner { class ArmDesigner {
public: public:
ArmDesigner(); ArmDesigner();
......
...@@ -12,14 +12,13 @@ Segment::Segment(std::string filename){ ...@@ -12,14 +12,13 @@ Segment::Segment(std::string filename){
if (!infile.is_open()) { if (!infile.is_open()) {
throw("IO ERROR"); throw("IO ERROR");
} }
else { float x = 0.;
float x = 0.; float y = 0.;
float y = 0.; size_t count = 0;
size_t count = 0; while (infile >> x && infile >> y) {
while (infile >> x && infile >> y) { ++count;
++count; pts_.push_back({ x, y });
pts_.push_back({ x, y });
}
#ifndef NDEBUG #ifndef NDEBUG
for (auto& arr : pts_) { for (auto& arr : pts_) {
std::cout << arr[0] << "\t" << arr[1] << "\t" << &arr[0] << "\t" << &arr[1] << std::endl; std::cout << arr[0] << "\t" << arr[1] << "\t" << &arr[0] << "\t" << &arr[1] << std::endl;
......
#include <segments.hpp> #include <segments.hpp>
#include <segment.hpp> #include <segment.hpp>
#include <fstream>
#include <iostream>
#include <ios>
Segments::Segments() { Segments::Segments() {
} }
bool Segments::load(std::string filename) { bool Segments::load(std::string filename) {
Segment seg(filename); //check if we have coordinates only, or a SpaceClaim compatible text file
segms_.push_back(seg); std::ifstream infile(filename);
bool is_sc = false;
std::string firstline;
std::getline(infile, firstline);
if (firstline == "3d = true") {
std::cout << "Detected SpaceClaim Input File" << std::endl;
is_sc = true;
}
if (!is_sc) {//Just Coordinates
infile.close();
Segment seg(filename);
segms_.push_back(seg);
}
else {//SpaceClaim File
infile.seekg(0);
std::string line;
while (std::getline(infile, line)) {
}
}
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment