}
bool pre( const scene::Path& path, scene::Instance& instance ) const {
- Selectable* selectable = Instance_getSelectable( instance );
+ if( path.top().get().visible() ){
+ Selectable* selectable = Instance_getSelectable( instance );
- // ignore worldspawn
- Entity* entity = Node_getEntity( path.top() );
- if ( entity ) {
- if ( string_equal( entity->getKeyValue( "classname" ), "worldspawn" ) ) {
- return true;
+ // ignore worldspawn
+ Entity* entity = Node_getEntity( path.top() );
+ if ( entity ) {
+ if ( string_equal( entity->getKeyValue( "classname" ), "worldspawn" ) ) {
+ return true;
+ }
}
- }
- if ( ( path.size() > 1 ) &&
- ( !path.top().get().isRoot() ) &&
- ( selectable != 0 )
- ) {
- for ( Unsigned i = 0; i < m_count; ++i )
- {
- if ( policy.Evaluate( m_aabbs[i], instance ) ) {
- selectable->setSelected( true );
+ if ( ( path.size() > 1 ) &&
+ ( !path.top().get().isRoot() ) &&
+ ( selectable != 0 ) &&
+ ( !node_is_group( path.top() ) )
+ ) {
+ for ( Unsigned i = 0; i < m_count; ++i )
+ {
+ if ( policy.Evaluate( m_aabbs[i], instance ) ) {
+ selectable->setSelected( true );
+ }
}
}
}
+ else{
+ return false;
+ }
return true;
}
: m_mode( mode ), m_selectable( 0 ){
}
bool pre( const scene::Path& path, scene::Instance& instance ) const {
+ if( !path.top().get().visible() ){
+ m_selectable = 0;
+ return false;
+ }
Selectable* selectable = Instance_getSelectable( instance );
if ( selectable ) {
switch ( m_mode )
Select_GetBounds( g_select_workzone.d_work_min, g_select_workzone.d_work_max );
}
}
-typedef FreeCaller<Selection_UpdateWorkzone> SelectionUpdateWorkzoneCaller;
+typedef FreeCaller<void(), Selection_UpdateWorkzone> SelectionUpdateWorkzoneCaller;
IdleDraw g_idleWorkzone = IdleDraw( SelectionUpdateWorkzoneCaller() );
}
: m_propertyvalues( propertyvalues ), m_prop( prop ){
}
bool pre( const scene::Path& path, scene::Instance& instance ) const {
+ if( !path.top().get().visible() ){
+ return false;
+ }
Entity* entity = Node_getEntity( path.top() );
if ( entity != 0
&& propertyvalues_contain( m_propertyvalues, entity->getKeyValue( m_prop ) ) ) {
SignalHandlerId Selection_boundsChanged;
void Selection_construct(){
- typedef FreeCaller1<const Selectable&, SceneSelectionChange> SceneSelectionChangeCaller;
+ typedef FreeCaller<void(const Selectable&), SceneSelectionChange> SceneSelectionChangeCaller;
GlobalSelectionSystem().addSelectionChangeCallback( SceneSelectionChangeCaller() );
- typedef FreeCaller1<const Selectable&, UpdateWorkzone_ForSelectionChanged> UpdateWorkzoneForSelectionChangedCaller;
+ typedef FreeCaller<void(const Selectable&), UpdateWorkzone_ForSelectionChanged> UpdateWorkzoneForSelectionChangedCaller;
GlobalSelectionSystem().addSelectionChangeCallback( UpdateWorkzoneForSelectionChangedCaller() );
- typedef FreeCaller<UpdateWorkzone_ForSelection> UpdateWorkzoneForSelectionCaller;
+ typedef FreeCaller<void(), UpdateWorkzone_ForSelection> UpdateWorkzoneForSelectionCaller;
Selection_boundsChanged = GlobalSceneGraph().addBoundsChangedCallback( UpdateWorkzoneForSelectionCaller() );
}
struct RotateDialog
{
- GtkSpinButton* x;
- GtkSpinButton* y;
- GtkSpinButton* z;
+ ui::SpinButton x{ui::null};
+ ui::SpinButton y{ui::null};
+ ui::SpinButton z{ui::null};
ui::Window window{ui::null};
};
static gboolean rotatedlg_apply( ui::Widget widget, RotateDialog* rotateDialog ){
Vector3 eulerXYZ;
+ gtk_spin_button_update ( rotateDialog->x );
+ gtk_spin_button_update ( rotateDialog->y );
+ gtk_spin_button_update ( rotateDialog->z );
eulerXYZ[0] = static_cast<float>( gtk_spin_button_get_value( rotateDialog->x ) );
eulerXYZ[1] = static_cast<float>( gtk_spin_button_get_value( rotateDialog->y ) );
eulerXYZ[2] = static_cast<float>( gtk_spin_button_get_value( rotateDialog->z ) );
static gboolean rotatedlg_ok( ui::Widget widget, RotateDialog* rotateDialog ){
rotatedlg_apply( widget, rotateDialog );
+// rotatedlg_cancel( widget, rotateDialog );
rotateDialog->window.hide();
return TRUE;
}
{
ui::Widget label = ui::Label( " X " );
label.show();
- gtk_table_attach( table, label, 0, 1, 0, 1,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(label, {0, 1, 0, 1}, {0, 0});
}
{
ui::Widget label = ui::Label( " Y " );
label.show();
- gtk_table_attach( table, label, 0, 1, 1, 2,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(label, {0, 1, 1, 2}, {0, 0});
}
{
ui::Widget label = ui::Label( " Z " );
label.show();
- gtk_table_attach( table, label, 0, 1, 2, 3,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(label, {0, 1, 2, 3}, {0, 0});
}
{
auto adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
auto spin = ui::SpinButton( adj, 1, 0 );
spin.show();
- gtk_table_attach( table, spin , 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_size_request( spin , 64, -1 );
+ table.attach(spin, {1, 2, 0, 1}, {GTK_EXPAND | GTK_FILL, 0});
+ spin.dimensions(64, -1);
gtk_spin_button_set_wrap( spin, TRUE );
gtk_widget_grab_focus( spin );
auto adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
auto spin = ui::SpinButton( adj, 1, 0 );
spin.show();
- gtk_table_attach( table, spin , 1, 2, 1, 2,
- (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_size_request( spin , 64, -1 );
+ table.attach(spin, {1, 2, 1, 2}, {GTK_EXPAND | GTK_FILL, 0});
+ spin.dimensions(64, -1);
gtk_spin_button_set_wrap( spin, TRUE );
g_rotate_dialog.y = spin;
auto adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
auto spin = ui::SpinButton( adj, 1, 0 );
spin.show();
- gtk_table_attach( table, spin , 1, 2, 2, 3,
- (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_size_request( spin , 64, -1 );
+ table.attach(spin, {1, 2, 2, 3}, {GTK_EXPAND | GTK_FILL, 0});
+ spin.dimensions(64, -1);
gtk_spin_button_set_wrap( spin, TRUE );
g_rotate_dialog.z = spin;
static gboolean scaledlg_ok( ui::Widget widget, ScaleDialog* scaleDialog ){
scaledlg_apply( widget, scaleDialog );
+ //scaledlg_cancel( widget, scaleDialog );
scaleDialog->window.hide();
return TRUE;
}
{
ui::Widget label = ui::Label( " X " );
label.show();
- gtk_table_attach( table, label, 0, 1, 0, 1,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(label, {0, 1, 0, 1}, {0, 0});
}
{
ui::Widget label = ui::Label( " Y " );
label.show();
- gtk_table_attach( table, label, 0, 1, 1, 2,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(label, {0, 1, 1, 2}, {0, 0});
}
{
ui::Widget label = ui::Label( " Z " );
label.show();
- gtk_table_attach( table, label, 0, 1, 2, 3,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(label, {0, 1, 2, 3}, {0, 0});
}
{
auto entry = ui::Entry(ui::New);
entry.text("1.0");
entry.show();
- gtk_table_attach( table, entry, 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(entry, {1, 2, 0, 1}, {GTK_EXPAND | GTK_FILL, 0});
g_scale_dialog.x = entry;
}
auto entry = ui::Entry(ui::New);
entry.text("1.0");
entry.show();
- gtk_table_attach( table, entry, 1, 2, 1, 2,
- (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(entry, {1, 2, 1, 2}, {GTK_EXPAND | GTK_FILL, 0});
g_scale_dialog.y = entry;
}
auto entry = ui::Entry(ui::New);
entry.text("1.0");
entry.show();
- gtk_table_attach( table, entry, 1, 2, 2, 3,
- (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
+ table.attach(entry, {1, 2, 2, 3}, {GTK_EXPAND | GTK_FILL, 0});
g_scale_dialog.z = entry;
}