Added VRML2 Box node
This commit is contained in:
parent
59cf4c5ed0
commit
5208a1b47e
|
@ -0,0 +1,30 @@
|
||||||
|
include_directories(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/v2
|
||||||
|
)
|
||||||
|
|
||||||
|
#add_definitions( -DDEBUG_VRML2=3 )
|
||||||
|
|
||||||
|
add_library( s3d_plugin_vrml MODULE
|
||||||
|
vrml.cpp
|
||||||
|
wrlproc.cpp
|
||||||
|
v2/vrml2_node.cpp
|
||||||
|
v2/vrml2_base.cpp
|
||||||
|
v2/vrml2_transform.cpp
|
||||||
|
v2/vrml2_shape.cpp
|
||||||
|
v2/vrml2_appearance.cpp
|
||||||
|
v2/vrml2_material.cpp
|
||||||
|
v2/vrml2_faceset.cpp
|
||||||
|
v2/vrml2_coords.cpp
|
||||||
|
v2/vrml2_norms.cpp
|
||||||
|
v2/vrml2_color.cpp
|
||||||
|
v2/vrml2_box.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries( s3d_plugin_vrml kicad_3dsg ${OPENGL_LIBRARIES} ${wxWidgets_LIBRARIES} )
|
||||||
|
|
||||||
|
install( TARGETS
|
||||||
|
s3d_plugin_vrml
|
||||||
|
DESTINATION ${KICAD_USER_PLUGIN}/3d
|
||||||
|
COMPONENT binary
|
||||||
|
)
|
|
@ -32,6 +32,7 @@
|
||||||
#include "vrml2_coords.h"
|
#include "vrml2_coords.h"
|
||||||
#include "vrml2_norms.h"
|
#include "vrml2_norms.h"
|
||||||
#include "vrml2_color.h"
|
#include "vrml2_color.h"
|
||||||
|
#include "vrml2_box.h"
|
||||||
#include "plugins/3dapi/ifsg_all.h"
|
#include "plugins/3dapi/ifsg_all.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -369,20 +370,9 @@ bool WRL2BASE::ReadNode( WRLPROC& proc, WRL2NODE* aParent, WRL2NODE** aNode )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WRL2_BOX:
|
case WRL2_BOX:
|
||||||
// XXX - IMPLEMENT
|
|
||||||
if( !proc.DiscardNode() )
|
if( !readBox( proc, aParent, aNode ) )
|
||||||
{
|
|
||||||
#ifdef DEBUG_VRML2
|
|
||||||
std::cerr << " * [INFO] FAIL: discard " << glob << " node at l" << line << ", c" << column << "\n";
|
|
||||||
#endif
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
#ifdef DEBUG_VRML2
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::cerr << " * [INFO] OK: discard " << glob << " node at l" << line << ", c" << column << "\n";
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -765,6 +755,26 @@ bool WRL2BASE::readColor( WRLPROC& proc, WRL2NODE* aParent, WRL2NODE** aNode )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool WRL2BASE::readBox( WRLPROC& proc, WRL2NODE* aParent, WRL2NODE** aNode )
|
||||||
|
{
|
||||||
|
if( NULL != aNode )
|
||||||
|
*aNode = NULL;
|
||||||
|
|
||||||
|
WRL2BOX* np = new WRL2BOX( aParent );
|
||||||
|
|
||||||
|
if( !np->Read( proc, this ) )
|
||||||
|
{
|
||||||
|
delete np;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( NULL != aNode )
|
||||||
|
*aNode = (WRL2NODE*) np;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SGNODE* WRL2BASE::TranslateToSG( SGNODE* aParent, bool calcNormals )
|
SGNODE* WRL2BASE::TranslateToSG( SGNODE* aParent, bool calcNormals )
|
||||||
{
|
{
|
||||||
if( m_Children.empty() )
|
if( m_Children.empty() )
|
||||||
|
|
|
@ -68,6 +68,7 @@ private:
|
||||||
bool readCoords( WRLPROC& proc, WRL2NODE* aParent, WRL2NODE** aNode );
|
bool readCoords( WRLPROC& proc, WRL2NODE* aParent, WRL2NODE** aNode );
|
||||||
bool readNorms( WRLPROC& proc, WRL2NODE* aParent, WRL2NODE** aNode );
|
bool readNorms( WRLPROC& proc, WRL2NODE* aParent, WRL2NODE** aNode );
|
||||||
bool readColor( WRLPROC& proc, WRL2NODE* aParent, WRL2NODE** aNode );
|
bool readColor( WRLPROC& proc, WRL2NODE* aParent, WRL2NODE** aNode );
|
||||||
|
bool readBox( WRLPROC& proc, WRL2NODE* aParent, WRL2NODE** aNode );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue