manipulators/manip_customselection/ormanip_customselection_manip.cxx
#include "ormanip_customselection_manip.h"
#define ORMANIP_CUSTOMSELECTION__CLASS ORMANIP_CUSTOMSELECTION__CLASSNAME
#define ORMANIP_CUSTOMSELECTION__LABEL "OR - Custom selection manipulator"
#define ORMANIP_CUSTOMSELECTION__DESC "OR - Custom selection manipulator that select root models only."
ORMANIP_CUSTOMSELECTION__LABEL,
ORMANIP_CUSTOMSELECTION__DESC,
bool ORManip_CustomSelection::FBCreate()
{
if( FBManipulator::FBCreate() )
{
DefaultBehavior = false;
ViewerText = "Custom selection manipulator";
return true;
}
return false;
}
void ORManip_CustomSelection::FBDestroy()
{
FBManipulator::FBDestroy();
}
void ORManip_CustomSelection::ViewExpose()
{
}
bool ORManip_CustomSelection::ViewInput(
int pMouseX,
int pMouseY,
FBInputType pAction,
int pButtonKey,
int pModifier)
{
static bool lPressed = false;
switch( pAction )
{
{
}
break;
{
}
break;
{
if(!lPressed){
for(
int i = 0;
i < lModels.GetCount();
i++)
{
lModels[
i]->Selected =
false;
}
}else{
PickRectStop();
for(
int i = 0;
i < PickGetCount();
i++)
{
if(PickGetModel(
i)->Parent ==
NULL)
PickGetModel(
i)->Selected =
true;
}
}
lPressed = !lPressed;
}
break;
{
}
break;
{
}
break;
{
if(lPressed)
PickRectMotion();
}
break;
{
}
break;
{
}
break;
}
return true;
}