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 QString &filename, IGeometryImportData *ig)=0;
21
24 virtual bool exportStart(const QString &filename, uint64 total, QString 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<QPair<uint32,QString>> &) { };
64
66 virtual void setDefaultLayerName(const QString &name)=0;
67
69 virtual void setExportBinary(bool binary)=0;
70
72 virtual bool exportEnd(void)=0;
73
75 virtual QStringList getSupportedFileFormatExtensions()=0;
76
79 virtual bool fileFormatSupported(const QString &filename) {
80 QString ext(QFileInfo(filename).suffix().toLower());
81 QStringList supported = this->getSupportedFileFormatExtensions();
82 for(int i=0; i<(int)supported.size(); ++i) if(supported.at(i).toLower() == ext) return true;
83 return false;
84 }
85
87 virtual QString getPluginName()=0;
88 virtual QString getFormatKeyword() const=0;
89
90 virtual IGeomImportExport *clone()=0;
91
92 virtual void destroy()=0;
93
96 virtual void setTerminal(bool){};
97 //virtual void setTerminal(TextStream *){};
98
99 };
100
101 //
103 public:
106
111 virtual void addPoint(const DVect3 &p,uint64 pid=0)=0;
112
117 virtual void addLine(const DVect3 &p1, const DVect3 &p2, uint64 eid=0)=0;
118
119 virtual void addLine(uint64 pid1, uint64 pid2, uint64 eid=0)=0;
120
122 virtual void addPolygon(FArray<DVect3> &ps)=0;
123
126
129
133 virtual void setExtras(const FArray< QPair<uint32,QString> > &){};
134
137 virtual void setGroups(const FArray<IGroupID> &groups)=0;
138
140 virtual void writeParseWarning(int line,const QString &x)=0;
141 virtual bool updateProgress(uint64 pos,uint64 max=0)=0;
142
143 };
144
145}
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 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 QString &filename, IGeometryImportData *ig)=0
Import-export geometric set.
virtual void setGroups(const FArray< IGroupID > &groups)=0
virtual QString getPluginName()=0
get plugin name needed for plugin list container
virtual QStringList getSupportedFileFormatExtensions()=0
Returns list of supported file format extensions for export-import.
virtual void setTerminal(bool)
Definition igeomimportexport.h:96
virtual bool exportNodesNeeded()
Definition igeomimportexport.h:51
virtual void setExtras(const FArray< QPair< uint32, QString > > &)
Definition igeomimportexport.h:63
virtual void exportPoint(const DVect3 &p, uint64 pid=0)=0
virtual void setDefaultLayerName(const QString &name)=0
Sets default name for metadata layer.
virtual bool fileFormatSupported(const QString &filename)
Definition igeomimportexport.h:79
virtual bool exportStart(const QString &filename, uint64 total, QString comment="")=0
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:102
virtual void addPolygon(FArray< DVect3 > &ps)=0
add polygon
virtual void setExtras(const FArray< QPair< uint32, QString > > &)
Definition igeomimportexport.h:133
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
virtual void writeParseWarning(int line, const QString &x)=0
Service methods.
An array class that attempts to minimize unnecessary heap access.
namespace Itasca
Definition basememory.cpp:10