本文整理汇总了C++中InternalWindowRefPtr::setBorders方法的典型用法代码示例。如果您正苦于以下问题:C++ InternalWindowRefPtr::setBorders方法的具体用法?C++ InternalWindowRefPtr::setBorders怎么用?C++ InternalWindowRefPtr::setBorders使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InternalWindowRefPtr
的用法示例。
在下文中一共展示了InternalWindowRefPtr::setBorders方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv)
{
// OSG init
osgInit(argc,argv);
// Set up Window
TutorialWindow = createNativeWindow();
TutorialWindow->initWindow();
TutorialWindow->setDisplayCallback(display);
TutorialWindow->setReshapeCallback(reshape);
TutorialMouseListener mouseListener;
TutorialMouseMotionListener mouseMotionListener;
TutorialWindow->addMouseListener(&mouseListener);
TutorialWindow->addMouseMotionListener(&mouseMotionListener);
TutorialKeyListener TheKeyListener;
TutorialWindow->addKeyListener(&TheKeyListener);
// Create the SimpleSceneManager helper
mgr = new SimpleSceneManager;
// Tell the Manager what to manage
mgr->setWindow(TutorialWindow);
// Set up Window
//Load in File
NodeRefPtr LoadedFile = SceneFileHandler::the()->read("C:\\Documents and Settings\\All Users\\Documents\\Cell.osb");
// Make Main Scene Node
create3DObjects();
scene = OSG::Node::create();
scene->setCore(OSG::Group::create());
scene->addChild(LoadedFile);
// Create the Graphics
GraphicsRefPtr TutorialGraphics = OSG::Graphics2D::create();
// Initialize the LookAndFeelManager to enable default settings
LookAndFeelManager::the()->getLookAndFeel()->init();
/******************************************************
Create a Background
******************************************************/
ColorLayerRefPtr GreyBackground = OSG::ColorLayer::create();
GreyBackground->setColor(Color4f(.93,.93,.93,1.0));
/******************************************************
Create some Borders
******************************************************/
LineBorderRefPtr PanelBorder = OSG::LineBorder::create();
EmptyBorderRefPtr Panel1Border = OSG::EmptyBorder::create();
EmptyBorderRefPtr Panel2Border = OSG::EmptyBorder::create();
EmptyBorderRefPtr emptyBorder = OSG::EmptyBorder::create();
PanelBorder->setColor(Color4f(0.0,0.0,0.0,1.0));
PanelBorder->setWidth(1);
Panel1Border->setTopWidth(0);
Panel1Border->setBottomWidth(6);
Panel1Border->setLeftWidth(0);
Panel1Border->setRightWidth(0);
Panel2Border->setTopWidth(0);
Panel2Border->setBottomWidth(0);
Panel2Border->setLeftWidth(0);
Panel2Border->setRightWidth(0);
/******************************************************
Create some Labels and stuff to go
with them
******************************************************/
LabelRefPtr LeftPanelLabel1 = OSG::Label::create();
UIFontRefPtr LeftPanelLabel1Font = OSG::UIFont::create();
LeftPanelLabel1Font->setSize(50);
LeftPanelLabel1->setBorders(emptyBorder);
LeftPanelLabel1->setBackgrounds(GreyBackground);
LeftPanelLabel1->setFont(LeftPanelLabel1Font);
LeftPanelLabel1->setText("OSG Gui");
LeftPanelLabel1->setPreferredSize(Vec2f(300, 100));
LeftPanelLabel1->setAlignment(Vec2f(0.0f, 0.5f));
/******************************************************
Create some Layouts
******************************************************/
//.........这里部分代码省略.........
示例2: main
//.........这里部分代码省略.........
LabelRefPtr NodeActiveLabel = Label::create();
NodeActiveLabel->setText("Active");
NodeActiveLabel->setPreferredSize(Vec2f(100.0f, 20.0f));
NodeActiveValueLabel = Label::create();
NodeActiveValueLabel->setPreferredSize(Vec2f(300.0f, 20.0f));
//Details Panel
BorderLayoutConstraintsRefPtr NodeDetailPanelConstraints = OSG::BorderLayoutConstraints::create();
NodeDetailPanelConstraints->setRegion(BorderLayoutConstraints::BORDER_SOUTH);
GridLayoutRefPtr NodeDetailPanelLayout = OSG::GridLayout::create();
NodeDetailPanelLayout->setRows(9);
NodeDetailPanelLayout->setColumns(2);
NodeDetailPanelLayout->setHorizontalGap(2);
NodeDetailPanelLayout->setVerticalGap(2);
PanelRefPtr NodeDetailPanel = Panel::create();
NodeDetailPanel->setConstraints(NodeDetailPanelConstraints);
NodeDetailPanel->setPreferredSize(Vec2f(100.0f, 200.0f));
NodeDetailPanel->setLayout(NodeDetailPanelLayout);
NodeDetailPanel->pushToChildren(NodeNameLabel);
NodeDetailPanel->pushToChildren(NodeNameValueLabel);
NodeDetailPanel->pushToChildren(NodeCoreTypeLabel);
NodeDetailPanel->pushToChildren(NodeCoreTypeValueLabel);
NodeDetailPanel->pushToChildren(NodeMinLabel);
NodeDetailPanel->pushToChildren(NodeMinValueLabel);
NodeDetailPanel->pushToChildren(NodeMaxLabel);
NodeDetailPanel->pushToChildren(NodeMaxValueLabel);
NodeDetailPanel->pushToChildren(NodeCenterLabel);
NodeDetailPanel->pushToChildren(NodeCenterValueLabel);
NodeDetailPanel->pushToChildren(NodeTriCountLabel);
NodeDetailPanel->pushToChildren(NodeTriCountValueLabel);
NodeDetailPanel->pushToChildren(NodeTravMaskLabel);
NodeDetailPanel->pushToChildren(NodeTravMaskValueLabel);
NodeDetailPanel->pushToChildren(NodeOcclusionMaskLabel);
NodeDetailPanel->pushToChildren(NodeOcclusionMaskValueLabel);
NodeDetailPanel->pushToChildren(NodeActiveLabel);
NodeDetailPanel->pushToChildren(NodeActiveValueLabel);
// Create The Main InternalWindow
// Create Background to be used with the Main InternalWindow
ColorLayerRefPtr MainInternalWindowBackground = OSG::ColorLayer::create();
MainInternalWindowBackground->setColor(Color4f(1.0,1.0,1.0,0.5));
LayoutRefPtr MainInternalWindowLayout = OSG::BorderLayout::create();
InternalWindowRefPtr MainInternalWindow = OSG::InternalWindow::create();
MainInternalWindow->pushToChildren(ExampleScrollPanel);
MainInternalWindow->pushToChildren(NodeDetailPanel);
MainInternalWindow->setLayout(MainInternalWindowLayout);
MainInternalWindow->setBackgrounds(NULL);
MainInternalWindow->setBorders(NULL);
MainInternalWindow->setAlignmentInDrawingSurface(Vec2f(0.0f,0.5f));
MainInternalWindow->setScalingInDrawingSurface(Vec2f(1.0,1.0));
MainInternalWindow->setDrawTitlebar(false);
MainInternalWindow->setResizable(false);
// Create the Drawing Surface
UIDrawingSurfaceRefPtr TutorialDrawingSurface = UIDrawingSurface::create();
TutorialDrawingSurface->setGraphics(TutorialGraphics);
TutorialDrawingSurface->setEventProducer(TutorialWindow);
TutorialDrawingSurface->openWindow(MainInternalWindow);
// Create the UI Foreground Object
UIForegroundRefPtr TutorialUIForeground = OSG::UIForeground::create();
TutorialUIForeground->setDrawingSurface(TutorialDrawingSurface);
// Create the SimpleSceneManager helper
mgr = new SimpleSceneManager;
// Tell the Manager what to manage
mgr->setWindow(TutorialWindow);
mgr->setRoot(Root);
// Add the UI Foreground Object to the Scene
ViewportRefPtr TutorialViewport = mgr->getWindow()->getPort(0);
TutorialViewport->addForeground(TutorialUIForeground);
// Show the whole Scene
mgr->showAll();
//Open Window
Vec2f WinSize(TutorialWindow->getDesktopSize() * 0.85f);
Pnt2f WinPos((TutorialWindow->getDesktopSize() - WinSize) *0.5);
TutorialWindow->openWindow(WinPos,
WinSize,
"52SceneGraphTree");
//Enter main Loop
TutorialWindow->mainLoop();
osgExit();
return 0;
}
示例3: main
//.........这里部分代码省略.........
/******************************************************
Create MainMenuBar and adds the Menus
created above to it.
Also creates several Backgrounds
to improve MenuBar overall look.
Both the MenuBar and Menu can have
Backgrounds; the set up currently
is to have EmptyBackgrounds in
each Menu allowing a single
overall MenuBar Background which
is given to the MenuBar itself.
This can be easily changed by adding
different Backgrounds to the
File and Edit Menus.
Note: The MenuBar is added to the
MainFrame below.
******************************************************/
// Creates two Backgrounds
MenuBarRefPtr MainMenuBar = MenuBar::create();
// Adds the two Menus to the MainMenuBar
MainMenuBar->addMenu(FileMenu);
MainMenuBar->addMenu(EditMenu);
// Create two Labels
LabelRefPtr ExampleLabel1 = OSG::Label::create();
LabelRefPtr ExampleLabel2 = OSG::Label::create();
ExampleLabel1->setText("Look up in the corner!");
ExampleLabel1->setPreferredSize(Vec2f(150, 25));
ExampleLabel2->setText("Hit Control + Z");
ExampleLabel2->setPreferredSize(Vec2f(150, 25));
// Create The Main InternalWindow
// Create Background to be used with the Main InternalWindow
EmptyLayerRefPtr MainInternalWindowBackground = OSG::EmptyLayer::create();
EmptyBorderRefPtr MainInternalWindowBorder = OSG::EmptyBorder::create();
LayoutRefPtr MainInternalWindowLayout = OSG::FlowLayout::create();
InternalWindowRefPtr MainInternalWindow = OSG::InternalWindow::create();
MainInternalWindow->pushToChildren(ExampleLabel1);
MainInternalWindow->pushToChildren(ExampleLabel2);
MainInternalWindow->setLayout(MainInternalWindowLayout);
MainInternalWindow->setMenuBar(MainMenuBar);
MainInternalWindow->setBackgrounds(MainInternalWindowBackground);
MainInternalWindow->setBorders(MainInternalWindowBorder);
MainInternalWindow->setAlignmentInDrawingSurface(Vec2f(0.5f,0.5f));
MainInternalWindow->setScalingInDrawingSurface(Vec2f(1.0f,1.0f));
MainInternalWindow->setDrawTitlebar(false);
MainInternalWindow->setResizable(false);
// Create the Drawing Surface
UIDrawingSurfaceRefPtr TutorialDrawingSurface = UIDrawingSurface::create();
TutorialDrawingSurface->setGraphics(TutorialGraphics);
TutorialDrawingSurface->setEventProducer(TutorialWindow);
TutorialDrawingSurface->openWindow(MainInternalWindow);
// Create the UI Foreground Object
UIForegroundRefPtr TutorialUIForeground = OSG::UIForeground::create();
TutorialUIForeground->setDrawingSurface(TutorialDrawingSurface);
// Create the SimpleSceneManager helper
mgr = new SimpleSceneManager;
// Tell the Manager what to manage
mgr->setWindow(TutorialWindow);
mgr->setRoot(scene);
// Add the UI Foreground Object to the Scene
ViewportRefPtr TutorialViewport = mgr->getWindow()->getPort(0);
TutorialViewport->addForeground(TutorialUIForeground);
// Show the whole Scene
mgr->showAll();
//Open Window
Vec2f WinSize(TutorialWindow->getDesktopSize() * 0.85f);
Pnt2f WinPos((TutorialWindow->getDesktopSize() - WinSize) *0.5);
TutorialWindow->openWindow(WinPos,
WinSize,
"26MenuBar");
//Enter main Loop
TutorialWindow->mainLoop();
osgExit();
return 0;
}