Laurens Voerman
38727ed4b4
implement readObject for all relevant readerWriters
2019-05-14 14:25:30 +02:00
Robert Osfield
8feae585e1
Fixed buld
2018-10-10 13:10:55 +01:00
Antoine Lavenant
fa7843d520
fix apply once
2018-10-10 08:16:41 +01:00
Robert Osfield
312ce9ad05
Build fixes for OSG_USE_REF_PTR_IMPLICIT_OUTPUT set to OFF
2018-05-12 12:41:42 +01:00
Robert Osfield
f49e1d32c9
Replaced std::auto_ptr<> usage as it's deprecated in C++11 and will be removed in C++17
2018-05-05 12:28:45 +01:00
Alberto Luaces
02c310982e
Fix typos and spelling.
2018-04-23 11:03:37 +01:00
Robert Osfield
a082b57c3f
Removed usage of the osgUtil::TriStripVisitor is it generates osg::Geometry that perform very poorly when using VBO and VAO's vs GL DisplayLists.
...
With DisplayLists being deprecated in GL and VBO and VAO becoming standard it's best to standardize on using the osgUtil::MeshOptimizers instead of TripStrupVisitor
2018-04-20 11:44:44 +01:00
Robert Osfield
95eb5e2ad6
Replace c char array with std::string to address Coverity scan reported issue
2017-10-31 16:46:42 +00:00
Robert Osfield
c9545970ac
Removed redudent bool parameter from TriangleFunctor::operator(Vec3, Vec3, Vec3, bool) so it's now simply TriangleFunctor::operator(Vec3, Vec3, Vec3) as the bool was always false in recently OSG versions.
2017-05-11 15:25:10 +01:00
Robert Osfield
26bce07f2b
Fixed handlinge of fgets returning a 0 length string
2016-08-10 12:00:18 +01:00
Marc Helbling
e4c31cdcbf
Adds support for incomplete stl binary files
...
The logic is
* if a file is not ascii
* if its sizeis less than the expected binary size
then we can assume that the data is incomplete but still try to load it.
2016-07-05 17:09:45 +02:00
Marc Helbling
f4d0131967
Fixes magics color parsing
...
`fread` returns the number of objects read, not a byte-size.
2016-07-05 17:09:41 +02:00
Robert Osfield
2ddcd14395
Added initializer
2016-06-30 14:17:51 +01:00
Robert Osfield
1b409fff8b
Added handling of return value
2016-06-30 11:12:45 +01:00
Robert Osfield
cd4a51cf67
Added handling of return value
2016-06-30 11:11:00 +01:00
Robert Osfield
de6eb1d97e
Added handling of NULL
2016-06-30 07:59:51 +01:00
Robert Osfield
38d91ca3fe
Introduced use of local std::string to work around issue of the read header.text not being null terminated and causing a problem with the strstr call.
2016-06-10 14:36:50 +01:00
Robert Osfield
2acca80be8
Fixed unused parameter warning.
2016-06-08 09:48:39 +01:00
Alberto Luaces
260cbab518
Typo fixes
2016-05-30 12:30:05 +01:00
Robert Osfield
8882fb697e
From Wojciech Lewandowski, Visual Studio 2008 compatibility fix
...
Two fixed files:
osgPlugins/osgjs/JSON_Objects
osgPlugins/stl/ReaderWriterSTL.cpp.
They did not compile with VS 2008 (recent master from Github). It looks like they defined stdint types (missing in VS 2008) but code using them also included <osg/Types> header. Errors were caused by minor differences in signed int definitions. I just removed own definitions and added include<osg/Types> instead. It solves the problem and makes the code clearer now.
2015-12-14 17:59:45 +00:00
Robert Osfield
814693ffc1
Build fix for VS2005.
...
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14821 16af8721-9629-0410-8352-f15c8da7e697
2015-04-03 15:43:34 +00:00
Robert Osfield
b1852757b5
From Jason Beverage, "Here is a fix to the STL plugin that fixes build errors introduced in the last commit. It's just a simple addition of the stdint.h header."
...
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14644 16af8721-9629-0410-8352-f15c8da7e697
2015-01-05 17:39:44 +00:00
Robert Osfield
2870c12b03
From Aurélien Chatelain, "updates the STL plugin:
...
* fixes vertex color support
* adds 'magics' color definition
* cleans options to make the plugin more consistent with other plugins
* adds options to not tristrip geometries"
Submitted by Marc Helbling.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14638 16af8721-9629-0410-8352-f15c8da7e697
2014-12-24 10:47:25 +00:00
Robert Osfield
60d4b71d2b
From Björn Hein, "it seems that for generating "per vertex normals" as stated in the
...
comment, two of them are missing. This results in wrong display of
STL-files regarding normals. Following simple fix seems to work:
Index: ReaderWriterSTL.cpp
===================================================================
--- ReaderWriterSTL.cpp (Revision 13797)
+++ ReaderWriterSTL.cpp (Arbeitskopie)
@@ -108,6 +108,8 @@
++itr)
{
perVertexNormals->push_back(*itr);
+ perVertexNormals->push_back(*itr);
+ perVertexNormals->push_back(*itr);
}
geom->setNormalArray(perVertexNormals.get(),
osg::Array::BIND_PER_VERTEX);
"
2013-10-02 11:09:29 +00:00
Robert Osfield
55416d83b3
Replaced deprecated osg::Geometry::set*Binding() calls.
2013-06-26 17:44:30 +00:00
Robert Osfield
df075ef9bb
Cleaned up usage of BIND_PER_PRIMITIVE where possible.
2013-06-19 16:24:59 +00:00
Robert Osfield
46104008c7
From Piotr Domagalski, "I've rewritten some bits of the STL plugin in order to support ASCII STL files with multiple named solids (reading and writing). The names are also used as OSG nodes names.
...
- Also, a 'dontSaveNormals' was added. It allows to ignore normals when writing an STL file. For example, it is useful for me when writing an STL file for CFD simulations.
- Some comments and code formatting were improved (to be consistent with the formatting already used in the plugin).
- With 'separateFiles' option files are now named fooX.stl instead of foo.stlX
The changes have been tested on various STL, both ASCII and binary found on the net. The change was based on the trunk branch."
From Robert Osfield, changed assert in Piotr's code to a runtime check warning report.
2012-09-06 13:48:17 +00:00
Robert Osfield
14a563dc9f
Ran script to remove trailing spaces and tabs
2012-03-21 17:36:20 +00:00
Robert Osfield
b59ab789a3
From Alberto Luacas, typo fixes
2011-07-17 16:24:47 +00:00
Robert Osfield
93a174bb26
Converted osg::notify to OSG_INFO etc.
2010-05-28 17:08:30 +00:00
Robert Osfield
4e8f0561ad
From Farshid Lashkari, "I modified some plugins to use the osgDB file stream functions in order to support UTF-8 encoded filenames."
2010-05-13 11:01:06 +00:00
Robert Osfield
e5bdd460d4
Replaced catch usage
2009-11-16 16:09:50 +00:00
Robert Osfield
c491373698
Cleaned up indenting
2009-07-14 13:32:06 +00:00
Robert Osfield
adc68d79af
Converted code to use osg::asciiToFloat() instead of relying upong the C libraries sscanf to read floats as the C library is locale sensitive.
2009-07-14 13:30:28 +00:00
Robert Osfield
a0a06c8b2a
Completed support for automatic detection of plugin features.
...
Cleaned up debug out of various plugins to ensure a clean osgconv --formats.
2009-03-10 17:27:39 +00:00
Robert Osfield
315aeeb557
Where possible moved redundent C header includes from headers to source files
2008-12-12 18:47:30 +00:00
Robert Osfield
b147a22af1
From BjornHein, "attached a proposal for an extension for the the stl-File ReaderWriter. It allows saving of an osg node tree as stl file in ASCII-Format.
...
Standard is to generate one stl file.
With an additional option it is possible to write one file per Geode. This option is not very "useful" for typical application, I use it for separating and conversion of geometric data. So it could be removed if considered to special."
2008-11-26 11:45:33 +00:00
Robert Osfield
720551d549
From Michael Platings, Converted std::fstream/ifstream/ofstream to osgDB::fstream/ifstream/ofstream and
...
fopen to osgDB::fopen to facilitate support for wide character filenames using UT8 encoding.
2008-11-07 15:08:08 +00:00
Robert Osfield
4aed0a7eac
From Ulrich Hertlein, "attached are some minor tweaks:
...
- fixed typos in osgViewer/ViewerBase
- const-ness in include/osg/View findSlaveIndexForCamera
- supported options for STL reader, fixed return values to reflect proper errors
- supported options for DirectX reader, fixed return values
- normals pseudo-loader: scaling normals to a const (but variable) fraction of the bounding sphere radius
"
2008-07-17 13:51:14 +00:00
Robert Osfield
02b456bcfa
Converted plugins to use the new supportsExtension()/supportsOptions/supportsProtocl() methods
...
to help enable better querying of supported features
2008-07-13 22:18:59 +00:00
Robert Osfield
9e2fe92ef1
From Rudolf Wiedemann, "I need to link OpenSceneGraph statically to my application, so I
...
completed the new registration of the plugin-readerwriters
("REGISTER_OSGPLUGIN") according to your osgstaticviewer-example (see
attachment, based on today's svn)."
2007-07-06 13:54:26 +00:00
Robert Osfield
f3f86973a0
Added default opening of the file as a binary file, and once the type is
...
confirmed then close and reopen as an ascii as required. This is done to get
round problems under Windows.
Also made the running of the SmoothingVisitor optional, now use -O smooth to
make the loader run the osgUtil::SmoothingVisitor over the model.
2005-11-29 18:38:40 +00:00
Robert Osfield
1c8aca5a00
Added smoothing and tri strip pass.
2005-06-29 15:52:01 +00:00
Robert Osfield
d9b9a6f1f8
Made read/write methods in ReaderWriter all const to facilate multi-threading
2004-11-23 15:29:52 +00:00
Robert Osfield
ce07879e2e
Moved plugins across to using ReaderWriter::Options* for search paths in addition
...
to standard osgDB::DataFilePaths
2004-11-22 23:54:45 +00:00
Robert Osfield
fb631059fe
Remove unistd.h include
2004-11-12 21:07:17 +00:00
Robert Osfield
43f528fd41
From Ulrich Heirtlein, added STL plugin
2004-11-12 14:49:22 +00:00