diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpanelobject.cpp | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/linden/indra/newview/llpanelobject.cpp b/linden/indra/newview/llpanelobject.cpp index cc9d969..8efa39a 100644 --- a/linden/indra/newview/llpanelobject.cpp +++ b/linden/indra/newview/llpanelobject.cpp | |||
@@ -46,6 +46,7 @@ | |||
46 | // project includes | 46 | // project includes |
47 | #include "llagent.h" | 47 | #include "llagent.h" |
48 | #include "llbutton.h" | 48 | #include "llbutton.h" |
49 | #include "llcalc.h" | ||
49 | #include "llcheckboxctrl.h" | 50 | #include "llcheckboxctrl.h" |
50 | #include "llcolorswatch.h" | 51 | #include "llcolorswatch.h" |
51 | #include "llcombobox.h" | 52 | #include "llcombobox.h" |
@@ -341,6 +342,8 @@ void LLPanelObject::getState( ) | |||
341 | } | 342 | } |
342 | } | 343 | } |
343 | 344 | ||
345 | LLCalc* calcp = LLCalc::getInstance(); | ||
346 | |||
344 | LLVOVolume *volobjp = NULL; | 347 | LLVOVolume *volobjp = NULL; |
345 | if ( objectp && (objectp->getPCode() == LL_PCODE_VOLUME)) | 348 | if ( objectp && (objectp->getPCode() == LL_PCODE_VOLUME)) |
346 | { | 349 | { |
@@ -357,6 +360,7 @@ void LLPanelObject::getState( ) | |||
357 | 360 | ||
358 | // Disable all text input fields | 361 | // Disable all text input fields |
359 | clearCtrls(); | 362 | clearCtrls(); |
363 | calcp->clearAllVariables(); | ||
360 | return; | 364 | return; |
361 | } | 365 | } |
362 | 366 | ||
@@ -372,12 +376,18 @@ void LLPanelObject::getState( ) | |||
372 | mCtrlPosX->set( vec.mV[VX] ); | 376 | mCtrlPosX->set( vec.mV[VX] ); |
373 | mCtrlPosY->set( vec.mV[VY] ); | 377 | mCtrlPosY->set( vec.mV[VY] ); |
374 | mCtrlPosZ->set( vec.mV[VZ] ); | 378 | mCtrlPosZ->set( vec.mV[VZ] ); |
379 | calcp->setVar(LLCalc::X_POS, vec.mV[VX]); | ||
380 | calcp->setVar(LLCalc::Y_POS, vec.mV[VY]); | ||
381 | calcp->setVar(LLCalc::Z_POS, vec.mV[VZ]); | ||
375 | } | 382 | } |
376 | else | 383 | else |
377 | { | 384 | { |
378 | mCtrlPosX->clear(); | 385 | mCtrlPosX->clear(); |
379 | mCtrlPosY->clear(); | 386 | mCtrlPosY->clear(); |
380 | mCtrlPosZ->clear(); | 387 | mCtrlPosZ->clear(); |
388 | calcp->clearVar(LLCalc::X_POS); | ||
389 | calcp->clearVar(LLCalc::Y_POS); | ||
390 | calcp->clearVar(LLCalc::Z_POS); | ||
381 | } | 391 | } |
382 | 392 | ||
383 | 393 | ||
@@ -392,12 +402,18 @@ void LLPanelObject::getState( ) | |||
392 | mCtrlScaleX->set( vec.mV[VX] ); | 402 | mCtrlScaleX->set( vec.mV[VX] ); |
393 | mCtrlScaleY->set( vec.mV[VY] ); | 403 | mCtrlScaleY->set( vec.mV[VY] ); |
394 | mCtrlScaleZ->set( vec.mV[VZ] ); | 404 | mCtrlScaleZ->set( vec.mV[VZ] ); |
405 | calcp->setVar(LLCalc::X_SCALE, vec.mV[VX]); | ||
406 | calcp->setVar(LLCalc::Y_SCALE, vec.mV[VY]); | ||
407 | calcp->setVar(LLCalc::Z_SCALE, vec.mV[VZ]); | ||
395 | } | 408 | } |
396 | else | 409 | else |
397 | { | 410 | { |
398 | mCtrlScaleX->clear(); | 411 | mCtrlScaleX->clear(); |
399 | mCtrlScaleY->clear(); | 412 | mCtrlScaleY->clear(); |
400 | mCtrlScaleZ->clear(); | 413 | mCtrlScaleZ->clear(); |
414 | calcp->setVar(LLCalc::X_SCALE, 0.f); | ||
415 | calcp->setVar(LLCalc::Y_SCALE, 0.f); | ||
416 | calcp->setVar(LLCalc::Z_SCALE, 0.f); | ||
401 | } | 417 | } |
402 | 418 | ||
403 | mLabelSize->setEnabled( enable_scale ); | 419 | mLabelSize->setEnabled( enable_scale ); |
@@ -417,12 +433,18 @@ void LLPanelObject::getState( ) | |||
417 | mCtrlRotX->set( mCurEulerDegrees.mV[VX] ); | 433 | mCtrlRotX->set( mCurEulerDegrees.mV[VX] ); |
418 | mCtrlRotY->set( mCurEulerDegrees.mV[VY] ); | 434 | mCtrlRotY->set( mCurEulerDegrees.mV[VY] ); |
419 | mCtrlRotZ->set( mCurEulerDegrees.mV[VZ] ); | 435 | mCtrlRotZ->set( mCurEulerDegrees.mV[VZ] ); |
436 | calcp->setVar(LLCalc::X_ROT, mCurEulerDegrees.mV[VX]); | ||
437 | calcp->setVar(LLCalc::Y_ROT, mCurEulerDegrees.mV[VY]); | ||
438 | calcp->setVar(LLCalc::Z_ROT, mCurEulerDegrees.mV[VZ]); | ||
420 | } | 439 | } |
421 | else | 440 | else |
422 | { | 441 | { |
423 | mCtrlRotX->clear(); | 442 | mCtrlRotX->clear(); |
424 | mCtrlRotY->clear(); | 443 | mCtrlRotY->clear(); |
425 | mCtrlRotZ->clear(); | 444 | mCtrlRotZ->clear(); |
445 | calcp->clearVar(LLCalc::X_ROT); | ||
446 | calcp->clearVar(LLCalc::Y_ROT); | ||
447 | calcp->clearVar(LLCalc::Z_ROT); | ||
426 | } | 448 | } |
427 | 449 | ||
428 | mLabelRotation->setEnabled( enable_rotate ); | 450 | mLabelRotation->setEnabled( enable_rotate ); |
@@ -678,8 +700,9 @@ void LLPanelObject::getState( ) | |||
678 | F32 end_t = volume_params.getEndT(); | 700 | F32 end_t = volume_params.getEndT(); |
679 | 701 | ||
680 | // Hollowness | 702 | // Hollowness |
681 | F32 hollow = volume_params.getHollow(); | 703 | F32 hollow = 100.f * volume_params.getHollow(); |
682 | mSpinHollow->set( 100.f * hollow ); | 704 | mSpinHollow->set( hollow ); |
705 | calcp->setVar(LLCalc::HOLLOW, hollow); | ||
683 | 706 | ||
684 | // All hollow objects allow a shape to be selected. | 707 | // All hollow objects allow a shape to be selected. |
685 | if (hollow > 0.f) | 708 | if (hollow > 0.f) |
@@ -732,6 +755,10 @@ void LLPanelObject::getState( ) | |||
732 | mSpinCutEnd ->set( cut_end ); | 755 | mSpinCutEnd ->set( cut_end ); |
733 | mCtrlPathBegin ->set( adv_cut_begin ); | 756 | mCtrlPathBegin ->set( adv_cut_begin ); |
734 | mCtrlPathEnd ->set( adv_cut_end ); | 757 | mCtrlPathEnd ->set( adv_cut_end ); |
758 | calcp->setVar(LLCalc::CUT_BEGIN, cut_begin); | ||
759 | calcp->setVar(LLCalc::CUT_END, cut_end); | ||
760 | calcp->setVar(LLCalc::PATH_BEGIN, adv_cut_begin); | ||
761 | calcp->setVar(LLCalc::PATH_END, adv_cut_end); | ||
735 | 762 | ||
736 | // Twist | 763 | // Twist |
737 | F32 twist = volume_params.getTwist(); | 764 | F32 twist = volume_params.getTwist(); |
@@ -750,18 +777,24 @@ void LLPanelObject::getState( ) | |||
750 | 777 | ||
751 | mSpinTwist ->set( twist ); | 778 | mSpinTwist ->set( twist ); |
752 | mSpinTwistBegin ->set( twist_begin ); | 779 | mSpinTwistBegin ->set( twist_begin ); |
780 | calcp->setVar(LLCalc::TWIST_END, twist); | ||
781 | calcp->setVar(LLCalc::TWIST_BEGIN, twist_begin); | ||
753 | 782 | ||
754 | // Shear | 783 | // Shear |
755 | F32 shear_x = volume_params.getShearX(); | 784 | F32 shear_x = volume_params.getShearX(); |
756 | F32 shear_y = volume_params.getShearY(); | 785 | F32 shear_y = volume_params.getShearY(); |
757 | mSpinShearX->set( shear_x ); | 786 | mSpinShearX->set( shear_x ); |
758 | mSpinShearY->set( shear_y ); | 787 | mSpinShearY->set( shear_y ); |
788 | calcp->setVar(LLCalc::X_SHEAR, shear_x); | ||
789 | calcp->setVar(LLCalc::Y_SHEAR, shear_y); | ||
759 | 790 | ||
760 | // Taper | 791 | // Taper |
761 | F32 taper_x = volume_params.getTaperX(); | 792 | F32 taper_x = volume_params.getTaperX(); |
762 | F32 taper_y = volume_params.getTaperY(); | 793 | F32 taper_y = volume_params.getTaperY(); |
763 | mSpinTaperX->set( taper_x ); | 794 | mSpinTaperX->set( taper_x ); |
764 | mSpinTaperY->set( taper_y ); | 795 | mSpinTaperY->set( taper_y ); |
796 | calcp->setVar(LLCalc::X_TAPER, taper_x); | ||
797 | calcp->setVar(LLCalc::Y_TAPER, taper_y); | ||
765 | 798 | ||
766 | // Radius offset. | 799 | // Radius offset. |
767 | F32 radius_offset = volume_params.getRadiusOffset(); | 800 | F32 radius_offset = volume_params.getRadiusOffset(); |
@@ -791,10 +824,12 @@ void LLPanelObject::getState( ) | |||
791 | } | 824 | } |
792 | } | 825 | } |
793 | mSpinRadiusOffset->set( radius_offset); | 826 | mSpinRadiusOffset->set( radius_offset); |
827 | calcp->setVar(LLCalc::RADIUS_OFFSET, radius_offset); | ||
794 | 828 | ||
795 | // Revolutions | 829 | // Revolutions |
796 | F32 revolutions = volume_params.getRevolutions(); | 830 | F32 revolutions = volume_params.getRevolutions(); |
797 | mSpinRevolutions->set( revolutions ); | 831 | mSpinRevolutions->set( revolutions ); |
832 | calcp->setVar(LLCalc::REVOLUTIONS, revolutions); | ||
798 | 833 | ||
799 | // Skew | 834 | // Skew |
800 | F32 skew = volume_params.getSkew(); | 835 | F32 skew = volume_params.getSkew(); |
@@ -819,6 +854,7 @@ void LLPanelObject::getState( ) | |||
819 | } | 854 | } |
820 | } | 855 | } |
821 | mSpinSkew->set( skew ); | 856 | mSpinSkew->set( skew ); |
857 | calcp->setVar(LLCalc::SKEW, skew); | ||
822 | } | 858 | } |
823 | 859 | ||
824 | // Compute control visibility, label names, and twist range. | 860 | // Compute control visibility, label names, and twist range. |
@@ -924,6 +960,8 @@ void LLPanelObject::getState( ) | |||
924 | case MI_RING: | 960 | case MI_RING: |
925 | mSpinScaleX->set( scale_x ); | 961 | mSpinScaleX->set( scale_x ); |
926 | mSpinScaleY->set( scale_y ); | 962 | mSpinScaleY->set( scale_y ); |
963 | calcp->setVar(LLCalc::X_HOLE, scale_x); | ||
964 | calcp->setVar(LLCalc::Y_HOLE, scale_y); | ||
927 | mSpinScaleX->setMinValue(OBJECT_MIN_HOLE_SIZE); | 965 | mSpinScaleX->setMinValue(OBJECT_MIN_HOLE_SIZE); |
928 | mSpinScaleX->setMaxValue(OBJECT_MAX_HOLE_SIZE_X); | 966 | mSpinScaleX->setMaxValue(OBJECT_MAX_HOLE_SIZE_X); |
929 | mSpinScaleY->setMinValue(OBJECT_MIN_HOLE_SIZE); | 967 | mSpinScaleY->setMinValue(OBJECT_MIN_HOLE_SIZE); |
@@ -934,6 +972,8 @@ void LLPanelObject::getState( ) | |||
934 | { | 972 | { |
935 | mSpinScaleX->set( 1.f - scale_x ); | 973 | mSpinScaleX->set( 1.f - scale_x ); |
936 | mSpinScaleY->set( 1.f - scale_y ); | 974 | mSpinScaleY->set( 1.f - scale_y ); |
975 | calcp->setVar(LLCalc::X_HOLE, 1.f - scale_x); | ||
976 | calcp->setVar(LLCalc::Y_HOLE, 1.f - scale_y); | ||
937 | mSpinScaleX->setMinValue(-1.f); | 977 | mSpinScaleX->setMinValue(-1.f); |
938 | mSpinScaleX->setMaxValue(1.f); | 978 | mSpinScaleX->setMaxValue(1.f); |
939 | mSpinScaleY->setMinValue(-1.f); | 979 | mSpinScaleY->setMinValue(-1.f); |
@@ -1148,7 +1188,7 @@ void LLPanelObject::getState( ) | |||
1148 | mSculptTextureRevert = LLUUID::null; | 1188 | mSculptTextureRevert = LLUUID::null; |
1149 | } | 1189 | } |
1150 | 1190 | ||
1151 | 1191 | ||
1152 | //---------------------------------------------------------------------------- | 1192 | //---------------------------------------------------------------------------- |
1153 | 1193 | ||
1154 | mObject = objectp; | 1194 | mObject = objectp; |
@@ -1954,6 +1994,9 @@ void LLPanelObject::onCommitRotation( LLUICtrl* ctrl, void* userdata ) | |||
1954 | LLPanelObject* self = (LLPanelObject*) userdata; | 1994 | LLPanelObject* self = (LLPanelObject*) userdata; |
1955 | BOOL btn_down = ((LLSpinCtrl*)ctrl)->isMouseHeldDown() ; | 1995 | BOOL btn_down = ((LLSpinCtrl*)ctrl)->isMouseHeldDown() ; |
1956 | self->sendRotation(btn_down); | 1996 | self->sendRotation(btn_down); |
1997 | |||
1998 | // Needed to ensure all rotations are shown consistently in range | ||
1999 | self->refresh(); | ||
1957 | } | 2000 | } |
1958 | 2001 | ||
1959 | // static | 2002 | // static |