示例#1
0
void EditableSceneBodyImpl::updateMarkersAndManipulators()
{
    bool show = (isEditMode && !self->body()->isStaticModel());
    
    Link* baseLink = bodyItem->currentBaseLink();
    PinDragIKptr pin = bodyItem->pinDragIK();

    const int n = self->numSceneLinks();
    for(int i=0; i < n; ++i){
        EditableSceneLink* sceneLink = editableSceneLink(i);
        sceneLink->hideMarker();
        sceneLink->removeChild(positionDragger);
        if(show){
            Link* link = sceneLink->link();
            if(link == baseLink){
                sceneLink->showMarker(Vector3f(1.0f, 0.1f, 0.1f), 0.4);
            } else {
                int pinAxes = pin->pinAxes(link);
                if(pinAxes & (InverseKinematics::TRANSFORM_6D)){
                    sceneLink->showMarker(Vector3f(1.0f, 1.0f, 0.1f), 0.4);
                }
            }
        }
    }

    if(show && targetLink && (kinematicsBar->mode() == KinematicsBar::IK_MODE) && kinematicsBar->isAttitudeMode()){
        attachPositionDragger(targetLink);
    }

    self->notifyUpdate(modified);
}
示例#2
0
void EditableSceneBodyImpl::updateMarkersAndManipulators()
{
    Link* baseLink = bodyItem->currentBaseLink();
    PinDragIKptr pin = bodyItem->pinDragIK();

    const int n = self->numSceneLinks();
    for(int i=0; i < n; ++i){
        EditableSceneLink* sceneLink = editableSceneLink(i);
        sceneLink->hideMarker();
        sceneLink->removeChild(positionDragger);
        markerGroup->removeChild(positionDragger);

        if(isEditMode && !activeSimulatorItem){
            Link* link = sceneLink->link();
            if(link == baseLink){
                sceneLink->showMarker(Vector3f(1.0f, 0.1f, 0.1f), 0.4);
            } else {
                int pinAxes = pin->pinAxes(link);
                if(pinAxes & (InverseKinematics::TRANSFORM_6D)){
                    sceneLink->showMarker(Vector3f(1.0f, 1.0f, 0.1f), 0.4);
                }
            }
        }
    }

    bool showDragger = isEditMode && targetLink && kinematicsBar->isPositionDraggerEnabled();
    if(showDragger){
        if(activeSimulatorItem){
            showDragger = forcedPositionMode != NO_FORCED_POSITION;
                } else {
            showDragger = (kinematicsBar->mode() == KinematicsBar::IK_MODE);
        }
    }
        
    if(showDragger){
        attachPositionDragger(targetLink);
    }

    self->notifyUpdate(modified);
}