#include <iostream>
#ifdef gsOpennurbs_ENABLED
#endif
#ifdef gsOpenCascade_ENABLED
#endif
template<class object>
{
if ( data.
has<
object >() )
{
<<data.
type<
object>()<<
" "<< data.
tag<
object>() <<
" in the file."<<
"\n";
memory::unique_ptr<object> o = data.
getFirst<
object >();
gsInfo<<
" Read the first one in address "<< o.get() <<
"\n";
gsInfo<<
" Write back to a new file \"dump_write.xml\"" <<
"\n";
newdata << *o ;
newdata.
save(
"dump_write");
}
}
int main(int argc, char *argv[])
{
#ifdef gsOpennurbs_ENABLED
gsInfo <<
"Using opennurbs.\n";
#endif
#ifdef gsOpenCascade_ENABLED
gsInfo <<
"Using OpenCascade.\n";
#endif
std::string fn;
gsCmdLine cmd(
"Hi, give me a file (.xml, .txt, .axl) and I will read the contents!");
cmd.addPlainString("filename", "Filename containing readable data (.xml or third party)", fn);
try { cmd.getValues(argc,argv); } catch (int rv) { return rv; }
if (fn.empty() )
{
gsInfo<<
"\nType "<< argv[0]<<
" -h, to get the list of command line options.\n";
return 0;
}
gsInfo<<
"Dumped all file data in dump.xml without allocating Gismo objects."<<
"\n";
lookFor< gsBasis<> > (data) ;
lookFor< gsGeometry<> > (data) ;
lookFor< gsBSpline<> > (data) ;
lookFor< gsNurbs<> > (data) ;
lookFor< gsTensorBSpline<2,real_t> > (data) ;
lookFor< gsTensorBSpline<3,real_t> > (data) ;
lookFor< gsTensorNurbs< 2,real_t> > (data) ;
lookFor< gsTensorNurbs< 3,real_t> > (data) ;
lookFor< gsMesh<> > (data) ;
lookFor< gsSolid<> > (data) ;
lookFor< gsKnotVector<> > (data) ;
lookFor< gsMatrix<> > (data) ;
lookFor< gsSparseMatrix<> > (data) ;
lookFor< gsPoissonPde<> > (data) ;
lookFor< gsPlanarDomain<> > (data) ;
lookFor< gsCurveLoop<> > (data) ;
lookFor< gsTrimSurface<> > (data) ;
lookFor< gsMultiPatch<> > (data) ;
lookFor< gsFunctionExpr<> > (data);
lookFor< gsHBox<2,real_t> > (data);
lookFor< gsHBoxContainer<2,real_t> > (data);
#if defined(gsOpennurbs_ENABLED) || defined(gsOpenCascade_ENABLED)
{
<<" in the file.\n";
#ifdef gsOpennurbs_ENABLED
gsInfo<<
" Write back to pd.3dm\n";
extensions::writeON_PlanarDomain(*o,"pd");
#endif
}
{
<<" in the file.\n";
#ifdef gsOpennurbs_ENABLED
gsInfo<<
" Write back to mp.3dm\n";
extensions::writeON_MultiPatch(*o,"mp");
#endif
#ifdef gsOpenCascade_ENABLED
gsInfo<<
" Write back to mp.igs\n";
extensions::writeOcctIgesMp(*o,"mp");
#endif
}
{
<<" in the file.\n";
{
#ifdef gsOpennurbs_ENABLED
gsInfo<<
" Write back to geo.3dm\n";
extensions::writeON_NurbsSurface(*srf,"geo");
#endif
#ifdef gsOpenCascade_ENABLED
gsInfo<<
" Write back to geo.igs\n";
extensions::writeOcctIges(*srf,"geo");
gsInfo<<
" Write back to geo.step\n";
extensions::writeOcctStep(*srf,"geo");
#endif
}
}
{
<<" in the file.\n";
#ifdef gsOpennurbs_ENABLED
gsInfo<<
" Write back to mesh.3dm\n";
extensions::writeON_Mesh(*o,"mesh");
#endif
}
#endif
return EXIT_SUCCESS;
}
Class for command-line argument parsing.
Definition gsCmdLine.h:57
This class represents an XML data tree which can be read from or written to a (file) stream.
Definition gsFileData.h:34
String tag() const
Prints the XML tag of a Gismo object.
Definition gsFileData.h:210
void saveCompressed(String const &fname="dump") const
Save file contents to compressed xml file.
Definition gsFileData.hpp:131
int count() const
Counts the number of Objects in the filedata.
Definition gsFileData.h:259
int numTags() const
Counts the number of Objects/tags in the filedata.
Definition gsFileData.hpp:2602
size_t bufferSize() const
Returns the size of the data.
Definition gsFileData.h:401
void save(String const &fname="dump", bool compress=false) const
Save file contents to an xml file.
Definition gsFileData.hpp:98
memory::unique_ptr< Object > getFirst() const
Definition gsFileData.h:446
String type() const
Prints the XML tag type of a Gismo object.
Definition gsFileData.h:215
bool has() const
Returns true if an Object exists in the filedata.
Definition gsFileData.h:220
Abstract base class representing a geometry map.
Definition gsGeometry.h:93
memory::unique_ptr< gsGeometry > uPtr
Unique pointer for gsGeometry.
Definition gsGeometry.h:100
Class Representing a triangle mesh with 3D vertices.
Definition gsMesh.h:32
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition gsMultiPatch.h:100
memory::unique_ptr< gsMultiPatch > uPtr
Unique pointer for gsMultiPatch.
Definition gsMultiPatch.h:109
Class representing a Planar domain with an outer boundary and a number of holes.
Definition gsPlanarDomain.h:44
Abstract base class representing a surface.
Definition gsSurface.h:31
Main header to be included by clients using the G+Smo library.
#define GISMO_UNUSED(x)
Definition gsDebug.h:112
#define gsInfo
Definition gsDebug.h:43
Reading OpenCascade .brep and others via OCCT.
Reading OpenCascade .brep files.
Provides declaration of functions that write 3DM file format.
The G+Smo namespace, containing all definitions for the library.