MCPcopy Create free account
hub / github.com/NatLabRockies/SAM / SetObject

Method SetObject

src/s3tool.cpp:559–630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

557}
558
559void ObjectEditor::SetObject( VObject *obj )
560{
561 m_curObject = 0;
562
563 m_duplicate->Hide();
564 m_delete->Hide();
565
566 // clear the property grid
567 m_curProps.clear();
568 m_propGrid->Clear();
569 m_objList->SetSelection( m_objList->GetSelection(), false );
570
571 if ( obj == 0 )
572 {
573 Layout();
574 return;
575 }
576
577 m_curObject = obj;
578
579 if ( m_view != 0 )
580 {
581 int index = m_view->GetObjectIndex( obj );
582 if ( m_objList->GetSelection() != index )
583 m_objList->SetSelection( index );
584 }
585
586 wxArrayString list = obj->Properties();
587 for ( size_t i=0; i<list.Count();i++ )
588 {
589 VProperty &p = obj->Property( list[i] );
590
591 wxPGProperty *pg = 0;
592 switch( p.GetType() )
593 {
594 case VProperty::DOUBLE:
595 pg = new wxFloatProperty( list[i], wxPG_LABEL );
596 break;
597 case VProperty::INTEGER:
598 if ( p.GetChoices().size() == 0 )
599 pg = new wxIntProperty( list[i], wxPG_LABEL );
600 else
601 pg = new wxEnumProperty( list[i], wxPG_LABEL, p.GetChoices() );
602 break;
603 case VProperty::STRING:
604 pg = new wxStringProperty( list[i], wxPG_LABEL);
605 break;
606 case VProperty::BOOLEAN:
607 pg = new wxBoolProperty( list[i], wxPG_LABEL );
608 break;
609 case VProperty::COLOUR:
610 pg = new wxColourProperty( list[i], wxPG_LABEL );
611 pg->SetAttribute( "HasAlpha", true );
612 break;
613 }
614
615 if ( pg != 0 )
616 {

Callers 11

fcall_clear_sceneFunction · 0.80
fcall_deleteFunction · 0.80
OnUpdateSelectionMethod · 0.80
OnCommandMethod · 0.80
SaveDefaultsMethod · 0.80
Write_JSONMethod · 0.80
Write_JSON_ConstantMethod · 0.80
WritePythonConfigFunction · 0.80
OnModifyMethod · 0.80
OnDeleteVarMethod · 0.80
Write_JSONMethod · 0.80

Calls 11

SetSelectionMethod · 0.80
GetObjectIndexMethod · 0.80
PropertiesMethod · 0.80
CountMethod · 0.80
sizeMethod · 0.80
clearMethod · 0.45
ClearMethod · 0.45
GetSelectionMethod · 0.45
GetTypeMethod · 0.45
GetChoicesMethod · 0.45
ShowMethod · 0.45

Tested by

no test coverage detected