1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0024133: Development of improvement of dimensions implementation; new length, radius,diameter and angle dimensions.

Some corrections; test cases were added; coding standards in MFC samples & presentations
Request stencil buffer for Linux.
correct test cases; correct compilation errors
compilation warnings (gcc/Linux)
This commit is contained in:
aba
2013-10-31 16:49:38 +04:00
committed by bugmaster
parent 7c633a3eab
commit a6eb515f9d
137 changed files with 7591 additions and 6616 deletions

View File

@@ -303,6 +303,7 @@ BEGIN
BUTTON ID_OBJECT_DISPLAYALL
SEPARATOR
BUTTON ID_OBJECT_REMOVE
BUTTON ID_OBJECT_DIM
END
@@ -371,10 +372,6 @@ BEGIN
BEGIN
MENUITEM "Background Color...", ID_Modify_ChangeBackground
END
POPUP "User cylinder"
BEGIN
MENUITEM "Change face color", ID_USERCYLINDER_CHANGEFACECOLOR
END
POPUP "Object(s)"
BEGIN
MENUITEM "Erase", ID_OBJECT_ERASE
@@ -408,6 +405,10 @@ BEGIN
END
MENUITEM "Transparency...", ID_OBJECT_TRANSPARENCY
END
POPUP "User cylinder"
BEGIN
MENUITEM "Change face color", ID_USERCYLINDER_CHANGEFACECOLOR
END
END
@@ -514,6 +515,12 @@ BEGIN
ID_TEXTURE_ON "Run texture example\nRun texture example"
END
STRINGTABLE
BEGIN
ID_OBJECT_DIMENSIONS "Add dimensions"
ID_LOCALCONTEXT_ADDDIMENSION "Add new dimension for selected objetcs"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////

View File

@@ -77,6 +77,7 @@ END_MESSAGE_MAP()
// CViewer3dDoc construction/destruction
CViewer3dDoc::CViewer3dDoc()
:OCC_3dDoc()
{
myCylinder.Nullify();
mySphere.Nullify();
@@ -86,21 +87,9 @@ CViewer3dDoc::CViewer3dDoc()
myOverlappedBox.Nullify();
myOffsetDlg = NULL;
myStaticTrihedronAxisIsDisplayed = FALSE;
myState = -1;
isTextureSampleStarted = FALSE;
/*
// TODO: add one-time construction code here
Handle(Graphic3d_WNTGraphicDevice) theGraphicDevice =
((CViewer3dApp*)AfxGetApp())->GetGraphicDevice();
myViewer = new V3d_Viewer(theGraphicDevice,(short *) "Visu3D");
myViewer->SetDefaultLights();
myViewer->SetLightOn();
*/
// myViewer->SetDefaultBackgroundColor(Quantity_TOC_RGB, 0.,0.,0.);
myPresentation = OCCDemo_Presentation::Current;
myPresentation->SetDocument(this);
@@ -702,39 +691,22 @@ void CViewer3dDoc::OnUpdateOptionsTrihedronStaticTrihedron(CCmdUI* pCmdUI)
}
void CViewer3dDoc::Popup( const Standard_Integer x,
const Standard_Integer y ,
const Handle(V3d_View)& aView )
void CViewer3dDoc::Popup (const Standard_Integer x,
const Standard_Integer y ,
const Handle(V3d_View)& aView)
{
Standard_Integer PopupMenuNumber=0;
myAISContext->InitCurrent();
if (myAISContext->MoreCurrent()) {
if (myAISContext->Current()->IsKind(STANDARD_TYPE(User_Cylinder)))
return;
else
PopupMenuNumber = 1;
}
CMenu menu;
VERIFY(menu.LoadMenu(IDR_Popup3D));
CMenu* pPopup = menu.GetSubMenu(PopupMenuNumber);
ASSERT(pPopup != NULL);
if (PopupMenuNumber == 1) // more than 1 object.
myPopupMenuNumber=0;
// Specified check for context menu number to call
myAISContext->InitCurrent();
if (myAISContext->MoreCurrent())
{
bool OneOrMoreInShading = false;
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
if (myAISContext->IsDisplayed(myAISContext->Current(),1)) OneOrMoreInShading=true;
if(!OneOrMoreInShading)
pPopup->EnableMenuItem(5, MF_BYPOSITION | MF_DISABLED | MF_GRAYED);
}
POINT winCoord = { x , y };
Handle(WNT_Window) aWNTWindow=
Handle(WNT_Window)::DownCast(aView->Window());
ClientToScreen ( (HWND)(aWNTWindow->HWindow()),&winCoord);
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON , winCoord.x, winCoord.y ,
AfxGetMainWnd());
if (myAISContext->Current()->IsKind(STANDARD_TYPE(User_Cylinder)))
{
myPopupMenuNumber = 2;
//return;
}
}
OCC_3dBaseDoc::Popup(x,y, aView);
}
//Set faces selection mode