1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0025284: Problems with standard MFC samples

- OCAF sample Save Document option: corrected conversion from LPCTSTR to Standard_CString
 - HLR sample: corrected mouse move event handling for HLR 2D view; Corrected CSelectionDialog view displaying and updating
 - Geometry sample: CGeometryDoc correction to avoid code duplication
 - OCC_3dBaseDoc: corrected DragEvent() handler for proper emulation of rectangle selection.
 - Viewer3d sample: moved resource files (resource.h; resource.hm; AISToolbar.bmp) from /src to /res

Code style changes

Fixed "About" dialog error in release.

Corrected dimension dialogs

Workaround for dimensions sample: AIS_LocalContext::SelectedShape() doesn't take into account TopoDS shape local transformation, and operates with selected interactive transformation.
This commit is contained in:
aba
2014-10-09 15:40:14 +04:00
committed by bugmaster
parent 679d38788d
commit 4716247158
51 changed files with 1103 additions and 1989 deletions

View File

@@ -60,6 +60,7 @@ CButton* CLengthParamsEdgePage::GetButton()
return (CButton*)GetDlgItem (IDC_ChooseEdgeBtn);
}
#include <AIS_Selection.hxx>
//=======================================================================
//function : OnBnClickedChooseEdgeBtn
//purpose :
@@ -75,28 +76,32 @@ void CLengthParamsEdgePage::OnBnClickedChooseEdgeBtn()
return;
}
TopoDS_Edge anEdge = TopoDS::Edge(myAISContext->LocalContext()->SelectedShape());
// Workaround for AIS_LocalContext::SelectedShape()
//TopoDS_Shape aSelShape = myAISContext->LocalContext()->SelectedShape();
TopoDS_Shape aSelShape = CDimensionDlg::SelectedShape();
const TopoDS_Edge& anEdge = TopoDS::Edge (aSelShape);
myAISContext->LocalContext()->ClearSelected();
TopoDS_Vertex aFirstVertex, aSecondVertex;
TopExp::Vertices (anEdge, aFirstVertex, aSecondVertex);
TopExp::Vertices (TopoDS::Edge (anEdge), aFirstVertex, aSecondVertex);
gp_Pnt aP1=BRep_Tool::Pnt (aFirstVertex);
gp_Pnt aP2=BRep_Tool::Pnt (aSecondVertex);
gp_Pnt aP3(aP2.X()+10, aP2.Y()+10, aP2.Z()+10);
gp_Pnt aP1 = BRep_Tool::Pnt (aFirstVertex);
gp_Pnt aP2 = BRep_Tool::Pnt (aSecondVertex);
gp_Pnt aP3 (aP2.X() + 10, aP2.Y() + 10, aP2.Z() + 10);
GC_MakePlane aMkPlane (aP1,aP2,aP3);
Handle(Geom_Plane) aPlane = aMkPlane.Value ();
Handle(Geom_Plane) aPlane = aMkPlane.Value();
CDimensionDlg *aDimDlg = (CDimensionDlg*)(GetParentOwner());
Handle(AIS_LengthDimension) aLenDim = new AIS_LengthDimension (anEdge, aPlane->Pln());
Handle(AIS_LengthDimension) aLenDim = new AIS_LengthDimension (TopoDS::Edge (anEdge), aPlane->Pln());
Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
anAspect->MakeArrows3d (Standard_False);
anAspect->MakeText3d (aDimDlg->GetTextType());
anAspect->TextAspect()->SetHeight (aDimDlg->GetFontHeight());
anAspect->MakeTextShaded (aDimDlg->IsText3dShaded());
anAspect->SetCommonColor (aDimDlg->GetDimensionColor());
aLenDim->DimensionAspect()->MakeUnitsDisplayed (aDimDlg->IsUnitsDisplayed());
anAspect->MakeUnitsDisplayed (aDimDlg->IsUnitsDisplayed());
if (aDimDlg->IsUnitsDisplayed())
{
aLenDim->SetDisplayUnits (aDimDlg->GetUnits());