Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
d98769eb
Commit
d98769eb
authored
12 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Moving FLTK based macro in a separate header to avoid implicit inclusion of X11 files
parent
fa9c980d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Common/otbMacro.h
+0
-74
0 additions, 74 deletions
Code/Common/otbMacro.h
Code/Visualization/otbVisualizationMacro.h
+98
-0
98 additions, 0 deletions
Code/Visualization/otbVisualizationMacro.h
with
98 additions
and
74 deletions
Code/Common/otbMacro.h
+
0
−
74
View file @
d98769eb
...
@@ -222,78 +222,4 @@ namespace otb
...
@@ -222,78 +222,4 @@ namespace otb
} \
} \
}
}
#ifdef OTB_USE_VISU_GUI
#include
<FL/Fl.H>
// Replace th Fl::run method
#define otbFlRunMacro(condition) { while (condition) { Fl::wait(1e20); } }
// Check if application running or will be stopped
#define otbRunningMacro() \
private: \
virtual void StartRunning() {this->m_Running = true; } \
virtual void StopRunning() {this->m_Running = false; } \
bool m_Running; \
public: \
virtual bool IsRunning() { return this->m_Running; }
#define otbTestCallbackWithValue(view, button, button_value) \
{ \
std::cout << "Line " << __LINE__ << ", testing widget " << # button << " of view " << view->GetNameOfClass() << \
" with value " << # button_value << ": "; \
if (view->button->active() && (view->button->callback())) \
{ \
std::cout << " active, triggering callback." << std::endl; \
view->button->value(button_value); \
view->button->do_callback(view->button); \
Fl::check(); \
} \
else \
{ \
std::cout << "inactive." << std::endl; \
} \
}
#define otbTestCallback(view, button) \
{ \
std::cout << "Line " << __LINE__ << ", testing widget " << # button << " of view " << view->GetNameOfClass() << \
": "; \
if (view->button->active() && (view->button->callback())) \
{ \
std::cout << " active, triggering callback." << std::endl; \
view->button->do_callback(view->button); \
Fl::check(); \
} \
else \
{ \
std::cout << "inactive." << std::endl; \
} \
}
#define otbTestMenuItemCallback(view, menubar, button) \
{ \
std::cout << "Line " << __LINE__ << ", testing menu item " << # button << " from menu bar " << # menubar << \
" of view " << view->GetNameOfClass() << ": "; \
if (view->button->active() && (view->button->callback())) \
{ \
std::cout << " active, triggering callback." << std::endl; \
view->button->do_callback(view->menubar); \
Fl::check(); \
} \
else \
{ \
std::cout << "inactive." << std::endl; \
} \
}
#else
#define otbFlRunMacro(condition)
#define otbRunningMacro()
#define otbTestCallbackWithValue(view, button, button_value)
#define otbTestCallback(view, button)
#define otbTestMenuItemCallback(view, menubar, button)
#endif
#endif //end of otbMacro.h
#endif //end of otbMacro.h
This diff is collapsed.
Click to expand it.
Code/Visualization/otbVisualizationMacro.h
0 → 100644
+
98
−
0
View file @
d98769eb
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbVisualizationMacro_h
#define __otbVisualizationMacro_h
/**
* otbVisualizationMacro.h defines visualization related macros.
*/
#ifdef OTB_USE_VISU_GUI
#include
<FL/Fl.H>
// Replace th Fl::run method
#define otbFlRunMacro(condition) { while (condition) { Fl::wait(1e20); } }
// Check if application running or will be stopped
#define otbRunningMacro() \
private: \
virtual void StartRunning() {this->m_Running = true; } \
virtual void StopRunning() {this->m_Running = false; } \
bool m_Running; \
public: \
virtual bool IsRunning() { return this->m_Running; }
#define otbTestCallbackWithValue(view, button, button_value) \
{ \
std::cout << "Line " << __LINE__ << ", testing widget " << # button << " of view " << view->GetNameOfClass() << \
" with value " << # button_value << ": "; \
if (view->button->active() && (view->button->callback())) \
{ \
std::cout << " active, triggering callback." << std::endl; \
view->button->value(button_value); \
view->button->do_callback(view->button); \
Fl::check(); \
} \
else \
{ \
std::cout << "inactive." << std::endl; \
} \
}
#define otbTestCallback(view, button) \
{ \
std::cout << "Line " << __LINE__ << ", testing widget " << # button << " of view " << view->GetNameOfClass() << \
": "; \
if (view->button->active() && (view->button->callback())) \
{ \
std::cout << " active, triggering callback." << std::endl; \
view->button->do_callback(view->button); \
Fl::check(); \
} \
else \
{ \
std::cout << "inactive." << std::endl; \
} \
}
#define otbTestMenuItemCallback(view, menubar, button) \
{ \
std::cout << "Line " << __LINE__ << ", testing menu item " << # button << " from menu bar " << # menubar << \
" of view " << view->GetNameOfClass() << ": "; \
if (view->button->active() && (view->button->callback())) \
{ \
std::cout << " active, triggering callback." << std::endl; \
view->button->do_callback(view->menubar); \
Fl::check(); \
} \
else \
{ \
std::cout << "inactive." << std::endl; \
} \
}
#else
#define otbFlRunMacro(condition)
#define otbRunningMacro()
#define otbTestCallbackWithValue(view, button, button_value)
#define otbTestCallback(view, button)
#define otbTestMenuItemCallback(view, menubar, button)
#endif
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment