//=========================================================================== // SISL - SINTEF Spline Library, version 4.5.0. // Definition and interrogation of NURBS curves and surfaces. // // Copyright (C) 2000-2005, 2010 SINTEF ICT, Applied Mathematics, Norway. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., // 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. // // Contact information: E-mail: tor.dokken@sintef.no // SINTEF ICT, Department of Applied Mathematics, // P.O. Box 124 Blindern, // 0314 Oslo, Norway. // // Other licenses are also available for this software, notably licenses // for: // - Building commercial software. // - Building software whose source code you wish to keep private. //=========================================================================== 00029 #ifndef _GOREADWRITE_H 00030 #define _GOREADWRITE_H 00031 00032 #include <iostream> 00033 #include <vector> 00034 00035 // forward declarations 00036 struct SISLCurve; 00037 struct SISLSurf; 00038 00039 //=========================================================================== 00040 // For the two following read-functions, the memory for the SISL objects will be 00041 // dynamically allocated inside the function, and a pointer is passed to the user. 00042 // It is the user's responsibility to free the memory afterwards. 00043 // IMPORTANT: Since the objects are allocated within SISL (which is written in 00044 // pure C), the C memory allocation functions are used. To 'free' a SISLCurve 00045 // pointed to by 'c', you should call 'freeCurve(c)'. The command to free 00046 // SISLSurf objects is 'freeSurf()'. 00047 //=========================================================================== 00048 00049 // Read a curve in Go-format from stream and generate a SISLCurve object from it. 00050 SISLCurve* readGoCurve(std::istream& go_stream); 00051 00052 // Read a surface in Go-format from stream and generate a SISLSurf object from it. 00053 SISLSurf* readGoSurface(std::istream& go_stream); 00054 00055 00056 //=========================================================================== 00057 // The following four functions are used to write SISL objects to a stream in 00058 // Go-format. 00059 //=========================================================================== 00060 00061 // Write a SISLCurve object to stream using the Go-format 00062 void writeGoCurve(SISLCurve* curve, std::ostream& go_stream); 00063 00064 // Write the SISLSurf object to stream using the Go-format. 00065 void writeGoSurface(SISLSurf* surf, std::ostream& go_stream); 00066 00067 //=========================================================================== 00068 // The following is just an access function to read/write a set of 3D points 00069 // on the Go format. It is unrelated to SISL, but useful when you want to 00070 // visualise 3D-points with the Go-compatible viewer. 00071 //=========================================================================== 00072 00073 // The 3D points whose coords are pointed to by 'coords' will be written in 00074 // Go-format to the stream. The number of points is indicated by 'num_points'. 00075 void writeGoPoints(int num_points, double* coords, std::ostream& go_stream); 00076 00077 // Read 3D coordinates grom a point cloud in Go-format. The points' coordinates 00078 // will be filled into the vector 'coords' (whose length, divided by 3, is the 00079 // total number of points). The points are read from the 'go_stream' stream. 00080 void readGoPoints(std::vector<double>& coords, std::istream& go_stream); 00081 00082 #endif // _GOREADWRITE_H 00083
Generated on Tue Sep 21 17:28:53 2010 for SISL by  doxygen 1.6.3