/// The surface is recursively tesselated until the angle between each triangle
/// edge is smaller than a specified tolerance.
-
+#include "globaldefs.h"
#include "nameable.h"
#include "ifilter.h"
#include "imap.h"
}
}
-#if defined( _DEBUG )
+#if GDEF_DEBUG
RenderNormals();
#endif
}
bool m_bOverlay;
bool m_transformChanged;
-Callback m_evaluateTransform;
-Callback m_boundsChanged;
+Callback<void()> m_evaluateTransform;
+Callback<void()> m_boundsChanged;
void construct(){
m_bOverlay = false;
}
public:
-Callback m_lightsChanged;
+Callback<void()> m_lightsChanged;
static int m_CycleCapIndex; // = 0;
static EPatchType m_type;
STRING_CONSTANT( Name, "Patch" );
-Patch( scene::Node& node, const Callback& evaluateTransform, const Callback& boundsChanged ) :
+Patch( scene::Node& node, const Callback<void()>& evaluateTransform, const Callback<void()>& boundsChanged ) :
m_node( &node ),
m_shader( texdef_name_default() ),
m_state( 0 ),
m_boundsChanged( boundsChanged ){
construct();
}
-Patch( const Patch& other, scene::Node& node, const Callback& evaluateTransform, const Callback& boundsChanged ) :
+Patch( const Patch& other, scene::Node& node, const Callback<void()>& evaluateTransform, const Callback<void()>& boundsChanged ) :
m_node( &node ),
m_shader( texdef_name_default() ),
m_state( 0 ),
m_lightsChanged();
SceneChangeNotify();
}
-typedef MemberCaller<Patch, &Patch::transformChanged> TransformChangedCaller;
+typedef MemberCaller<Patch, void(), &Patch::transformChanged> TransformChangedCaller;
void evaluateTransform(){
if ( m_transformChanged ) {
PatchControlArray& getControlPoints(){
return m_ctrl;
}
+
+// Same as above, just for const arguments
+const PatchControlArray& getControlPoints() const {
+ return m_ctrl;
+}
+
PatchControlArray& getControlPointsTransformed(){
return m_ctrlTransformed;
}
void CapTexture();
void NaturalTexture();
void ProjectTexture( int nAxis );
+void createThickenedOpposite(const Patch& sourcePatch, const float thickness, const int axis, bool& no12, bool& no34 );
+void createThickenedWall(const Patch& sourcePatch, const Patch& targetPatch, const int wallIndex);
void undoSave(){
if ( m_map != 0 ) {
void lightsChanged(){
m_lightList->lightsChanged();
}
-typedef MemberCaller<PatchInstance, &PatchInstance::lightsChanged> LightsChangedCaller;
+typedef MemberCaller<PatchInstance, void(), &PatchInstance::lightsChanged> LightsChangedCaller;
STRING_CONSTANT( Name, "PatchInstance" );
Instance::setTransformChangedCallback( LightsChangedCaller( *this ) );
}
~PatchInstance(){
- Instance::setTransformChangedCallback( Callback() );
+ Instance::setTransformChangedCallback( Callback<void()>() );
- m_patch.m_lightsChanged = Callback();
+ m_patch.m_lightsChanged = Callback<void()>();
GlobalShaderCache().detach( *this );
m_patch.detach( this );
Instance::selectedChanged();
}
-typedef MemberCaller1<PatchInstance, const Selectable&, &PatchInstance::selectedChanged> SelectedChangedCaller;
+typedef MemberCaller<PatchInstance, void(const Selectable&), &PatchInstance::selectedChanged> SelectedChangedCaller;
void selectedChangedComponent( const Selectable& selectable ){
GlobalSelectionSystem().getObserver ( SelectionSystem::eComponent )( selectable );
GlobalSelectionSystem().onComponentSelection( *this, selectable );
}
-typedef MemberCaller1<PatchInstance, const Selectable&, &PatchInstance::selectedChangedComponent> SelectedChangedComponentCaller;
+typedef MemberCaller<PatchInstance, void(const Selectable&), &PatchInstance::selectedChangedComponent> SelectedChangedComponentCaller;
Patch& getPatch(){
return m_patch;
void setSelected( bool select ){
m_selectable.setSelected( select );
+ if ( !select && parent() ){
+ Selectable* sel_parent = Instance_getSelectable( *parent() );
+ if ( sel_parent && sel_parent->isSelected() )
+ sel_parent->setSelected( false );
+ }
}
bool isSelected() const {
return m_selectable.isSelected();
}
}
+void invertComponentSelection(){
+ for ( PatchControlInstances::iterator i = m_ctrl_instances.begin(); i != m_ctrl_instances.end(); ++i )
+ {
+ ( *i ).m_selectable.setSelected( !( *i ).m_selectable.isSelected() );
+ }
+}
+
void selectPlanes( Selector& selector, SelectionTest& test, const PlaneCallback& selectedPlaneCallback ){
test.BeginMesh( localToWorld() );
evaluateTransform();
m_patch.freezeTransform();
}
-typedef MemberCaller<PatchInstance, &PatchInstance::applyTransform> ApplyTransformCaller;
+typedef MemberCaller<PatchInstance, void(), &PatchInstance::applyTransform> ApplyTransformCaller;
bool testLight( const RendererLight& light ) const {
m_functor( *patch );
}
}
+ else{
+ return false;
+ }
return true;
}
};
m_functor( *patch );
}
}
+ else{
+ return false;
+ }
return true;
}
};
m_functor( *patch );
}
}
+ else{
+ return false;
+ }
return true;
}
};