mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0029520: Visualization - drop deprecated V3d_View::Export() functionality and dependency from gl2ps
This commit is contained in:
@@ -31,7 +31,6 @@
|
||||
#include <Draw_ProgressIndicator.hxx>
|
||||
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <Graphic3d_ExportFormat.hxx>
|
||||
#include <Graphic3d_NameOfTextureEnv.hxx>
|
||||
#include <Graphic3d_GraduatedTrihedron.hxx>
|
||||
#include <Graphic3d_TextureEnv.hxx>
|
||||
@@ -3682,93 +3681,6 @@ static int VPlace (Draw_Interpretor& /*theDi*/, Standard_Integer theArgNb, const
|
||||
return 0;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
//function : VExport
|
||||
//purpose : Export the view to a vector graphic format (PS, EMF, PDF)
|
||||
//==============================================================================
|
||||
|
||||
static int VExport(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
Handle(V3d_View) V3dView = ViewerTest::CurrentView();
|
||||
if (V3dView.IsNull())
|
||||
return 1;
|
||||
|
||||
if (argc == 1)
|
||||
{
|
||||
std::cout << "Usage: " << argv[0] << " Filename [Format]\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
Graphic3d_ExportFormat anExpFormat = Graphic3d_EF_PDF;
|
||||
TCollection_AsciiString aFormatStr;
|
||||
|
||||
TCollection_AsciiString aFileName (argv[1]);
|
||||
Standard_Integer aLen = aFileName.Length();
|
||||
|
||||
if (argc > 2)
|
||||
{
|
||||
aFormatStr = TCollection_AsciiString (argv[2]);
|
||||
}
|
||||
else if (aLen >= 4)
|
||||
{
|
||||
if (aFileName.Value (aLen - 2) == '.')
|
||||
{
|
||||
aFormatStr = aFileName.ToCString() + aLen - 2;
|
||||
}
|
||||
else if (aFileName.Value (aLen - 3) == '.')
|
||||
{
|
||||
aFormatStr = aFileName.ToCString() + aLen - 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Export format couln't be detected from filename '" << argv[1] << "'\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Export format couln't be detected from filename '" << argv[1] << "'\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
aFormatStr.UpperCase();
|
||||
if (aFormatStr == "PS")
|
||||
anExpFormat = Graphic3d_EF_PostScript;
|
||||
else if (aFormatStr == "EPS")
|
||||
anExpFormat = Graphic3d_EF_EnhPostScript;
|
||||
else if (aFormatStr == "TEX")
|
||||
anExpFormat = Graphic3d_EF_TEX;
|
||||
else if (aFormatStr == "PDF")
|
||||
anExpFormat = Graphic3d_EF_PDF;
|
||||
else if (aFormatStr == "SVG")
|
||||
anExpFormat = Graphic3d_EF_SVG;
|
||||
else if (aFormatStr == "PGF")
|
||||
anExpFormat = Graphic3d_EF_PGF;
|
||||
else if (aFormatStr == "EMF")
|
||||
anExpFormat = Graphic3d_EF_EMF;
|
||||
else
|
||||
{
|
||||
std::cout << "Invalid export format '" << aFormatStr << "'\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
try
|
||||
{
|
||||
if (!V3dView->Export (argv[1], anExpFormat))
|
||||
{
|
||||
di << "Error: export of image to " << aFormatStr << " failed!\n";
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure const& anException)
|
||||
{
|
||||
di << "Error: export of image to " << aFormatStr << " failed";
|
||||
di << " (exception: " << anException.GetMessageString() << ")";
|
||||
}
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int VColorScale (Draw_Interpretor& theDI,
|
||||
Standard_Integer theArgNb,
|
||||
const char** theArgVec)
|
||||
@@ -12012,11 +11924,6 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
|
||||
theCommands.Add("vpan",
|
||||
"vpan : vpan dx dy",
|
||||
__FILE__,VPan,group);
|
||||
theCommands.Add("vexport",
|
||||
"vexport : vexport full_file_path {PS | EPS | TEX | PDF | SVG | PGF | EMF }"
|
||||
" : exports the view to a vector file of a given format"
|
||||
" : notice that EMF format requires patched gl2ps",
|
||||
__FILE__,VExport,group);
|
||||
theCommands.Add("vcolorscale",
|
||||
"vcolorscale name [-noupdate|-update] [-demo]"
|
||||
"\n\t\t: [-range RangeMin=0 RangeMax=1 NbIntervals=10]"
|
||||
|
Reference in New Issue
Block a user