diff --git a/apps/msvc/trimeshinfo/XMLTree.h b/apps/msvc/trimeshinfo/XMLTree.h deleted file mode 100644 index 7be611f2..00000000 --- a/apps/msvc/trimeshinfo/XMLTree.h +++ /dev/null @@ -1,269 +0,0 @@ - -#include -#include -#include - -#include -#include -#include "SlotsNode.h" -#include "ClassesNode.h" -#include "InstancesNode.h" - - -using namespace std; - - - - - - -class FacetNode: public Node -{ -virtual void printNode(); -virtual int qualifyNode(); -}; - - - -class FacetsNode: public Node -{ - NodeGroup facets; - virtual void printNode(); - virtual int qualifyNode(); -}; - - - -class MainNode: public Node -{ -public: - - MainNode(void){node_type = MAIN_NODE;}; - int node_type; - list > headers; - - void addHeaders(char* str, char*val); - virtual void printNode(); - virtual int qualifyNode(); -}; - -void MainNode::addHeaders(char* str, char*val) -{ - headers.push_back(pair(str,val)); -} -void MainNode::printNode() -{ - - cout<<"MainNode: node_type is "< >::iterator it; - for(it = headers.begin(); it!= headers.end(); ++it) - { - cout<<"MainNode: First element is "<< it->first<<"\n"; - cout<<"MainNode: Second element is "<second<<"\n"; - } -} - -int MainNode::qualifyNode() -{return node_type;} - - -class XMLTree -{ -public: - XMLTree(void){}; - ~XMLTree(void){}; - NodeGroup root; - - - // methods - void initializeMain(char* xsn); - void finalizeMain(char* xsn, char* val); - void addHeaders(char* str, char*val); - - void addSlots(SlotNode* sn); -// void addFacets(); - void addClasses(ClassNode* cn); - void addInstances(InstanceNode* in); - void printXMLTree(); - -}; - -void XMLTree::initializeMain(char* xsn) -{ - MainNode* mn = new MainNode; - - mn->headers.push_back(pair(xsn,"")); - root.Sons.push_back(mn); - -} - -void XMLTree::finalizeMain(char* xsn, char* val) -{ - MainNode* mn = new MainNode; - - mn->headers.push_back(pair(xsn,val)); - root.Sons.push_back(mn); - -} - - -void XMLTree::addHeaders(char* str, char*val) -{ - MainNode* mn = (MainNode*) root.Sons.front(); - mn->headers.push_back(pair(str,val)); -} - -void XMLTree::addSlots(SlotNode* sn) -{ - SlotsNode* sn0 = new SlotsNode; // 1 solo - - sn0->addSlot(sn); - root.Sons.push_back(sn0); - - -} - -void XMLTree::addClasses(ClassNode* cn) -{ - ClassesNode* cn0 = new ClassesNode; // 1 solo - - cn0->addClass(cn); - root.Sons.push_back(cn0); -} - -void XMLTree::addInstances(InstanceNode* in) -{ - InstancesNode* in0 = new InstancesNode; // 1 solo - - in0->addInstance(in); - root.Sons.push_back(in0); -} - -void XMLTree::printXMLTree() -{ - string ext,s("XMLFile"); - cout<<"Preparing to create XML file"<<"\n"; - cout<<"enter the name of the file "<< endl; - cin >> ext; - - - s.append(ext); - s.append(".xml"); - - const char* filename = s.c_str(); - FILE* fp = fopen(filename, "w"); - - list::iterator it; - list::iterator it2; - list::iterator it3; - list >::iterator lit; - MainNode* mn; - SlotsNode* sns; - SlotNode* sn; - OwnSlotNode* osn; - ClassesNode* csn; - ClassNode* cn; - InstancesNode* isn; - InstanceNode* in; - int nn = 0; - for(it = root.Sons.begin(); it!=root.Sons.end(); ++it){ - cout<<"Creating Node #"<< nn<<"\n"; - cout<<"Node Type is "<< (*it)->qualifyNode()<<"\n"; - switch((*it)->qualifyNode()) - { - case MAIN_NODE: - mn = (MainNode*)(*it); - fprintf(fp,"<"); - for(lit = mn->headers.begin(); lit!= mn->headers.end(); ++lit) - fprintf(fp,"%s%s", lit->first,lit->second ); - fprintf(fp,"> \n"); - - break; - - case SLOTS_NODE: - sns = (SlotsNode*)(*it); - fprintf(fp," \n"); - - for(it2 = sns->slot.Sons.begin(); it2!=sns->slot.Sons.end(); ++it2) - { - sn = (SlotNode*) (*it2); - fprintf(fp,"\t"); - for(it3 = sn->own_slot.Sons.begin(); it3!=sn->own_slot.Sons.end(); ++it3) - { - osn = (OwnSlotNode*) (*it3); - fprintf(fp,"\n",osn->name); - fprintf(fp,"\t\t\n",osn->entry.type); - fprintf(fp,"\t\t\t\n"); - fprintf(fp,"\t\t\t%s\n",osn->entry.value.value); - fprintf(fp,"\t\t\t\n"); - fprintf(fp,"\t\t\n"); - fprintf(fp,"\t"); - } - fprintf(fp,"\n"); - } - fprintf(fp,"\n"); - - break; - case CLASSES_NODE: - csn = (ClassesNode*)(*it); - fprintf(fp," \n"); - - for(it2 = csn->classn.Sons.begin(); it2!=csn->classn.Sons.end(); ++it2) - { - cn = (ClassNode*) (*it2); - fprintf(fp,"\t"); - fprintf(fp,"\n"); - for(it3 = cn->own_slots.own_slot.Sons.begin(); it3!=cn->own_slots.own_slot.Sons.end(); ++it3) - { - osn = (OwnSlotNode*) (*it3); - fprintf(fp,"\t\t\n",osn->name); - fprintf(fp,"\t\t\t\n",osn->entry.type); - fprintf(fp,"\t\t\t\t\n"); - fprintf(fp,"\t\t\t%s\n",osn->entry.value.value); - fprintf(fp,"\t\t\t\t\n"); - fprintf(fp,"\t\t\t\n"); - fprintf(fp,"\t\t\n"); - } - fprintf(fp,"\t\n"); - fprintf(fp,"\n"); - } - fprintf(fp,"\n"); - - break; - case INSTANCES_NODE: - isn = (InstancesNode*)(*it); - fprintf(fp," \n"); - - for(it2 = isn->instances.Sons.begin(); it2!=isn->instances.Sons.end(); ++it2) - { - in = (InstanceNode*) (*it2); - fprintf(fp,"\t\n"); - fprintf(fp,"\t\t\n"); - fprintf(fp,"\t\t%s\n", in->id); - fprintf(fp,"\t\t\n"); - fprintf(fp,"\t\t\n"); - fprintf(fp,"\t\t%s\n", in->type); - fprintf(fp,"\t\t\n"); - fprintf(fp,"\t\t\n"); - for(it3 = in->own_slots.own_slot.Sons.begin(); it3!=in->own_slots.own_slot.Sons.end(); ++it3) - { - osn = (OwnSlotNode*) (*it3); - fprintf(fp,"\t\t\t\n",osn->name); - fprintf(fp,"\t\t\t\t\n",osn->entry.type); - fprintf(fp,"\t\t\t\t\n"); - fprintf(fp,"\t\t\t\t%s\n",osn->entry.value.value); - fprintf(fp,"\t\t\t\t\n"); - fprintf(fp,"\t\t\t\t\n"); - fprintf(fp,"\t\t\t\n"); - } - fprintf(fp,"\t\t\n"); - fprintf(fp,"\t\n"); - } - fprintf(fp,"\n"); - - break; - } - ++nn; - } - fclose(fp); -} \ No newline at end of file diff --git a/apps/msvc/trimeshinfo/defs.h b/apps/msvc/trimeshinfo/defs.h deleted file mode 100644 index 1122dc4f..00000000 --- a/apps/msvc/trimeshinfo/defs.h +++ /dev/null @@ -1,48 +0,0 @@ -// ----------------------------------------------------------------------------------------------- -#ifndef _DEFS_H -#define _DEFS_H -// ----------------------------------------------------------------------------------------------- - -// command line parameters -#define CMD_LINE_ARG_HIST 'H' -#define CMD_LINE_ARG_VERTEX_SAMPLE 'V' -#define CMD_LINE_ARG_EDGE_SAMPLE 'E' -#define CMD_LINE_ARG_FACE_SAMPLE 'F' -#define CMD_LINE_ARG_SAMPLE_TYPE 'S' -#define CMD_LINE_ARG_MONTECARLO_SAMPLING 'M' -#define CMD_LINE_ARG_SUBDIVISION_SAMPLING 'S' -#define CMD_LINE_ARG_SIMILAR_TRIANGLES_SAMPLING 'T' -#define CMD_LINE_ARG_N_SAMPLES 'N' -#define CMD_LINE_ARG_SAMPLES_PER_AREA_UNIT 'A' -#define CMD_LINE_ARG_SAVE_DISPLACEMENT 'O' -#define CMD_LINE_ARG_SAVE_ERROR_AS_COLOUR 'C' - - -// error messages -#define MSG_ERR_N_ARGS "\nUsage: "\ - "trimeshinfo filename \n" - -#define MSG_ERR_MESH_LOAD "error loading the input meshes.\n" -#define MSG_ERR_INVALID_OPTION "unable to parse option '%s'\n" -#define MSG_ERR_FILE_OPEN "unable to open the output file.'n" -#define MSG_ERR_UNKNOWN_FORMAT "unknown file format '%s'.\n" - -// global constants -#define NO_SAMPLES_PER_FACE 10 -#define N_SAMPLES_EDGE_TO_FACE_RATIO 0.1 -#define BBOX_FACTOR 0.1 -#define INFLATE_PERCENTAGE 0.02 -#define MIN_SIZE 125 /* 125 = 5^3 */ -#define N_HIST_BINS 256 -#define PRINT_EVERY_N_ELEMENTS 1000 -#define FILE_EXT_SMF "smf" -#define FILE_EXT_PLY "ply" - -// strings -#define STR_HIST_FILENAME_DEFAULT "hist.txt" -#define STR_NEW_MESH_FILENAME_DEFAULT "error.ply" -#define STR_NEW_MESH_FILENAME_DEFAULT_2 "error_colour.ply" - -// ----------------------------------------------------------------------------------------------- -#endif -// -----------------------------------------------------------------------------------------------