Itasca C++ Interface
Loading...
Searching...
No Matches
igeomimportexport.h
Go to the documentation of this file.
1#pragma once
2
3// igeomimportexport.h
4#include "base/src/base.h"
5#include "base/src/farray.h"
6#include "utility/interface/igroup.h"
7//#include "utility/src/textstream.h"
8
11
12namespace itasca {
13 class IGeometryImportData;
15 public:
16 virtual ~IGeomImportExport() {}
18
20 virtual bool importFile(const string &filename, IGeometryImportData *ig)=0;
21
24 virtual bool exportStart(const string &filename, uint64 total, string comment="")=0;
25
30 virtual void exportPoint(const DVect3 &p,uint64 pid=0)=0;
31
38 virtual void exportLine(const DVect3 &p1, const DVect3 &p2,uint64 pid1=0, uint64 pid2=0, uint64 eid=0)=0;
39
47 virtual void exportPolygon(const FArray<DVect3> &ps, const FArray<uint64> *pids=0, const FArray<uint64> *eids=0, uint64 polyid=0)=0;
48
51 virtual bool exportNodesNeeded(){return false;};
52
55 virtual bool exportEdgesNeeded(){return false;};
56
59 virtual void setGroups(const FArray<IGroupID> &groups)=0; //
60
63 virtual void setExtras(const FArray<std::pair<uint32,string>> &) { };
64
66 virtual void setDefaultLayerName(const string &name)=0;
67
69 virtual void setExportBinary(bool binary)=0;
70
72 virtual bool exportEnd(void)=0;
73
76
79 virtual bool fileFormatSupported(const string &filename)=0;
80 //{
81 // string ext(QFileInfo(filename).suffix().toLower());
82 // StringList supported = this->getSupportedFileFormatExtensions();
83 // for(int i=0; i<(int)supported.size(); ++i) if(supported.at(i).toLower() == ext) return true;
84 // return false;
85 //}
86
88 virtual string getPluginName()=0;
89 virtual string getFormatKeyword() const=0;
90
91 virtual IGeomImportExport *clone()=0;
92
93 virtual void destroy()=0;
94
97 virtual void setTerminal(bool){};
98 //virtual void setTerminal(TextStream *){};
99
100 };
101
102 //
104 public:
107
112 virtual void addPoint(const DVect3 &p,uint64 pid=0)=0;
113
118 virtual void addLine(const DVect3 &p1, const DVect3 &p2, uint64 eid=0)=0;
119
120 virtual void addLine(uint64 pid1, uint64 pid2, uint64 eid=0)=0;
121
123 virtual void addPolygon(FArray<DVect3> &ps)=0;
124
127
130
134 virtual void setExtras(const FArray< std::pair<uint32,string> > &){};
135
138 virtual void setGroups(const FArray<IGroupID> &groups)=0;
139
141 virtual void writeParseWarning(int line,const string &x)=0;
142 virtual bool updateProgress(uint64 pos,uint64 max=0)=0;
143
144 };
145
146}
One stop include for all objects defined as part of base interface.
An array class that attempts to minimize unnecessary heap access.
Definition farray.h:25
Definition basestring.h:89
Definition igeomimportexport.h:14
virtual void exportLine(const DVect3 &p1, const DVect3 &p2, uint64 pid1=0, uint64 pid2=0, uint64 eid=0)=0
virtual bool exportEnd(void)=0
Finish export.
virtual bool importFile(const string &filename, IGeometryImportData *ig)=0
Import-export geometric set.
virtual void setDefaultLayerName(const string &name)=0
Sets default name for metadata layer.
virtual void setGroups(const FArray< IGroupID > &groups)=0
virtual void setTerminal(bool)
Definition igeomimportexport.h:97
virtual bool exportStart(const string &filename, uint64 total, string comment="")=0
virtual bool fileFormatSupported(const string &filename)=0
virtual bool exportNodesNeeded()
Definition igeomimportexport.h:51
virtual void exportPoint(const DVect3 &p, uint64 pid=0)=0
virtual StringList getSupportedFileFormatExtensions()=0
Returns list of supported file format extensions for export-import.
virtual string getPluginName()=0
get plugin name needed for plugin list container
virtual void setExtras(const FArray< std::pair< uint32, string > > &)
Definition igeomimportexport.h:63
virtual bool exportEdgesNeeded()
Definition igeomimportexport.h:55
virtual void setExportBinary(bool binary)=0
Sets export format to be binary (if binary not supported – it has no effect)
virtual void exportPolygon(const FArray< DVect3 > &ps, const FArray< uint64 > *pids=0, const FArray< uint64 > *eids=0, uint64 polyid=0)=0
Definition igeomimportexport.h:103
virtual void addPolygon(FArray< DVect3 > &ps)=0
add polygon
virtual void writeParseWarning(int line, const string &x)=0
Service methods.
virtual void setExtras(const FArray< std::pair< uint32, string > > &)
Definition igeomimportexport.h:134
virtual void addPoint(const DVect3 &p, uint64 pid=0)=0
Handle import geometric data generated by a IGeomImportExport.
virtual void addPolygonByPointsIds(FArray< uint64 > &pids)=0
Add polygon defined by point ids.
virtual void addLine(const DVect3 &p1, const DVect3 &p2, uint64 eid=0)=0
virtual void addPolygonByEdgesIds(FArray< uint64 > &eids)=0
Add polygons defined by line (edge) id-s.
virtual void setGroups(const FArray< IGroupID > &groups)=0
An array class that attempts to minimize unnecessary heap access.
namespace Itasca
Definition basememory.cpp:14