mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-07 18:30:55 +03:00
0029659: Samples - Image is not displayed in Viewer2d MFC sample
Fixed wrong Display Mode assigned to Sample2D_Image presentation.
This commit is contained in:
parent
557916474b
commit
759e2a15ca
samples/mfc/standard
@ -330,8 +330,7 @@ void CViewer2dDoc::OnBUTTONTestImage()
|
||||
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
|
||||
anImage->SetCoord (40,50) ;
|
||||
anImage->SetScale (1.0);
|
||||
myAISContext->Display (anImage, Standard_False);
|
||||
myAISContext->SetDisplayMode (anImage,3,Standard_False);
|
||||
myAISContext->Display (anImage, AIS_Shaded, 0, Standard_False);
|
||||
FitAll2DViews (Standard_True);
|
||||
}
|
||||
}
|
||||
@ -365,48 +364,41 @@ void CViewer2dDoc::OnBUTTONMultipleImage()
|
||||
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
|
||||
anImage->SetCoord (40, 50);
|
||||
anImage->SetScale (0.5);
|
||||
myAISContext->Display (anImage, Standard_False);
|
||||
myAISContext->SetDisplayMode (anImage, 3, Standard_False);
|
||||
myAISContext->Display (anImage, AIS_Shaded, 0, Standard_False);
|
||||
}
|
||||
{ // 2
|
||||
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
|
||||
anImage->SetCoord (100, 50);
|
||||
anImage->SetScale (0.9);
|
||||
myAISContext->Display (anImage, Standard_False);
|
||||
myAISContext->SetDisplayMode (anImage, 3, Standard_False);
|
||||
myAISContext->Display (anImage, AIS_Shaded, 0, Standard_False);
|
||||
}
|
||||
{ // 3
|
||||
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
|
||||
anImage->SetCoord (40, 40);
|
||||
anImage->SetScale (0.3);
|
||||
myAISContext->Display (anImage, Standard_False);
|
||||
myAISContext->SetDisplayMode (anImage, 3, Standard_False);
|
||||
myAISContext->Display (anImage, AIS_Shaded, 0, Standard_False);
|
||||
}
|
||||
{ // 4
|
||||
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
|
||||
anImage->SetCoord (50, 40);
|
||||
myAISContext->Display (anImage, Standard_False);
|
||||
myAISContext->SetDisplayMode (anImage, 3, Standard_False);
|
||||
myAISContext->Display (anImage, AIS_Shaded, 0, Standard_False);
|
||||
}
|
||||
{ // 5
|
||||
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
|
||||
anImage->SetCoord (80, 45);
|
||||
anImage->SetScale (2);
|
||||
myAISContext->Display (anImage, Standard_False);
|
||||
myAISContext->SetDisplayMode (anImage, 3, Standard_False);
|
||||
myAISContext->Display (anImage, AIS_Shaded, 0, Standard_False);
|
||||
}
|
||||
{ // 6
|
||||
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
|
||||
anImage->SetCoord (20, -20);
|
||||
myAISContext->Display (anImage, Standard_False);
|
||||
myAISContext->SetDisplayMode (anImage, 3, Standard_False);
|
||||
myAISContext->Display (anImage, AIS_Shaded, 0, Standard_False);
|
||||
}
|
||||
{ // 7
|
||||
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
|
||||
anImage->SetCoord (0, 0);
|
||||
anImage->SetScale (0.5);
|
||||
myAISContext->Display (anImage, Standard_False);
|
||||
myAISContext->SetDisplayMode (anImage, 3, Standard_False);
|
||||
myAISContext->Display (anImage, AIS_Shaded, 0, Standard_False);
|
||||
}
|
||||
FitAll2DViews (Standard_True); // Update Viewer
|
||||
}
|
||||
|
@ -38,6 +38,8 @@ void Sample2D_Image::SetContext(const Handle(AIS_InteractiveContext)& theContext
|
||||
MakeShape();
|
||||
this->Set(TopoDS_Shape(myFace));
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
myDrawer->ShadingAspect()->Aspect()->SetTextureMap (new Graphic3d_Texture2Dmanual (myFilename));
|
||||
Handle(Graphic3d_Texture2Dmanual) aTexture = new Graphic3d_Texture2Dmanual (myFilename);
|
||||
aTexture->DisableModulate();
|
||||
myDrawer->ShadingAspect()->Aspect()->SetTextureMap (aTexture);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetTextureMapOn();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user