]> Shamusworld >> Repos - architektonas/blobdiff - src/fileio.cpp
Added line-to-circle intersection code.
[architektonas] / src / fileio.cpp
index 931c5131653b64b89069ec995d67e6305fc25345..e0028cd90228c9d96a6ecd0fddea57f11382183f 100644 (file)
@@ -8,7 +8,7 @@
 // JLH = James Hammons <jlhamm@acm.org>
 //
 // Who  When        What
-// ---  ----------  -------------------------------------------------------------
+// ---  ----------  ------------------------------------------------------------
 // JLH  02/20/2013  Created this file
 //
 
 #include <stdlib.h>
 #include <string.h>
 #include <vector>
-#include "arc.h"
-#include "circle.h"
-#include "container.h"
-#include "dimension.h"
-#include "line.h"
+#include "structs.h"
 
 /*
 How to handle connected objects
@@ -112,8 +108,8 @@ OTHER CONSIDERATIONS:
 
 */
 
-enum ObjectTypeFile { OTFContainer, OTFContainerEnd, OTFLine, OTFCircle, OTFArc, OTFDimension,
-       OTFPolygon, OTFText, OTFImage, OTFBlock, OTFEndOfFile };
+enum ObjectTypeFile { OTFContainer, OTFContainerEnd, OTFLine, OTFCircle, OTFArc,
+       OTFDimension, OTFPolygon, OTFText, OTFImage, OTFBlock, OTFEndOfFile };
 
 
 /*static*/ bool FileIO::SaveAtnsFile(FILE * file, Container * object)
@@ -125,7 +121,7 @@ enum ObjectTypeFile { OTFContainer, OTFContainerEnd, OTFLine, OTFCircle, OTFArc,
           enumerates all objects within itself. */
 
        fprintf(file, "ARCHITEKTONAS DRAWING V1.0\n");
-#if 1
+#if 0
        object->Enumerate(file);
        fprintf(file, "END\n");
        return true;
@@ -149,7 +145,7 @@ enum ObjectTypeFile { OTFContainer, OTFContainerEnd, OTFLine, OTFCircle, OTFArc,
           add objects to it until an "endContainer" marker is found. This will require a
           stack to maintain the current Container. */
 
-#if 1
+#if 0
        std::vector<Container *> containerStack;
        Container * currentTopContainer = drawing;//new Container(Vector(0, 0));
        Object * object;
@@ -199,6 +195,7 @@ enum ObjectTypeFile { OTFContainer, OTFContainerEnd, OTFLine, OTFCircle, OTFArc,
 
 /*static*/ bool FileIO::GetObjectFromFile(FILE * file, Object * parent, Object ** object, int * objectType)
 {
+#if 0
        char buffer[256];
        int foundLayer = 0;
        int num = fscanf(file, "%s", buffer);
@@ -290,5 +287,8 @@ if (errno)
                (*object)->layer = foundLayer;
 
        return recognized;
+#else
+       return false;
+#endif
 }