1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

Compare commits

..

6 Commits

Author SHA1 Message Date
dpasukhi
75efe3538e 0033818: Data Exchange - Regenerate flex file with latest version
Regenerated bison and Flex files.
  Flex: 2.6.4 dev (august 2024)
  Bison: 3.7.4 release
2024-09-07 12:24:12 +00:00
dpasukhi
ed20837d8b 0033703: Data Exchange, Step Export - Transfer edge speed improvement
Move optional code close to use case to avoid extra calculation
2024-09-06 20:22:00 +00:00
reciprocal
2ab4e9e180 0033319: Coding - Static linking fails with unresolved symbols due to linking order and missing transitive dependencies
The absence of target_link_libraries calls for static libraries caused CMake to fail
in modeling the link dependencies correctly.
This fix ensures that CMake correctly exports the dependencies in OpenCASCADEConfig.cmake and
resolves downstream linking errors for projects that link against static OpenCASCADE libraries.
2024-09-05 18:15:57 +00:00
dpasukhi
d83d72acf9 0033805: Configuration - Implement GitHub Actions build scripts
Enable MSVC code analyzing to push SARIF files
2024-09-05 17:55:07 +00:00
dpasukhi
fae5678dc7 0033750: Configuration - make file configuration failed in mfc example
Updated MFC sample to build together with OCCT
2024-09-05 17:55:01 +00:00
dpasukhi
488c43ed0c 0033812: Configuration, MacOS - Debug Symbols Stripped From Dynamic Libraries
Update optimization flag to release only
2024-09-05 09:14:24 +00:00
45 changed files with 4268 additions and 3153 deletions

View File

@@ -56,14 +56,7 @@ jobs:
# ignoredPaths: ${{ github.workspace }}/dependencies;${{ github.workspace }}/test
# Upload SARIF file to GitHub Code Scanning Alerts
#- name: Upload SARIF to GitHub
# uses: github/codeql-action/upload-sarif@v3.26.5
# with:
# sarif_file: ${{ steps.run-analysis.outputs.sarif }}
# Upload SARIF file as an Artifact to download and view
- name: Upload SARIF as an Artifact
uses: actions/upload-artifact@v4.3.6
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v3.26.5
with:
name: sarif-file
path: ${{ steps.run-analysis.outputs.sarif }}
sarif_file: ${{ steps.run-analysis.outputs.sarif }}

View File

@@ -168,7 +168,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
set (CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
endif()
# Optimize size of binaries
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS}")
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
elseif(MINGW)
add_definitions(-D_WIN32_WINNT=0x0601)
# _WIN32_WINNT=0x0601 (use Windows 7 SDK)

View File

@@ -107,8 +107,8 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
# choose appropriate extension for generated files: "cxx" if source file contains
# instruction to generate C++ code, "c" otherwise
set (BISON_OUTPUT_FILE_EXT "c")
set (FLEX_OUTPUT_FILE_EXT "c")
set (BISON_OUTPUT_FILE_EXT "cxx")
set (FLEX_OUTPUT_FILE_EXT "cxx")
file (STRINGS "${CURRENT_BISON_FILE}" FILE_BISON_CONTENT)
foreach (FILE_BISON_CONTENT_LINE ${FILE_BISON_CONTENT})
string (REGEX MATCH "%language \"C\\+\\+\"" CXX_BISON_LANGUAGE_FOUND ${FILE_BISON_CONTENT_LINE})
@@ -479,8 +479,8 @@ if (BUILD_SHARED_LIBS OR EXECUTABLE_PROJECT)
if(IS_VTK_9XX)
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
endif()
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
endif()
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
if (USE_QT)
foreach (PROJECT_LIBRARY_DEBUG ${PROJECT_LIBRARIES_DEBUG})

View File

@@ -11,7 +11,7 @@ project (ImportExport)
add_definitions (-DWINVER=0x0501 -DUNICODE -D_UNICODE)
set (CMAKE_MFC_FLAG 2)
set (ImportExport_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/05_ImportExport/src)
set (ImportExport_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/03_ImportExport/src)
set (ImportExport_HEADER_FILES ${ImportExport_SRC_DIR}/ColoredShapes.h
${ImportExport_SRC_DIR}/ImportExportApp.h
${ImportExport_SRC_DIR}/ImportExportDoc.h
@@ -21,7 +21,7 @@ set (ImportExport_SOURCE_FILES ${ImportExport_SRC_DIR}/ColoredShapes.cpp
${ImportExport_SRC_DIR}/ImportExportDoc.cpp
${ImportExport_SRC_DIR}/StdAfx.cpp)
set (ImportExport_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/05_ImportExport/res)
set (ImportExport_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/03_ImportExport/res)
set (ImportExport_RESOURCE_HEADER ${ImportExport_RESOURCE_DIR}/resource.h)
set (ImportExport_RESOURCE_FILES ${ImportExport_RESOURCE_DIR}/Toolbar.bmp
${ImportExport_RESOURCE_DIR}/ImportExport.rc)
@@ -55,7 +55,7 @@ else()
endif()
include_directories (${CMAKE_BINARY_DIR}/inc
${MFC_STANDARD_SAMPLES_DIR}/05_ImportExport
${MFC_STANDARD_SAMPLES_DIR}/03_ImportExport
${ImportExport_SRC_DIR}
${MFC_STANDARD_SAMPLES_DIR}/Common)

View File

@@ -11,7 +11,7 @@ project (HLR)
add_definitions(-DWINVER=0x0501 -DUNICODE -D_UNICODE)
set (CMAKE_MFC_FLAG 2)
set (HLR_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/08_HLR/src)
set (HLR_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/04_HLR/src)
set (HLR_HEADER_FILES ${HLR_SRC_DIR}/HLRApp.h
${HLR_SRC_DIR}/HLRDoc.h
${HLR_SRC_DIR}/HLRView2D.h
@@ -23,7 +23,7 @@ set (HLR_SOURCE_FILES ${HLR_SRC_DIR}/HLRApp.cpp
${HLR_SRC_DIR}/SelectionDialog.cpp
${HLR_SRC_DIR}/StdAfx.cpp )
set (HLR_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/08_HLR/res)
set (HLR_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/04_HLR/res)
set (HLR_RESOURCE_HEADER ${HLR_RESOURCE_DIR}/resource.h)
set (HLR_RESOURCE_FILES ${HLR_RESOURCE_DIR}/axoviewd.bmp
${HLR_RESOURCE_DIR}/axoviewf.bmp

View File

@@ -82,7 +82,6 @@ set (COMMON_HEADER_FILES ${MFC_STANDARD_COMMON_SAMPLES_DIR}/AISDialogs.h
${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_StereoConfigDlg.h
${MFC_STANDARD_COMMON_SAMPLES_DIR}/ParamsFacesPage.h
${MFC_STANDARD_COMMON_SAMPLES_DIR}/ResultDialog.h
${MFC_STANDARD_COMMON_SAMPLES_DIR}/User_Cylinder.hxx
${MFC_STANDARD_COMMON_SAMPLES_DIR}/ColoredMeshDlg.h
${MFC_STANDARD_COMMON_SAMPLES_DIR}/DimensionDlg.h
${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsEdgePage.h

View File

@@ -2266,12 +2266,6 @@ void AIS_ViewController::handleCameraActions (const Handle(AIS_InteractiveContex
myGL.Orientation.ToFitAll = false;
}
if (theView->Viewer()->Grid()->IsActive()
&& theView->Viewer()->GridEcho())
{
theView->Viewer()->Grid()->Update();
}
if (myGL.IsNewGesture)
{
if (myAnchorPointPrs1->HasInteractiveContext())

View File

@@ -16,10 +16,10 @@
IMPLEMENT_STANDARD_RTTIEXT(Aspect_Grid,Standard_Transient)
Aspect_Grid::Aspect_Grid (const Standard_Real theXOrigin,
const Standard_Real theYOrigin,
const Standard_Real theAngle,
const Quantity_Color& theColor,
const Quantity_Color& theTenthColor)
const Standard_Real theYOrigin,
const Standard_Real theAngle,
const Quantity_Color& theColor,
const Quantity_Color& theTenthColor)
: myRotationAngle (theAngle),
myXOrigin (theXOrigin),
myYOrigin (theYOrigin),
@@ -60,7 +60,7 @@ void Aspect_Grid::Rotate (const Standard_Real theAngle)
}
void Aspect_Grid::Translate (const Standard_Real theDx,
const Standard_Real theDy)
const Standard_Real theDy)
{
myXOrigin += theDx;
myYOrigin += theDy;
@@ -69,7 +69,7 @@ void Aspect_Grid::Translate (const Standard_Real theDx,
}
void Aspect_Grid::SetColors (const Quantity_Color& theColor,
const Quantity_Color& theTenthColor)
const Quantity_Color& theTenthColor)
{
myColor = theColor;
myTenthColor = theTenthColor;
@@ -77,16 +77,16 @@ void Aspect_Grid::SetColors (const Quantity_Color& theColor,
}
void Aspect_Grid::Colors (Quantity_Color& theColor,
Quantity_Color& theTenthColor) const
Quantity_Color& theTenthColor) const
{
theColor = myColor;
theTenthColor = myTenthColor;
}
void Aspect_Grid::Hit (const Standard_Real theX,
const Standard_Real theY,
Standard_Real& theGridX,
Standard_Real& theGridY) const
const Standard_Real theY,
Standard_Real& theGridX,
Standard_Real& theGridY) const
{
if (myIsActive)
{

View File

@@ -86,9 +86,6 @@ public:
//! Display the grid at screen.
Standard_EXPORT virtual void Display() = 0;
//! Update grid presentation
Standard_EXPORT virtual void Update() = 0;
//! Erase the grid from screen.
Standard_EXPORT virtual void Erase() const = 0;

View File

@@ -1,67 +0,0 @@
// Created on: 1995-03-02
// Created by: Jean-Louis Frenkel
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Aspect_GridParams_HeaderFile
#define _Aspect_GridParams_HeaderFile
#include <Quantity_Color.hxx>
#include <gp_Pnt.hxx>
class Aspect_GridParams
{
public:
//! Constructor.
Aspect_GridParams()
: myIsHorizontal (true),
myIsDrawAxis(true),
myColor(0.8, 0.8, 0.8, Quantity_TOC_RGB),
myScale (0.01),
myIsInfinity (false),
myPosition (0.0, 0.0, 0.0),
myLineThickness (0.01)
{}
//! Getters
Standard_Boolean IsHorizontal() const { return myIsHorizontal; }
Standard_Boolean IsDrawAxis() const { return myIsDrawAxis; }
const Quantity_Color& Color() const { return myColor; }
Standard_Real Scale() const { return myScale; }
Standard_Boolean IsInfinity() const { return myIsInfinity; }
const gp_Pnt& Position() const { return myPosition; }
Standard_Real LineThickness() const { return myLineThickness; }
//! Setters
void SetIsHorizontal (Standard_Boolean theValue) { myIsHorizontal = theValue; }
void SetIsDrawAxis (Standard_Boolean theValue) { myIsDrawAxis = theValue; }
void SetColor (const Quantity_Color& theColor) { myColor = theColor; }
void SetScale (Standard_Real theScale) { myScale = theScale; }
void SetIsInfinity (Standard_Boolean theValue) { myIsInfinity = theValue; }
void SetPosition (const gp_Pnt& thePosition) { myPosition = thePosition; }
void SetLineThickness (Standard_Real theThickness) { myLineThickness = theThickness; }
private:
Quantity_Color myColor;
gp_Pnt myPosition;
Standard_Real myScale;
Standard_Real myLineThickness;
Standard_Boolean myIsHorizontal;
Standard_Boolean myIsDrawAxis;
Standard_Boolean myIsInfinity;
};
#endif // _Aspect_GridParams_HeaderFile

View File

@@ -27,11 +27,8 @@ Aspect_RectangularGrid::Aspect_RectangularGrid(
const Standard_Real aFirstAngle,
const Standard_Real aSecondAngle,
const Standard_Real aRotationAngle)
: Aspect_Grid (anXOrigin,anYOrigin,aRotationAngle),
myXStep (aXStep),
myYStep (aYStep),
myFirstAngle (aFirstAngle),
mySecondAngle (aSecondAngle)
:Aspect_Grid(anXOrigin,anYOrigin,aRotationAngle),myXStep(aXStep),myYStep(aYStep),myFirstAngle(aFirstAngle),mySecondAngle(aSecondAngle)
{
Standard_NumericError_Raise_if(!CheckAngle (aFirstAngle,mySecondAngle),
"networks are parallel");

View File

@@ -25,7 +25,6 @@ Aspect_GraphicsLibrary.hxx
Aspect_Grid.cxx
Aspect_Grid.hxx
Aspect_GridDrawMode.hxx
Aspect_GridParams.hxx
Aspect_GridType.hxx
Aspect_NeutralWindow.cxx
Aspect_NeutralWindow.hxx

View File

@@ -1,8 +1,8 @@
// A Bison parser, made by GNU Bison 3.7.4.
// A Bison parser, made by GNU Bison 3.8.2.
// Skeleton implementation for Bison LALR(1) parsers in C++
// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// As a special exception, you may create a larger work that contains
// part or all of the Bison parser skeleton and distribute that work
@@ -176,7 +176,7 @@ static Express_HSequenceOfField *mkflist ( Express_Field *field, Express_HSequen
#else // !YYDEBUG
# define YYCDEBUG if (false) std::cerr
# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol)
# define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol)
# define YY_REDUCE_PRINT(Rule) static_cast<void> (0)
# define YY_STACK_PRINT() static_cast<void> (0)
@@ -209,9 +209,9 @@ namespace exptocas {
parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
{}
/*---------------.
| symbol kinds. |
`---------------*/
/*---------.
| symbol. |
`---------*/
// basic_symbol.
template <typename Base>
@@ -229,11 +229,12 @@ namespace exptocas {
{}
template <typename Base>
parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, YY_RVREF (semantic_type) v)
parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, YY_RVREF (value_type) v)
: Base (t)
, value (YY_MOVE (v))
{}
template <typename Base>
parser::symbol_kind_type
parser::basic_symbol<Base>::type_get () const YY_NOEXCEPT
@@ -241,6 +242,7 @@ namespace exptocas {
return this->kind ();
}
template <typename Base>
bool
parser::basic_symbol<Base>::empty () const YY_NOEXCEPT
@@ -257,28 +259,30 @@ namespace exptocas {
}
// by_kind.
parser::by_kind::by_kind ()
parser::by_kind::by_kind () YY_NOEXCEPT
: kind_ (symbol_kind::S_YYEMPTY)
{}
#if 201103L <= YY_CPLUSPLUS
parser::by_kind::by_kind (by_kind&& that)
parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT
: kind_ (that.kind_)
{
that.clear ();
}
#endif
parser::by_kind::by_kind (const by_kind& that)
parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT
: kind_ (that.kind_)
{}
parser::by_kind::by_kind (token_kind_type t)
parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT
: kind_ (yytranslate_ (t))
{}
void
parser::by_kind::clear ()
parser::by_kind::clear () YY_NOEXCEPT
{
kind_ = symbol_kind::S_YYEMPTY;
}
@@ -296,6 +300,7 @@ namespace exptocas {
return kind_;
}
parser::symbol_kind_type
parser::by_kind::type_get () const YY_NOEXCEPT
{
@@ -303,6 +308,7 @@ namespace exptocas {
}
// by_state.
parser::by_state::by_state () YY_NOEXCEPT
: state (empty_state)
@@ -385,7 +391,7 @@ namespace exptocas {
YY_SYMBOL_PRINT (yymsg, yysym);
// User destructor.
YYUSE (yysym.kind ());
YY_USE (yysym.kind ());
}
#if YYDEBUG
@@ -394,7 +400,7 @@ namespace exptocas {
parser::yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const
{
std::ostream& yyoutput = yyo;
YYUSE (yyoutput);
YY_USE (yyoutput);
if (yysym.empty ())
yyo << "empty symbol";
else
@@ -402,7 +408,7 @@ namespace exptocas {
symbol_kind_type yykind = yysym.kind ();
yyo << (yykind < YYNTOKENS ? "token" : "nterm")
<< ' ' << yysym.name () << " (";
YYUSE (yykind);
YY_USE (yykind);
yyo << ')';
}
}
@@ -428,7 +434,7 @@ namespace exptocas {
}
void
parser::yypop_ (int n)
parser::yypop_ (int n) YY_NOEXCEPT
{
yystack_.pop (n);
}
@@ -471,13 +477,13 @@ namespace exptocas {
}
bool
parser::yy_pact_value_is_default_ (int yyvalue)
parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT
{
return yyvalue == yypact_ninf_;
}
bool
parser::yy_table_value_is_error_ (int yyvalue)
parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT
{
return yyvalue == yytable_ninf_;
}
@@ -1087,6 +1093,10 @@ namespace exptocas {
const short parser::yypact_ninf_ = -134;
const signed char parser::yytable_ninf_ = -1;
@@ -1145,10 +1155,10 @@ namespace exptocas {
-64, 31, -134, -134, -127, -134, -134, -7, 18, -131
};
const short
const unsigned char
parser::yydefgoto_[] =
{
-1, 2, 9, 10, 11, 12, 13, 14, 15, 109,
0, 2, 9, 10, 11, 12, 13, 14, 15, 109,
49, 40, 41, 42, 43, 72, 152, 47, 24, 61,
85, 86, 87, 88, 119, 121, 123, 124, 106, 166
};
@@ -1306,7 +1316,7 @@ namespace exptocas {
#endif // YYDEBUG
parser::symbol_kind_type
parser::yytranslate_ (int t)
parser::yytranslate_ (int t) YY_NOEXCEPT
{
// YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
// TOKEN-NUM as returned by yylex.
@@ -1350,7 +1360,7 @@ namespace exptocas {
if (t <= 0)
return symbol_kind::S_YYEOF;
else if (t <= code_max)
return YY_CAST (symbol_kind_type, translate_table[t]);
return static_cast <symbol_kind_type> (translate_table[t]);
else
return symbol_kind::S_YYUNDEF;
}

View File

@@ -1,8 +1,8 @@
// A Bison parser, made by GNU Bison 3.7.4.
// A Bison parser, made by GNU Bison 3.8.2.
// Skeleton interface for Bison LALR(1) parsers in C++
// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// As a special exception, you may create a larger work that contains
// part or all of the Bison parser skeleton and distribute that work
@@ -148,17 +148,23 @@ namespace exptocas {
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
# define YYUSE(E) ((void) (E))
# define YY_USE(E) ((void) (E))
#else
# define YYUSE(E) /* empty */
# define YY_USE(E) /* empty */
#endif
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
# else
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# endif
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
#else
@@ -219,9 +225,14 @@ namespace exptocas {
class parser
{
public:
#ifndef YYSTYPE
#ifdef YYSTYPE
# ifdef __GNUC__
# pragma GCC message "bison: do not #define YYSTYPE in C++, use %define api.value.type"
# endif
typedef YYSTYPE value_type;
#else
/// Symbol semantic values.
union semantic_type
union value_type
{
int num;
@@ -237,9 +248,10 @@ namespace exptocas {
};
#else
typedef YYSTYPE semantic_type;
#endif
/// Backward compatibility (Bison 3.8).
typedef value_type semantic_type;
/// Syntax errors thrown from user actions.
struct syntax_error : std::runtime_error
@@ -302,7 +314,7 @@ namespace exptocas {
};
/// Token kind, as returned by yylex.
typedef token::yytokentype token_kind_type;
typedef token::token_kind_type token_kind_type;
/// Backward compatibility alias (Bison 3.6).
typedef token_kind_type token_type;
@@ -412,7 +424,7 @@ namespace exptocas {
typedef Base super_type;
/// Default constructor.
basic_symbol ()
basic_symbol () YY_NOEXCEPT
: value ()
{}
@@ -431,7 +443,7 @@ namespace exptocas {
/// Constructor for symbols with semantic value.
basic_symbol (typename Base::kind_type t,
YY_RVREF (semantic_type) v);
YY_RVREF (value_type) v);
/// Destroy the symbol.
~basic_symbol ()
@@ -439,8 +451,10 @@ namespace exptocas {
clear ();
}
/// Destroy contents, and record that is empty.
void clear ()
void clear () YY_NOEXCEPT
{
Base::clear ();
}
@@ -464,7 +478,7 @@ namespace exptocas {
void move (basic_symbol& s);
/// The semantic value.
semantic_type value;
value_type value;
private:
#if YY_CPLUSPLUS < 201103L
@@ -476,25 +490,27 @@ namespace exptocas {
/// Type access provider for token (enum) based symbols.
struct by_kind
{
/// Default constructor.
by_kind ();
#if 201103L <= YY_CPLUSPLUS
/// Move constructor.
by_kind (by_kind&& that);
#endif
/// Copy constructor.
by_kind (const by_kind& that);
/// The symbol kind as needed by the constructor.
typedef token_kind_type kind_type;
/// Default constructor.
by_kind () YY_NOEXCEPT;
#if 201103L <= YY_CPLUSPLUS
/// Move constructor.
by_kind (by_kind&& that) YY_NOEXCEPT;
#endif
/// Copy constructor.
by_kind (const by_kind& that) YY_NOEXCEPT;
/// Constructor from (external) token numbers.
by_kind (kind_type t);
by_kind (kind_type t) YY_NOEXCEPT;
/// Record that this symbol is empty.
void clear ();
void clear () YY_NOEXCEPT;
/// Steal the symbol kind from \a that.
void move (by_kind& that);
@@ -586,19 +602,19 @@ namespace exptocas {
/// Whether the given \c yypact_ value indicates a defaulted state.
/// \param yyvalue the value to check
static bool yy_pact_value_is_default_ (int yyvalue);
static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT;
/// Whether the given \c yytable_ value indicates a syntax error.
/// \param yyvalue the value to check
static bool yy_table_value_is_error_ (int yyvalue);
static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT;
static const short yypact_ninf_;
static const signed char yytable_ninf_;
/// Convert a scanner token kind \a t to a symbol kind.
/// In theory \a t should be a token_kind_type, but character literals
/// are valid, yet not members of the token_type enum.
static symbol_kind_type yytranslate_ (int t);
/// are valid, yet not members of the token_kind_type enum.
static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT;
#if YYDEBUG || 0
/// For a symbol, its name in clear.
@@ -620,7 +636,7 @@ namespace exptocas {
static const short yypgoto_[];
// YYDEFGOTO[NTERM-NUM].
static const short yydefgoto_[];
static const unsigned char yydefgoto_[];
// YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
// positive, shift that token. If negative, reduce the rule whose
@@ -629,14 +645,14 @@ namespace exptocas {
static const short yycheck_[];
// YYSTOS[STATE-NUM] -- The (internal number of the) accessing
// symbol of state STATE-NUM.
// YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
// state STATE-NUM.
static const signed char yystos_[];
// YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
// YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.
static const signed char yyr1_[];
// YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
// YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.
static const signed char yyr2_[];
@@ -735,7 +751,7 @@ namespace exptocas {
typedef typename S::size_type size_type;
typedef typename std::ptrdiff_t index_type;
stack (size_type n = 200)
stack (size_type n = 200) YY_NOEXCEPT
: seq_ (n)
{}
@@ -814,7 +830,7 @@ namespace exptocas {
class slice
{
public:
slice (const stack& stack, index_type range)
slice (const stack& stack, index_type range) YY_NOEXCEPT
: stack_ (stack)
, range_ (range)
{}
@@ -864,7 +880,7 @@ namespace exptocas {
void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
/// Pop \a n symbols from the stack.
void yypop_ (int n = 1);
void yypop_ (int n = 1) YY_NOEXCEPT;
/// Constants.
enum

File diff suppressed because it is too large Load Diff

View File

@@ -17,7 +17,7 @@
%option yywrap
%{
#include <ExprIntrp.tab.h>
#include <ExprIntrp.tab.hxx>
#include <ExprIntrp_yaccintrf.hxx>

View File

@@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 3.7.4. */
/* A Bison parser, made by GNU Bison 3.8.2. */
/* Bison implementation for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
@@ -16,7 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -46,10 +46,10 @@
USER NAME SPACE" below. */
/* Identify Bison output, and Bison version. */
#define YYBISON 30704
#define YYBISON 30802
/* Bison version string. */
#define YYBISON_VERSION "3.7.4"
#define YYBISON_VERSION "3.8.2"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -151,7 +151,7 @@ extern void ExprIntrp_EndOfEqual();
# endif
# endif
#include "ExprIntrp.tab.h"
#include "ExprIntrp.tab.hxx"
/* Symbol kind. */
enum yysymbol_kind_t
{
@@ -267,6 +267,18 @@ typedef int_least16_t yytype_int16;
typedef short yytype_int16;
#endif
/* Work around bug in HP-UX 11.23, which defines these macros
incorrectly for preprocessor constants. This workaround can likely
be removed in 2023, as HPE has promised support for HP-UX 11.23
(aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
<https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
#ifdef __hpux
# undef UINT_LEAST8_MAX
# undef UINT_LEAST16_MAX
# define UINT_LEAST8_MAX 255
# define UINT_LEAST16_MAX 65535
#endif
#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
typedef __UINT_LEAST8_TYPE__ yytype_uint8;
#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
@@ -364,17 +376,23 @@ typedef int yy_state_fast_t;
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
# define YYUSE(E) ((void) (E))
# define YY_USE(E) ((void) (E))
#else
# define YYUSE(E) /* empty */
# define YY_USE(E) /* empty */
#endif
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
# else
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# endif
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
#else
@@ -590,7 +608,7 @@ static const yytype_int8 yytranslate[] =
};
#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
0, 80, 80, 81, 82, 83, 84, 87, 87, 90,
@@ -637,17 +655,6 @@ yysymbol_name (yysymbol_kind_t yysymbol)
}
#endif
#ifdef YYPRINT
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
(internal) symbol number NUM (which must be that of a token). */
static const yytype_int16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 10
};
#endif
#define YYPACT_NINF (-51)
#define yypact_value_is_default(Yyn) \
@@ -658,8 +665,8 @@ static const yytype_int16 yytoknum[] =
#define yytable_value_is_error(Yyn) \
0
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
static const yytype_int16 yypact[] =
{
4, 62, 62, 62, 62, -51, 2, 87, 39, 58,
@@ -679,9 +686,9 @@ static const yytype_int16 yypact[] =
140, 171, 172, -51, -51, 174, 175, -51, -51
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
Performed when YYTABLE does not specify something else to do. Zero
means the default is an error. */
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
Performed when YYTABLE does not specify something else to do. Zero
means the default is an error. */
static const yytype_int8 yydefact[] =
{
0, 0, 0, 0, 0, 28, 27, 0, 0, 0,
@@ -701,7 +708,7 @@ static const yytype_int8 yydefact[] =
0, 0, 0, 62, 65, 0, 0, 63, 66
};
/* YYPGOTO[NTERM-NUM]. */
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
-51, -51, -51, -51, -51, -51, 0, -51, -51, -51,
@@ -711,19 +718,19 @@ static const yytype_int8 yypgoto[] =
-35, -51
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_uint8 yydefgoto[] =
{
-1, 13, 14, 36, 15, 94, 79, 17, 18, 19,
0, 13, 14, 36, 15, 94, 79, 17, 18, 19,
57, 80, 112, 20, 21, 58, 22, 37, 23, 66,
129, 42, 24, 38, 89, 114, 90, 25, 116, 117,
135, 26, 95, 126, 27, 119, 145, 28, 120, 146,
29, 30
};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule whose
number is the opposite. If YYTABLE_NINF, syntax error. */
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule whose
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_int16 yytable[] =
{
16, 32, 33, 34, 35, 41, 81, 1, 2, 48,
@@ -770,8 +777,8 @@ static const yytype_int16 yycheck[] =
13, 11, -1, 12, 12, 11, 11, -1, 114, 66
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
state STATE-NUM. */
static const yytype_int8 yystos[] =
{
0, 3, 4, 8, 9, 12, 13, 15, 17, 19,
@@ -791,7 +798,7 @@ static const yytype_int8 yystos[] =
32, 14, 14, 12, 12, 62, 65, 11, 11
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
static const yytype_int8 yyr1[] =
{
0, 26, 27, 27, 27, 27, 27, 29, 28, 31,
@@ -804,7 +811,7 @@ static const yytype_int8 yyr1[] =
67
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
static const yytype_int8 yyr2[] =
{
0, 2, 1, 1, 1, 1, 1, 0, 4, 0,
@@ -826,6 +833,7 @@ enum { YYENOMEM = -2 };
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
#define YYERROR goto yyerrorlab
#define YYNOMEM goto yyexhaustedlab
#define YYRECOVERING() (!!yyerrstatus)
@@ -866,10 +874,7 @@ do { \
YYFPRINTF Args; \
} while (0)
/* This macro is provided for backward compatibility. */
# ifndef YY_LOCATION_PRINT
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
@@ -893,15 +898,11 @@ yy_symbol_value_print (FILE *yyo,
yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
{
FILE *yyoutput = yyo;
YYUSE (yyoutput);
YY_USE (yyoutput);
if (!yyvaluep)
return;
# ifdef YYPRINT
if (yykind < YYNTOKENS)
YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
# endif
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
YYUSE (yykind);
YY_USE (yykind);
YY_IGNORE_MAYBE_UNINITIALIZED_END
}
@@ -1015,13 +1016,13 @@ static void
yydestruct (const char *yymsg,
yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
{
YYUSE (yyvaluep);
YY_USE (yyvaluep);
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
YYUSE (yykind);
YY_USE (yykind);
YY_IGNORE_MAYBE_UNINITIALIZED_END
}
@@ -1084,6 +1085,7 @@ yyparse (void)
YYDPRINTF ((stderr, "Starting parse\n"));
yychar = YYEMPTY; /* Cause a token to be read. */
goto yysetstate;
@@ -1109,7 +1111,7 @@ yysetstate:
if (yyss + yystacksize - 1 <= yyssp)
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
goto yyexhaustedlab;
YYNOMEM;
#else
{
/* Get the current used size of the three stacks, in elements. */
@@ -1137,7 +1139,7 @@ yysetstate:
# else /* defined YYSTACK_RELOCATE */
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
goto yyexhaustedlab;
YYNOMEM;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
yystacksize = YYMAXDEPTH;
@@ -1148,7 +1150,7 @@ yysetstate:
YY_CAST (union yyalloc *,
YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
if (! yyptr)
goto yyexhaustedlab;
YYNOMEM;
YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE
@@ -1170,6 +1172,7 @@ yysetstate:
}
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
if (yystate == YYFINAL)
YYACCEPT;
@@ -1551,6 +1554,7 @@ yyerrorlab:
label yyerrorlab therefore never appears in user code. */
if (0)
YYERROR;
++yynerrs;
/* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
@@ -1611,7 +1615,7 @@ yyerrlab1:
`-------------------------------------*/
yyacceptlab:
yyresult = 0;
goto yyreturn;
goto yyreturnlab;
/*-----------------------------------.
@@ -1619,24 +1623,22 @@ yyacceptlab:
`-----------------------------------*/
yyabortlab:
yyresult = 1;
goto yyreturn;
goto yyreturnlab;
#if !defined yyoverflow
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
/*-----------------------------------------------------------.
| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
`-----------------------------------------------------------*/
yyexhaustedlab:
yyerror (YY_("memory exhausted"));
yyresult = 2;
goto yyreturn;
#endif
goto yyreturnlab;
/*-------------------------------------------------------.
| yyreturn -- parsing is finished, clean up and return. |
`-------------------------------------------------------*/
yyreturn:
/*----------------------------------------------------------.
| yyreturnlab -- parsing is finished, clean up and return. |
`----------------------------------------------------------*/
yyreturnlab:
if (yychar != YYEMPTY)
{
/* Make sure we have latest lookahead translation. See comments at

View File

@@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 3.7.4. */
/* A Bison parser, made by GNU Bison 3.8.2. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
@@ -16,7 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -35,8 +35,8 @@
especially those whose name start with YY_ or yy_. They are
private implementation details that can be changed or removed. */
#ifndef YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_H_INCLUDED
# define YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_H_INCLUDED
#ifndef YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_HXX_INCLUDED
# define YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_HXX_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -90,6 +90,8 @@ typedef int YYSTYPE;
extern YYSTYPE ExprIntrplval;
int ExprIntrpparse (void);
#endif /* !YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_H_INCLUDED */
#endif /* !YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_HXX_INCLUDED */

View File

@@ -56,27 +56,27 @@ static TCollection_AsciiString ExprIntrp_funcdefname;
static Standard_Integer ExprIntrp_nbargs;
static Standard_Integer ExprIntrp_nbdiff;
extern "C" void ExprIntrp_StartFunction()
void ExprIntrp_StartFunction()
{
const TCollection_AsciiString& name = ExprIntrp_GetResult();
ExprIntrp_Recept.PushName(name);
ExprIntrp_nbargs = 0;
}
extern "C" void ExprIntrp_StartDerivate()
void ExprIntrp_StartDerivate()
{
const TCollection_AsciiString& name = ExprIntrp_GetResult();
ExprIntrp_Recept.PushName(name);
}
extern "C" void ExprIntrp_EndDerivate()
void ExprIntrp_EndDerivate()
{
int degree;
degree = ExprIntrp_GetDegree();
ExprIntrp_Recept.PushValue(degree);
}
extern "C" void ExprIntrp_Derivation()
void ExprIntrp_Derivation()
{
ExprIntrp_Recept.PushValue(1);
const TCollection_AsciiString& thename = ExprIntrp_GetResult();
@@ -90,14 +90,14 @@ extern "C" void ExprIntrp_Derivation()
ExprIntrp_Recept.Push(namexp);
}
extern "C" void ExprIntrp_DerivationValue()
void ExprIntrp_DerivationValue()
{
const TCollection_AsciiString& aStr = ExprIntrp_GetResult();
ExprIntrp_Recept.PopValue();
ExprIntrp_Recept.PushValue(aStr.IntegerValue());
}
extern "C" void ExprIntrp_EndDerivation()
void ExprIntrp_EndDerivation()
{
Standard_Integer degree = ExprIntrp_Recept.PopValue();
Handle(Expr_NamedUnknown) var = Handle(Expr_NamedUnknown)::DownCast(ExprIntrp_Recept.Pop());
@@ -106,13 +106,13 @@ extern "C" void ExprIntrp_EndDerivation()
ExprIntrp_Recept.Push(exp);
}
extern "C" void ExprIntrp_StartDifferential()
void ExprIntrp_StartDifferential()
{
ExprIntrp_StartDerivate();
ExprIntrp_nbdiff = 0;
}
extern "C" void ExprIntrp_DiffDegreeVar()
void ExprIntrp_DiffDegreeVar()
{
const TCollection_AsciiString& aStr = ExprIntrp_GetResult();
const char* s = aStr.ToCString();
@@ -125,20 +125,20 @@ extern "C" void ExprIntrp_DiffDegreeVar()
ExprIntrp_nbdiff++;
}
extern "C" void ExprIntrp_DiffVar()
void ExprIntrp_DiffVar()
{
ExprIntrp_Recept.PushValue(1);
ExprIntrp_DiffDegreeVar();
}
extern "C" void ExprIntrp_DiffDegree()
void ExprIntrp_DiffDegree()
{
const TCollection_AsciiString& aStr = ExprIntrp_GetResult();
Standard_Integer deg = aStr.IntegerValue();
ExprIntrp_Recept.PushValue(deg);
}
extern "C" void ExprIntrp_VerDiffDegree()
void ExprIntrp_VerDiffDegree()
{
const TCollection_AsciiString& aStr = ExprIntrp_GetResult();
Standard_Integer deg = aStr.IntegerValue();
@@ -149,7 +149,7 @@ extern "C" void ExprIntrp_VerDiffDegree()
ExprIntrp_Recept.PushValue(deg);
}
extern "C" void ExprIntrp_EndDifferential()
void ExprIntrp_EndDifferential()
{
TCollection_AsciiString name = ExprIntrp_Recept.PopName();
Handle(Expr_GeneralFunction) thefunc = ExprIntrp_Recept.GetFunction(name);
@@ -172,7 +172,7 @@ extern "C" void ExprIntrp_EndDifferential()
ExprIntrp_Recept.PushFunction(thefunc);
}
extern "C" void ExprIntrp_EndDiffFunction()
void ExprIntrp_EndDiffFunction()
{
Handle(Expr_GeneralFunction) thefunc = ExprIntrp_Recept.PopFunction();
if (thefunc.IsNull()) {
@@ -276,7 +276,7 @@ static Handle(Expr_GeneralExpression) ExprIntrp_StandardFunction(const TCollecti
}
extern "C" void ExprIntrp_EndDerFunction()
void ExprIntrp_EndDerFunction()
{
TCollection_AsciiString name = ExprIntrp_Recept.PopName();
Handle(Expr_GeneralExpression) op = ExprIntrp_Recept.Pop();
@@ -323,7 +323,7 @@ extern "C" void ExprIntrp_EndDerFunction()
}
}
extern "C" void ExprIntrp_EndFunction()
void ExprIntrp_EndFunction()
{
TCollection_AsciiString name = ExprIntrp_Recept.PopName();
Handle(Expr_GeneralExpression) op = ExprIntrp_Recept.Pop();
@@ -370,17 +370,17 @@ extern "C" void ExprIntrp_EndFunction()
}
}
extern "C" void ExprIntrp_NextFuncArg()
void ExprIntrp_NextFuncArg()
{
ExprIntrp_nbargs++;
}
extern "C" void ExprIntrp_EndFuncArg()
void ExprIntrp_EndFuncArg()
{
ExprIntrp_nbargs++;
}
extern "C" void ExprIntrp_SumOperator()
void ExprIntrp_SumOperator()
{
Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop();
Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop();
@@ -389,7 +389,7 @@ extern "C" void ExprIntrp_SumOperator()
ExprIntrp_Recept.Push(res);
}
extern "C" void ExprIntrp_MinusOperator()
void ExprIntrp_MinusOperator()
{
Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop();
Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop();
@@ -397,7 +397,7 @@ extern "C" void ExprIntrp_MinusOperator()
ExprIntrp_Recept.Push(res->ShallowSimplified());
}
extern "C" void ExprIntrp_DivideOperator()
void ExprIntrp_DivideOperator()
{
Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop();
Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop();
@@ -405,7 +405,7 @@ extern "C" void ExprIntrp_DivideOperator()
ExprIntrp_Recept.Push(res->ShallowSimplified());
}
extern "C" void ExprIntrp_ExpOperator()
void ExprIntrp_ExpOperator()
{
Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop();
Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop();
@@ -413,7 +413,7 @@ extern "C" void ExprIntrp_ExpOperator()
ExprIntrp_Recept.Push(res->ShallowSimplified());
}
extern "C" void ExprIntrp_ProductOperator()
void ExprIntrp_ProductOperator()
{
Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop();
Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop();
@@ -421,20 +421,20 @@ extern "C" void ExprIntrp_ProductOperator()
ExprIntrp_Recept.Push(res->ShallowSimplified());
}
extern "C" void ExprIntrp_UnaryMinusOperator()
void ExprIntrp_UnaryMinusOperator()
{
Handle(Expr_GeneralExpression) op = ExprIntrp_Recept.Pop();
Handle(Expr_UnaryMinus) res = new Expr_UnaryMinus(op);
ExprIntrp_Recept.Push(res->ShallowSimplified());
}
extern "C" void ExprIntrp_UnaryPlusOperator()
void ExprIntrp_UnaryPlusOperator()
{
Handle(Expr_GeneralExpression) op = ExprIntrp_Recept.Pop();
ExprIntrp_Recept.Push(op);
}
extern "C" void ExprIntrp_VariableIdentifier()
void ExprIntrp_VariableIdentifier()
{
const TCollection_AsciiString& thename = ExprIntrp_GetResult();
Handle(Expr_NamedExpression) nameexp = ExprIntrp_Recept.GetNamed(thename);
@@ -445,7 +445,7 @@ extern "C" void ExprIntrp_VariableIdentifier()
ExprIntrp_Recept.Push(nameexp);
}
extern "C" void ExprIntrp_NumValue()
void ExprIntrp_NumValue()
{
const TCollection_AsciiString& aStr = ExprIntrp_GetResult();
Standard_Real value = aStr.RealValue();
@@ -453,12 +453,12 @@ extern "C" void ExprIntrp_NumValue()
ExprIntrp_Recept.Push(nval);
}
extern "C" void ExprIntrp_AssignVariable()
void ExprIntrp_AssignVariable()
{
ExprIntrp_assname = ExprIntrp_GetResult();
}
extern "C" void ExprIntrp_Deassign()
void ExprIntrp_Deassign()
{
const TCollection_AsciiString& thename = ExprIntrp_GetResult();
Handle(Expr_NamedExpression) nameexp = ExprIntrp_Recept.GetNamed(thename);
@@ -472,25 +472,25 @@ extern "C" void ExprIntrp_Deassign()
var->Deassign();
}
extern "C" void ExprIntrp_DefineFunction()
void ExprIntrp_DefineFunction()
{
ExprIntrp_funcdefname = ExprIntrp_Recept.PopName();
ExprIntrp_Recept.PushValue(ExprIntrp_nbargs);
}
extern "C" void ExprIntrp_close()
void ExprIntrp_close()
{
ExprIntrp_stop_string();
}
extern "C" void ExprIntrperror(char* msg)
void ExprIntrperror(const char* msg)
{
ExprIntrp_close();
throw ExprIntrp_SyntaxError(msg);
}
extern "C" void ExprIntrp_EndOfEqual()
void ExprIntrp_EndOfEqual()
{
Handle(Expr_GeneralExpression) memb2 = ExprIntrp_Recept.Pop();
Handle(Expr_GeneralExpression) memb1 = ExprIntrp_Recept.Pop();
@@ -498,7 +498,7 @@ extern "C" void ExprIntrp_EndOfEqual()
ExprIntrp_Recept.PushRelation(res);
}
extern "C" void ExprIntrp_EndOfRelation()
void ExprIntrp_EndOfRelation()
{
Handle(Expr_SystemRelation) sys;
Handle(Expr_GeneralRelation) currel;
@@ -524,7 +524,7 @@ extern "C" void ExprIntrp_EndOfRelation()
}
}
extern "C" void ExprIntrp_EndOfAssign()
void ExprIntrp_EndOfAssign()
{
Handle(Expr_NamedExpression) namexp = ExprIntrp_Recept.GetNamed(ExprIntrp_assname);
Handle(Expr_NamedUnknown) namu;
@@ -542,7 +542,7 @@ extern "C" void ExprIntrp_EndOfAssign()
namu->Assign(ExprIntrp_Recept.Pop());
}
extern "C" void ExprIntrp_EndOfFuncDef()
void ExprIntrp_EndOfFuncDef()
{
Handle(Expr_GeneralExpression) theexp = ExprIntrp_Recept.Pop();
Standard_Integer nbargs = ExprIntrp_Recept.PopValue();
@@ -571,13 +571,13 @@ extern "C" void ExprIntrp_EndOfFuncDef()
ExprIntrp_Recept.Use(thefunc);
}
extern "C" void ExprIntrp_ConstantIdentifier()
void ExprIntrp_ConstantIdentifier()
{
const TCollection_AsciiString& thename = ExprIntrp_GetResult();
ExprIntrp_Recept.PushName(thename);
}
extern "C" void ExprIntrp_ConstantDefinition()
void ExprIntrp_ConstantDefinition()
{
TCollection_AsciiString name = ExprIntrp_Recept.PopName();
const TCollection_AsciiString& aStr = ExprIntrp_GetResult();
@@ -589,7 +589,7 @@ extern "C" void ExprIntrp_ConstantDefinition()
}
extern "C" void ExprIntrp_Sumator()
void ExprIntrp_Sumator()
{
Handle(Expr_NumericValue) number = Handle(Expr_NumericValue)::DownCast(ExprIntrp_Recept.Pop());
Standard_Integer nb = (Standard_Integer) number->GetValue();
@@ -617,7 +617,7 @@ extern "C" void ExprIntrp_Sumator()
ExprIntrp_Recept.Push(res->ShallowSimplified());
}
extern "C" void ExprIntrp_Productor()
void ExprIntrp_Productor()
{
Handle(Expr_NumericValue) number = Handle(Expr_NumericValue)::DownCast(ExprIntrp_Recept.Pop());
Standard_Integer nb = (Standard_Integer) number->GetValue();

View File

@@ -17,12 +17,8 @@
#ifndef ExprIntrp_yaccintrf_HeaderFile
#define ExprIntrp_yaccintrf_HeaderFile
#ifdef __cplusplus
extern "C" {
#endif
int ExprIntrpparse();
void ExprIntrperror(char* msg);
void ExprIntrperror(const char* msg);
void ExprIntrp_start_string(const char* str);
void ExprIntrp_stop_string();
@@ -32,17 +28,9 @@ void ExprIntrp_SetDegree();
int ExprIntrplex(void);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
#include <TCollection_AsciiString.hxx>
const TCollection_AsciiString& ExprIntrp_GetResult ();
int ExprIntrp_GetDegree();
#endif
#endif

View File

@@ -23,16 +23,16 @@ static int ExprIntrp_degree;
#ifndef _WIN32
extern char* ExprIntrptext;
#else
extern "C" char* ExprIntrptext;
char* ExprIntrptext;
#endif // _WIN32
extern "C" void ExprIntrp_SetResult()
void ExprIntrp_SetResult()
{
ExprIntrp_curres = ExprIntrptext;
}
extern "C" void ExprIntrp_SetDegree()
void ExprIntrp_SetDegree()
{
ExprIntrp_degree = (int)strlen(ExprIntrptext);
}

View File

@@ -1,8 +1,8 @@
ExprIntrp.cxx
ExprIntrp.hxx
ExprIntrp.lex
ExprIntrp.tab.c
ExprIntrp.tab.h
ExprIntrp.tab.cxx
ExprIntrp.tab.hxx
ExprIntrp.yacc
ExprIntrp_Analysis.cxx
ExprIntrp_Analysis.hxx
@@ -27,4 +27,4 @@ ExprIntrp_yaccanal.hxx
ExprIntrp_yaccintrf.cxx
ExprIntrp_yaccintrf.hxx
ExprIntrp_yacclex.cxx
lex.ExprIntrp.c
lex.ExprIntrp.cxx

View File

@@ -95,14 +95,14 @@ public:
int lineno() const { return yylineno; }
int debug() const { return yy_flex_debug; }
void set_debug( int flag ) { yy_flex_debug = flag; }
int debug() const { return yyflexdebug; }
void set_debug( int flag ) { yyflexdebug = flag; }
protected:
char* yytext;
int yyleng;
int yylineno; // only maintained if you use %option yylineno
int yy_flex_debug; // only has effect with -d or "%option debug"
int yyflexdebug; // only has effect with -d or "%option debug"
};
}
@@ -139,6 +139,7 @@ public:
void yypush_buffer_state( yy_buffer_state* new_buffer );
void yypop_buffer_state();
virtual int yyread(char *buf, size_t);
virtual int yylex();
virtual void switch_streams( std::istream& new_in, std::ostream& new_out );
virtual void switch_streams( std::istream* new_in = 0, std::ostream* new_out = 0 );
@@ -148,8 +149,8 @@ protected:
virtual int LexerInput( char* buf, int max_size );
virtual void LexerOutput( const char* buf, int size );
virtual void LexerError( const char* msg );
void yyunput( int c, char* buf_ptr );
void yyunput_r( int c, char* buf_ptr );
int yyinput();
void yy_load_buffer_state();
@@ -201,6 +202,7 @@ protected:
yy_state_type* yy_state_buf;
yy_state_type* yy_state_ptr;
size_t yy_state_buf_max;
char* yy_full_match;
int* yy_full_state;

View File

@@ -14,7 +14,6 @@
#ifndef _Graphic3d_CView_HeaderFile
#define _Graphic3d_CView_HeaderFile
#include <Aspect_GridParams.hxx>
#include <Aspect_RenderingContext.hxx>
#include <Aspect_SkydomeBackground.hxx>
#include <Aspect_Window.hxx>
@@ -548,12 +547,6 @@ public: //! @name obsolete Graduated Trihedron functionality
//! Erases Graduated Trihedron.
virtual void GraduatedTrihedronErase() {}
//! Displays Grid.
virtual void GridDisplay (const Aspect_GridParams& theGridParams) { (void)theGridParams; }
//! Erases Grid.
virtual void GridErase() {}
//! Sets minimum and maximum points of scene bounding box for Graduated Trihedron stored in graphic view object.
//! @param theMin [in] the minimum point of scene.
//! @param theMax [in] the maximum point of scene.

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2013-2021 OPEN CASCADE SAS
// Copyright (c) 2013-2021 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -2183,109 +2183,3 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getColoredQuadProgram()
return aProgSrc;
}
Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getGridProgram() const
{
Handle(Graphic3d_ShaderProgram) aProgSrc = new Graphic3d_ShaderProgram();
Graphic3d_ShaderObject::ShaderVariableList aUniforms, aStageInOuts;
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("vec3 NearPoint", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("vec3 FarPoint", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("mat4 MVP", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
aUniforms.Append (Graphic3d_ShaderObject::ShaderVariable ("float uZNear", Graphic3d_TOS_FRAGMENT));
aUniforms.Append (Graphic3d_ShaderObject::ShaderVariable ("float uZFar", Graphic3d_TOS_FRAGMENT));
aUniforms.Append (Graphic3d_ShaderObject::ShaderVariable ("float uScale", Graphic3d_TOS_FRAGMENT));
aUniforms.Append (Graphic3d_ShaderObject::ShaderVariable ("float uThickness", Graphic3d_TOS_FRAGMENT));
aUniforms.Append (Graphic3d_ShaderObject::ShaderVariable ("bool uIsDrawAxis", Graphic3d_TOS_FRAGMENT));
aUniforms.Append (Graphic3d_ShaderObject::ShaderVariable ("vec3 uColor", Graphic3d_TOS_FRAGMENT));
TCollection_AsciiString aSrcVert = TCollection_AsciiString()
+ EOL"vec3 gridPlane[6] = vec3[] (vec3( 1.0, 1.0, 0.0), vec3(-1.0, -1.0, 0.0), vec3(-1.0, 1.0, 0.0),"
EOL" vec3(-1.0, -1.0, 0.0), vec3( 1.0, 1.0, 0.0), vec3( 1.0, -1.0, 0.0));"
EOL"vec3 UnprojectPoint (float aX, float anY, float aZ)"
EOL"{"
EOL" vec4 anUnprojPnt = occModelWorldMatrixInverse * occWorldViewMatrixInverse * occProjectionMatrixInverse * vec4 (aX, anY, aZ, 1.0);"
EOL" return anUnprojPnt.xyz / anUnprojPnt.w;"
EOL"}"
EOL"void main()"
EOL"{"
EOL" vec3 aVertex = gridPlane[gl_VertexID];"
EOL" NearPoint = UnprojectPoint (aVertex.x, aVertex.y, 0.0);"
EOL" FarPoint = UnprojectPoint (aVertex.x, aVertex.y, 1.0);"
EOL" MVP = occProjectionMatrix * occWorldViewMatrix * occModelWorldMatrix;"
EOL" gl_Position = vec4 (aVertex, 1.0);"
EOL"}";
TCollection_AsciiString aSrcFrag = TCollection_AsciiString()
+ EOL"vec4 grid (vec3 theFragPos3D, vec3 theColor, float theScale, bool theIsDrawAxis, float theThickness)"
EOL"{"
EOL" vec2 aCoord = theFragPos3D.xy * theScale;"
EOL" vec2 aDerivative = max (fwidth (aCoord), vec2 (theThickness));"
EOL" vec2 aGrid = abs (fract (aCoord - 0.5) - 0.5) / aDerivative;"
EOL" float aLine = min (aGrid.x, aGrid.y);"
EOL" float aMinY = min (aDerivative.y, 1.0);"
EOL" float aMinX = min (aDerivative.x, 1.0);"
EOL" vec4 aColor = vec4 (theColor, round (1.0 - min (aLine, 1.0)));"
EOL" if (uIsDrawAxis && theIsDrawAxis)"
EOL" {"
EOL" bool isYAxis = abs(aCoord.x) < aMinX;"
EOL" bool isXAxis = abs(aCoord.y) < aMinY;"
EOL" if (isXAxis && isYAxis) { aColor.xyz = vec3 (0.0, 0.0, 1.0); }"
EOL" else if (isXAxis) { aColor.xyz = vec3 (1.0, 0.0, 0.0); }"
EOL" else if (isYAxis) { aColor.xyz = vec3 (0.0, 1.0, 0.0); }"
EOL" }"
EOL" return aColor;"
EOL" }"
EOL"float computeDepth (vec3 thePos)"
EOL"{"
EOL" vec4 aClipSpacePos = MVP * vec4 (thePos, 1.0);"
EOL" return (aClipSpacePos.z / aClipSpacePos.w);"
EOL"}"
EOL"float computeLinearDepth (vec3 thePos)"
EOL"{"
EOL" float aClipSpaceDepth = computeDepth (thePos) * 2.0 - 1.0;"
EOL" float aLinearDepth = (2.0 * uZNear * uZFar) / (uZFar + uZNear - aClipSpaceDepth * (uZFar - uZNear));"
EOL" return aLinearDepth / uZFar;"
EOL"}"
EOL"void main()"
EOL"{"
EOL" float aParam = -NearPoint.z / (FarPoint.z - NearPoint.z);"
EOL" vec3 aFragPos3D = NearPoint + aParam * (FarPoint - NearPoint);"
EOL" float aLinearDepth = computeLinearDepth (aFragPos3D);"
EOL" vec4 aBigGridColor = grid (aFragPos3D, uColor, uScale, true, uThickness);"
EOL" vec4 aColor = aBigGridColor.a == 0.0"
EOL" ? grid (aFragPos3D, 0.25 * uColor, uScale * 10.0, false, uThickness)"
EOL" : aBigGridColor;"
EOL" float aDepth = computeDepth (aFragPos3D);"
EOL" float aFar = gl_DepthRange.far;"
EOL" float aNear = gl_DepthRange.near;"
EOL" aDepth = ((aFar - aNear) * aDepth + aNear + aFar) * 0.5;"
EOL" if (aColor.a == 0.0 || (-1.0 < aLinearDepth && aLinearDepth < 0.0))"
EOL" {"
EOL" discard;"
EOL" };"
EOL" if (aLinearDepth < 0.0)"
EOL" {"
EOL" float aFading = max (0.0, 0.5 * log (abs (aLinearDepth)));"
EOL" aColor.a *= aFading;"
EOL" }"
EOL" gl_FragDepth = aDepth;"
EOL" occFragColor = aColor;"
EOL"}";
defaultGlslVersion (aProgSrc, "grid", 0);
aProgSrc->AttachShader (Graphic3d_ShaderObject::CreateFromSource (aSrcVert, Graphic3d_TOS_VERTEX, aUniforms, aStageInOuts));
aProgSrc->AttachShader (Graphic3d_ShaderObject::CreateFromSource (aSrcFrag, Graphic3d_TOS_FRAGMENT, aUniforms, aStageInOuts));
return aProgSrc;
}

View File

@@ -148,9 +148,6 @@ protected:
//! Generates shader program to render correctly colored quad.
Standard_EXPORT Handle(Graphic3d_ShaderProgram) getColoredQuadProgram() const;
//! Generates shader program to render grid.
Standard_EXPORT Handle(Graphic3d_ShaderProgram) getGridProgram() const;
//! Prepare GLSL source for IBL generation used in PBR pipeline.
Standard_EXPORT Handle(Graphic3d_ShaderProgram) getPBREnvBakingProgram (Standard_Integer theIndex) const;

View File

@@ -1361,27 +1361,6 @@ Standard_Boolean OpenGl_ShaderManager::preparePBREnvBakingProgram (Standard_Inte
return Standard_True;
}
// =======================================================================
// function : prepareGridProgram
// purpose :
// =======================================================================
Standard_Boolean OpenGl_ShaderManager::prepareGridProgram()
{
Handle(Graphic3d_ShaderProgram) aProgramSrc = getGridProgram();
TCollection_AsciiString aKey;
if (!Create (aProgramSrc, aKey, myGridProgram))
{
myGridProgram = new OpenGl_ShaderProgram(); // just mark as invalid
return Standard_False;
}
myContext->BindProgram (myGridProgram);
myContext->BindProgram (Handle(OpenGl_ShaderProgram)());
return Standard_True;
}
// =======================================================================
// function : GetBgCubeMapProgram
// purpose :

View File

@@ -225,16 +225,6 @@ public:
return myContext->BindProgram (myPBREnvBakingProgram[theIndex]);
}
//! Bind program for grid visualisation.
Standard_Boolean BindGridProgram()
{
if (myGridProgram.IsNull())
{
prepareGridProgram();
}
return bindProgramWithState (myGridProgram, Graphic3d_TypeOfShadingModel_Unlit);
}
//! Generates shader program to render environment cubemap as background.
Standard_EXPORT const Handle(Graphic3d_ShaderProgram)& GetBgCubeMapProgram();
@@ -719,9 +709,6 @@ protected:
Standard_Boolean IsPbrAllowed() const { return myShadingModel == Graphic3d_TypeOfShadingModel_Pbr
|| myShadingModel == Graphic3d_TypeOfShadingModel_PbrFacet; }
//! Generate standard GLSL program for grid.
Standard_EXPORT Standard_Boolean prepareGridProgram();
protected:
//! Packed properties of light source
@@ -789,7 +776,6 @@ protected:
Handle(Graphic3d_ShaderProgram) myBgCubeMapProgram; //!< program for background cubemap rendering
Handle(Graphic3d_ShaderProgram) myBgSkydomeProgram; //!< program for background cubemap rendering
Handle(Graphic3d_ShaderProgram) myColoredQuadProgram; //!< program for correct quad rendering
Handle(OpenGl_ShaderProgram) myGridProgram; //!< program for grid rendering
Handle(OpenGl_ShaderProgram) myStereoPrograms[Graphic3d_StereoMode_NB]; //!< standard stereo programs

View File

@@ -108,7 +108,6 @@ OpenGl_View::OpenGl_View (const Handle(Graphic3d_StructureManager)& theMgr,
myCaps (theCaps),
myWasRedrawnGL (Standard_False),
myToShowGradTrihedron (false),
myToShowGrid (false),
myStateCounter (theCounter),
myCurrLightSourceState (theCounter->Increment()),
myLightsRevision (0),
@@ -503,25 +502,6 @@ void OpenGl_View::GraduatedTrihedronErase()
myToShowGradTrihedron = false;
}
// =======================================================================
// function : GridDisplay
// purpose :
// =======================================================================
void OpenGl_View::GridDisplay (const Aspect_GridParams& theGridParams)
{
myGridParams = theGridParams;
myToShowGrid = true;
}
// =======================================================================
// function : GridErase
// purpose :
// =======================================================================
void OpenGl_View::GridErase()
{
myToShowGrid = false;
}
// =======================================================================
// function : GraduatedTrihedronMinMaxValues
// purpose :
@@ -2518,12 +2498,6 @@ void OpenGl_View::render (Graphic3d_Camera::Projection theProjection,
aContext->core11fwd->glDisable (GL_LIGHTING);
}
// ====================================
// Step 3: Redraw grid
// ====================================
renderGrid();
// =================================
// Step 3: Redraw main plane
// =================================
@@ -2616,82 +2590,6 @@ void OpenGl_View::render (Graphic3d_Camera::Projection theProjection,
}
}
// =======================================================================
// function : renderGrid
// purpose :
// =======================================================================
void OpenGl_View::renderGrid()
{
if (!myToShowGrid)
{
return;
}
const Handle(OpenGl_Context)& aContext = myWorkspace->GetGlContext();
if (MinMaxValues (Standard_True).IsVoid())
{
Bnd_Box aDummy;
aDummy.Set (myGridParams.Position());
aContext->Camera()->ZFitAll (1.0, aDummy, aDummy);
}
Standard_Real aZNear = aContext->Camera()->ZNear();
Standard_Real aZFar = aContext->Camera()->ZFar();
aContext->Camera()->SetZRange (aZNear, Max (aZNear * 1.001, aZFar));
aContext->ProjectionState.SetCurrent (aContext->Camera()->ProjectionMatrixF());
aContext->ApplyProjectionMatrix();
OpenGl_Mat4 aCurrent = aContext->WorldViewState.Current();
aContext->WorldViewState.Push();
OpenGl_Mat4 aMat;
if (!myGridParams.IsHorizontal())
{
aMat.SetRow (0, Graphic3d_Vec4 (1, 0, 0, 0));
aMat.SetRow (1, Graphic3d_Vec4 (0, 0, -1, 0));
aMat.SetRow (2, Graphic3d_Vec4 (0, 1, 0, 0));
aMat.SetRow (3, Graphic3d_Vec4 (0, 0, 0, 1));
}
const gp_Pnt& aPosition = myGridParams.Position();
aMat.SetColumn (3, Graphic3d_Vec4 ((float)aPosition.X(), (float)aPosition.Y(), (float)aPosition.Z(), 1.0));
aContext->WorldViewState.SetCurrent (aCurrent * aMat);
aContext->ApplyWorldViewMatrix();
aContext->core11fwd->glEnable (GL_BLEND);
aContext->core11fwd->glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
aContext->core11fwd->glEnable (GL_MULTISAMPLE);
const Standard_Real aCameraScale = aContext->Camera()->Scale();
Standard_Real aScale = myGridParams.IsInfinity()
? 10.0 / pow (10.0, floor (log10 (Max (aCameraScale, 1.0))) + 1.0)
: myGridParams.Scale();
if (aContext->ShaderManager()->BindGridProgram())
{
const Handle(OpenGl_ShaderProgram)& aProg = aContext->ActiveProgram();
aProg->SetUniform (aContext, "uZNear", GLfloat (aContext->Camera()->ZNear()));
aProg->SetUniform (aContext, "uZFar", GLfloat (aContext->Camera()->ZFar()));
aProg->SetUniform (aContext, "uScale", GLfloat (aScale));
aProg->SetUniform (aContext, "uThickness", GLfloat (myGridParams.LineThickness()));
aProg->SetUniform (aContext, "uColor", OpenGl_Vec3 (myGridParams.Color().Rgb()));
aProg->SetUniform(aContext, "uIsDrawAxis", GLboolean(myGridParams.IsDrawAxis()));
aContext->core20fwd->glDrawArrays (GL_TRIANGLES, 0, 6);
aContext->BindProgram (NULL);
}
aContext->Camera()->SetZRange (aZNear, aZFar);
aContext->WorldViewState.Pop();
aContext->ApplyWorldViewMatrix();
}
// =======================================================================
// function : InvalidateBVHData
// purpose :

View File

@@ -306,12 +306,6 @@ public: //! @name obsolete Graduated Trihedron functionality
//! Erases Graduated Trihedron.
Standard_EXPORT virtual void GraduatedTrihedronErase() Standard_OVERRIDE;
//! Displays Grid.
Standard_EXPORT virtual void GridDisplay (const Aspect_GridParams& theGridParams) Standard_OVERRIDE;
//! Erases Grid.
Standard_EXPORT virtual void GridErase() Standard_OVERRIDE;
//! Sets minimum and maximum points of scene bounding box for Graduated Trihedron stored in graphic view object.
//! @param theMin [in] the minimum point of scene.
//! @param theMax [in] the maximum point of scene.
@@ -402,9 +396,6 @@ protected: //! @name Rendering of GL graphics (with prepared drawing buffer).
OpenGl_FrameBuffer* theOitAccumFbo,
const Standard_Boolean theToDrawImmediate);
//! Renders grid
Standard_EXPORT void renderGrid();
//! Renders trihedron.
void renderTrihedron (const Handle(OpenGl_Workspace) &theWorkspace);
@@ -458,9 +449,7 @@ protected:
gp_XYZ myLocalOrigin;
Handle(OpenGl_FrameBuffer) myFBO;
Standard_Boolean myToShowGradTrihedron;
Standard_Boolean myToShowGrid;
Graphic3d_GraduatedTrihedron myGTrihedronData;
Aspect_GridParams myGridParams;
Handle(Graphic3d_LightSet) myNoShadingLight;
Handle(Graphic3d_LightSet) myLights;

File diff suppressed because it is too large Load Diff

View File

@@ -27,12 +27,15 @@
case-insensitive enable case insensitive parsing(any ?i: and other case setting will be ignored)
*/
%option c++
%option 8bit warn nodefault
%option 8bit
%option warn
%option noyywrap
%option noinput
%option yyclass="step::scanner"
%option noyyalloc noyyfree noyyrealloc
%option case-insensitive
%option nounistd
%option never-interactive
%top{
// This file is part of Open CASCADE Technology software library.

View File

@@ -1,8 +1,8 @@
// A Bison parser, made by GNU Bison 3.7.4.
// A Bison parser, made by GNU Bison 3.8.2.
// Skeleton implementation for Bison LALR(1) parsers in C++
// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// As a special exception, you may create a larger work that contains
// part or all of the Bison parser skeleton and distribute that work
@@ -117,7 +117,7 @@ void StepFile_Interrupt (Standard_CString theErrorMessage, const Standard_Boolea
#else // !YYDEBUG
# define YYCDEBUG if (false) std::cerr
# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol)
# define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol)
# define YY_REDUCE_PRINT(Rule) static_cast<void> (0)
# define YY_STACK_PRINT() static_cast<void> (0)
@@ -150,9 +150,9 @@ namespace step {
parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
{}
/*---------------.
| symbol kinds. |
`---------------*/
/*---------.
| symbol. |
`---------*/
// basic_symbol.
template <typename Base>
@@ -170,11 +170,12 @@ namespace step {
{}
template <typename Base>
parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, YY_RVREF (semantic_type) v)
parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, YY_RVREF (value_type) v)
: Base (t)
, value (YY_MOVE (v))
{}
template <typename Base>
parser::symbol_kind_type
parser::basic_symbol<Base>::type_get () const YY_NOEXCEPT
@@ -182,6 +183,7 @@ namespace step {
return this->kind ();
}
template <typename Base>
bool
parser::basic_symbol<Base>::empty () const YY_NOEXCEPT
@@ -198,28 +200,30 @@ namespace step {
}
// by_kind.
parser::by_kind::by_kind ()
parser::by_kind::by_kind () YY_NOEXCEPT
: kind_ (symbol_kind::S_YYEMPTY)
{}
#if 201103L <= YY_CPLUSPLUS
parser::by_kind::by_kind (by_kind&& that)
parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT
: kind_ (that.kind_)
{
that.clear ();
}
#endif
parser::by_kind::by_kind (const by_kind& that)
parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT
: kind_ (that.kind_)
{}
parser::by_kind::by_kind (token_kind_type t)
parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT
: kind_ (yytranslate_ (t))
{}
void
parser::by_kind::clear ()
parser::by_kind::clear () YY_NOEXCEPT
{
kind_ = symbol_kind::S_YYEMPTY;
}
@@ -237,6 +241,7 @@ namespace step {
return kind_;
}
parser::symbol_kind_type
parser::by_kind::type_get () const YY_NOEXCEPT
{
@@ -244,6 +249,7 @@ namespace step {
}
// by_state.
parser::by_state::by_state () YY_NOEXCEPT
: state (empty_state)
@@ -326,7 +332,7 @@ namespace step {
YY_SYMBOL_PRINT (yymsg, yysym);
// User destructor.
YYUSE (yysym.kind ());
YY_USE (yysym.kind ());
}
#if YYDEBUG
@@ -335,7 +341,7 @@ namespace step {
parser::yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const
{
std::ostream& yyoutput = yyo;
YYUSE (yyoutput);
YY_USE (yyoutput);
if (yysym.empty ())
yyo << "empty symbol";
else
@@ -343,7 +349,7 @@ namespace step {
symbol_kind_type yykind = yysym.kind ();
yyo << (yykind < YYNTOKENS ? "token" : "nterm")
<< ' ' << yysym.name () << " (";
YYUSE (yykind);
YY_USE (yykind);
yyo << ')';
}
}
@@ -369,7 +375,7 @@ namespace step {
}
void
parser::yypop_ (int n)
parser::yypop_ (int n) YY_NOEXCEPT
{
yystack_.pop (n);
}
@@ -412,13 +418,13 @@ namespace step {
}
bool
parser::yy_pact_value_is_default_ (int yyvalue)
parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT
{
return yyvalue == yypact_ninf_;
}
bool
parser::yy_table_value_is_error_ (int yyvalue)
parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT
{
return yyvalue == yytable_ninf_;
}
@@ -884,16 +890,16 @@ namespace step {
// Actual number of expected tokens
int yycount = 0;
int yyn = yypact_[+yyparser_.yystack_[0].state];
const int yyn = yypact_[+yyparser_.yystack_[0].state];
if (!yy_pact_value_is_default_ (yyn))
{
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. In other words, skip the first -YYN actions for
this state because they are default actions. */
int yyxbegin = yyn < 0 ? -yyn : 0;
const int yyxbegin = yyn < 0 ? -yyn : 0;
// Stay within bounds of both yycheck and yytname.
int yychecklim = yylast_ - yyn + 1;
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
const int yychecklim = yylast_ - yyn + 1;
const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror
&& !yy_table_value_is_error_ (yytable_[yyx + yyn]))
@@ -914,6 +920,9 @@ namespace step {
int
parser::yy_syntax_error_arguments_ (const context& yyctx,
symbol_kind_type yyarg[], int yyargn) const
@@ -1038,7 +1047,7 @@ namespace step {
const signed char
parser::yydefgoto_[] =
{
-1, 71, 62, 2, 3, 4, 5, 11, 12, 15,
0, 71, 62, 2, 3, 4, 5, 11, 12, 15,
32, 33, 19, 34, 35, 36, 23, 24, 54, 49,
50, 74, 75, 67, 59, 25, 51
};
@@ -1163,7 +1172,7 @@ namespace step {
#endif // YYDEBUG
parser::symbol_kind_type
parser::yytranslate_ (int t)
parser::yytranslate_ (int t) YY_NOEXCEPT
{
// YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
// TOKEN-NUM as returned by yylex.
@@ -1206,7 +1215,7 @@ namespace step {
if (t <= 0)
return symbol_kind::S_YYEOF;
else if (t <= code_max)
return YY_CAST (symbol_kind_type, translate_table[t]);
return static_cast <symbol_kind_type> (translate_table[t]);
else
return symbol_kind::S_YYUNDEF;
}

View File

@@ -1,8 +1,8 @@
// A Bison parser, made by GNU Bison 3.7.4.
// A Bison parser, made by GNU Bison 3.8.2.
// Skeleton interface for Bison LALR(1) parsers in C++
// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// As a special exception, you may create a larger work that contains
// part or all of the Bison parser skeleton and distribute that work
@@ -127,17 +127,23 @@ namespace step {
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
# define YYUSE(E) ((void) (E))
# define YY_USE(E) ((void) (E))
#else
# define YYUSE(E) /* empty */
# define YY_USE(E) /* empty */
#endif
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
# else
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# endif
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
#else
@@ -198,12 +204,18 @@ namespace step {
class parser
{
public:
#ifndef YYSTYPE
/// Symbol semantic values.
typedef int semantic_type;
#ifdef YYSTYPE
# ifdef __GNUC__
# pragma GCC message "bison: do not #define YYSTYPE in C++, use %define api.value.type"
# endif
typedef YYSTYPE value_type;
#else
typedef YYSTYPE semantic_type;
/// Symbol semantic values.
typedef int value_type;
#endif
/// Backward compatibility (Bison 3.8).
typedef value_type semantic_type;
/// Syntax errors thrown from user actions.
struct syntax_error : std::runtime_error
@@ -251,7 +263,7 @@ namespace step {
};
/// Token kind, as returned by yylex.
typedef token::yytokentype token_kind_type;
typedef token::token_kind_type token_kind_type;
/// Backward compatibility alias (Bison 3.6).
typedef token_kind_type token_type;
@@ -339,7 +351,7 @@ namespace step {
typedef Base super_type;
/// Default constructor.
basic_symbol ()
basic_symbol () YY_NOEXCEPT
: value ()
{}
@@ -358,7 +370,7 @@ namespace step {
/// Constructor for symbols with semantic value.
basic_symbol (typename Base::kind_type t,
YY_RVREF (semantic_type) v);
YY_RVREF (value_type) v);
/// Destroy the symbol.
~basic_symbol ()
@@ -366,8 +378,10 @@ namespace step {
clear ();
}
/// Destroy contents, and record that is empty.
void clear ()
void clear () YY_NOEXCEPT
{
Base::clear ();
}
@@ -388,7 +402,7 @@ namespace step {
void move (basic_symbol& s);
/// The semantic value.
semantic_type value;
value_type value;
private:
#if YY_CPLUSPLUS < 201103L
@@ -400,25 +414,27 @@ namespace step {
/// Type access provider for token (enum) based symbols.
struct by_kind
{
/// Default constructor.
by_kind ();
#if 201103L <= YY_CPLUSPLUS
/// Move constructor.
by_kind (by_kind&& that);
#endif
/// Copy constructor.
by_kind (const by_kind& that);
/// The symbol kind as needed by the constructor.
typedef token_kind_type kind_type;
/// Default constructor.
by_kind () YY_NOEXCEPT;
#if 201103L <= YY_CPLUSPLUS
/// Move constructor.
by_kind (by_kind&& that) YY_NOEXCEPT;
#endif
/// Copy constructor.
by_kind (const by_kind& that) YY_NOEXCEPT;
/// Constructor from (external) token numbers.
by_kind (kind_type t);
by_kind (kind_type t) YY_NOEXCEPT;
/// Record that this symbol is empty.
void clear ();
void clear () YY_NOEXCEPT;
/// Steal the symbol kind from \a that.
void move (by_kind& that);
@@ -492,8 +508,8 @@ namespace step {
{
public:
context (const parser& yyparser, const symbol_type& yyla);
const symbol_type& lookahead () const { return yyla_; }
symbol_kind_type token () const { return yyla_.kind (); }
const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; }
symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); }
/// Put in YYARG at most YYARGN of the expected tokens, and return the
/// number of tokens stored in YYARG. If YYARG is null, return the
/// number of expected tokens (guaranteed to be less than YYNTOKENS).
@@ -530,19 +546,19 @@ namespace step {
/// Whether the given \c yypact_ value indicates a defaulted state.
/// \param yyvalue the value to check
static bool yy_pact_value_is_default_ (int yyvalue);
static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT;
/// Whether the given \c yytable_ value indicates a syntax error.
/// \param yyvalue the value to check
static bool yy_table_value_is_error_ (int yyvalue);
static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT;
static const signed char yypact_ninf_;
static const signed char yytable_ninf_;
/// Convert a scanner token kind \a t to a symbol kind.
/// In theory \a t should be a token_kind_type, but character literals
/// are valid, yet not members of the token_type enum.
static symbol_kind_type yytranslate_ (int t);
/// are valid, yet not members of the token_kind_type enum.
static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT;
/// Convert the symbol name \a n to a form suitable for a diagnostic.
static std::string yytnamerr_ (const char *yystr);
@@ -574,14 +590,14 @@ namespace step {
static const signed char yycheck_[];
// YYSTOS[STATE-NUM] -- The (internal number of the) accessing
// symbol of state STATE-NUM.
// YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
// state STATE-NUM.
static const signed char yystos_[];
// YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
// YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.
static const signed char yyr1_[];
// YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
// YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.
static const signed char yyr2_[];
@@ -680,7 +696,7 @@ namespace step {
typedef typename S::size_type size_type;
typedef typename std::ptrdiff_t index_type;
stack (size_type n = 200)
stack (size_type n = 200) YY_NOEXCEPT
: seq_ (n)
{}
@@ -759,7 +775,7 @@ namespace step {
class slice
{
public:
slice (const stack& stack, index_type range)
slice (const stack& stack, index_type range) YY_NOEXCEPT
: stack_ (stack)
, range_ (range)
{}
@@ -809,7 +825,7 @@ namespace step {
void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
/// Pop \a n symbols from the stack.
void yypop_ (int n = 1);
void yypop_ (int n = 1) YY_NOEXCEPT;
/// Constants.
enum

View File

@@ -134,9 +134,6 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
if ( count < 2 ) isSeam = Standard_False;
}
BRepAdaptor_Curve CA = BRepAdaptor_Curve(aEdge);
BRepAdaptor_Surface SA = BRepAdaptor_Surface(aTool.CurrentFace());
if (aEdge.Orientation() == TopAbs_INTERNAL ||
aEdge.Orientation() == TopAbs_EXTERNAL ) {
Handle(TransferBRep_ShapeMapper) errShape =
@@ -184,7 +181,7 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
// ---------------------------------------
// Translate 3D representation of the Edge
// ---------------------------------------
BRepAdaptor_Curve CA = BRepAdaptor_Curve(aEdge);
Handle(StepGeom_Curve) Gpms;
Handle(Geom_Curve) C = CA.Curve().Curve();
@@ -262,6 +259,8 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
#ifdef OCCT_DEBUG
std::cout << "Warning: TopoDSToStep_MakeStepEdge: edge without 3d curve; creating..." << std::endl;
#endif
BRepAdaptor_Surface SA = BRepAdaptor_Surface(aTool.CurrentFace());
if ((SA.GetType() == GeomAbs_Plane) &&
(CA.GetType() == GeomAbs_Line)) {
U1 = CA.FirstParameter();

View File

@@ -106,11 +106,6 @@ void V3d_CircularGrid::Display ()
UpdateDisplay();
}
void V3d_CircularGrid::Update()
{
//
}
void V3d_CircularGrid::Erase () const
{
myStructure->Erase ();

View File

@@ -38,17 +38,15 @@ public:
Standard_EXPORT virtual ~V3d_CircularGrid();
Standard_EXPORT void SetColors (const Quantity_Color& aColor, const Quantity_Color& aTenthColor) Standard_OVERRIDE;
Standard_EXPORT void Display() Standard_OVERRIDE;
Standard_EXPORT void Update() Standard_OVERRIDE;
Standard_EXPORT void Erase() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsDisplayed() const Standard_OVERRIDE;
Standard_EXPORT void GraphicValues (Standard_Real& Radius, Standard_Real& OffSet) const;
Standard_EXPORT void SetGraphicValues (const Standard_Real Radius, const Standard_Real OffSet);
//! Dumps the content of me into the stream

View File

@@ -106,12 +106,6 @@ void V3d_RectangularGrid::Display ()
UpdateDisplay();
}
void V3d_RectangularGrid::Update()
{
SetXStep (XStep() + 1);
UpdateDisplay();
}
void V3d_RectangularGrid::Erase () const
{
myStructure->Erase ();

View File

@@ -40,8 +40,6 @@ public:
Standard_EXPORT virtual void Display() Standard_OVERRIDE;
Standard_EXPORT virtual void Update() Standard_OVERRIDE;
Standard_EXPORT virtual void Erase() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean IsDisplayed() const Standard_OVERRIDE;

View File

@@ -3797,24 +3797,6 @@ void V3d_View::GraduatedTrihedronErase()
myView->GraduatedTrihedronErase();
}
//=============================================================================
//function : GridDisplay
//purpose :
//=============================================================================
void V3d_View::GridDisplay (const Aspect_GridParams& theGridParams)
{
myView->GridDisplay (theGridParams);
}
//=============================================================================
//function : GridErase
//purpose :
//=============================================================================
void V3d_View::GridErase()
{
myView->GridErase();
}
// =======================================================================
// function : DumpJson
// purpose :

View File

@@ -318,12 +318,6 @@ public:
//! Erases a graduated trihedron from the view.
Standard_EXPORT void GraduatedTrihedronErase();
//! Displays a grid.
Standard_EXPORT void GridDisplay (const Aspect_GridParams& theGridParams);
//! Erases a grid from the view.
Standard_EXPORT void GridErase();
//! modify the Projection of the view perpendicularly to
//! the privileged plane of the viewer.
Standard_EXPORT void SetFront();

View File

@@ -5392,116 +5392,6 @@ static int VGrid (Draw_Interpretor& /*theDI*/,
return 0;
}
//==============================================================================
//function : VInfGrid
//purpose :
//==============================================================================
static int VInfGrid (Draw_Interpretor& /*theDI*/,
Standard_Integer theArgNb,
const char** theArgVec)
{
Handle(V3d_View) aView = ViewerTest::CurrentView();
Handle(V3d_Viewer) aViewer = ViewerTest::GetViewerFromContext();
if (aView.IsNull() || aViewer.IsNull())
{
Message::SendFail("Error: no active viewer");
return 1;
}
Aspect_GridParams aGridParams;
Standard_Boolean toDisplay = true;
ViewerTest_AutoUpdater anUpdateTool (ViewerTest::GetAISContext(), aView);
for (Standard_Integer anArgIter = 1; anArgIter < theArgNb; ++anArgIter)
{
TCollection_AsciiString anArg (theArgVec[anArgIter]);
anArg.LowerCase();
if (anUpdateTool.parseRedrawMode(theArgVec[anArgIter]))
{
continue;
}
else if (anArgIter < theArgNb && anArg == "-vertical")
{
aGridParams.SetIsHorizontal (Standard_False);
}
else if (anArgIter + 1 < theArgNb && anArg == "-drawaxis")
{
Standard_Integer aVal = Draw::Atoi (theArgVec[++anArgIter]);
if (aVal == 0)
{
aGridParams.SetIsDrawAxis (Standard_False);
}
else if (aVal == 1)
{
aGridParams.SetIsDrawAxis (Standard_True);
}
else
{
Message::SendFail() << "Syntax error at '" << anArg << " " << aVal <<"'";
return 1;
}
}
else if (anArgIter + 3 < theArgNb && (anArg == "-color"))
{
Quantity_Color aColor;
aColor.SetValues (Draw::Atof (theArgVec[anArgIter + 1]), Draw::Atof (theArgVec[anArgIter + 2]), Draw::Atof (theArgVec[anArgIter + 3]), Quantity_TOC_RGB);
aGridParams.SetColor (aColor);
anArgIter += 3;
}
else if (anArgIter + 3 < theArgNb && anArg == "-origin")
{
gp_Pnt aPoint;
aPoint.SetXYZ (gp_XYZ (Draw::Atof (theArgVec[anArgIter + 1]), Draw::Atof (theArgVec[anArgIter + 2]), Draw::Atof (theArgVec[anArgIter + 3])));
aGridParams.SetPosition (aPoint);
anArgIter += 3;
}
else if (anArgIter + 1 < theArgNb && (anArg == "-inf"))
{
Standard_Integer aVal = Draw::Atoi(theArgVec[++anArgIter]);
if (aVal == 0)
{
aGridParams.SetIsInfinity (Standard_False);
}
else if (aVal == 1)
{
aGridParams.SetIsInfinity (Standard_True);
}
else
{
Message::SendFail() << "Syntax error at '" << anArg << " " << aVal << "'";
return 1;
}
}
else if (anArgIter + 1 < theArgNb && (anArg == "-scale"))
{
aGridParams.SetScale (Draw::Atof(theArgVec[++anArgIter]));
}
else if (anArgIter + 1 < theArgNb && anArg == "-linethickness")
{
aGridParams.SetLineThickness (Draw::Atof (theArgVec[++anArgIter]));
}
else if (anArgIter >= theArgNb && anArg == "off")
{
toDisplay = Standard_False;
}
else
{
Message::SendFail() << "Syntax error at '" << anArg << "'";
return 1;
}
}
if (toDisplay)
{
ViewerTest::CurrentView()->GridDisplay (aGridParams);
}
else
{
ViewerTest::CurrentView()->GridErase();
}
return 0;
}
//==============================================================================
//function : VPriviledgedPlane
//purpose :
@@ -14535,11 +14425,6 @@ vgrid [off] [-type {rect|circ}] [-mode {line|point}] [-origin X Y] [-rotAngle An
[-step StepRadius NbDivisions] [-radius Radius]
)" /* [vgrid] */);
addCmd("vinfgrid", VInfGrid, /* [vinfgrid] */ R"(
vinfgrid [off] [-vertical] [-drawAxis {0|1}] [-color R G B] [-origin X Y Z]
[-inf {0|1}] [-scale value] [-lineThickness value]
)" /* [vinfgrid] */);
addCmd ("vpriviledgedplane", VPriviledgedPlane, /* [vpriviledgedplane] */ R"(
vpriviledgedplane [Ox Oy Oz Nx Ny Nz [Xx Xy Xz]]
Sets or prints viewer's priviledged plane geometry:

View File

@@ -1,23 +0,0 @@
puts "=================================="
puts "Grid in ortographic projection"
puts "=================================="
pload MODELING VISUALIZATION
vclear
vinit View1
vaxo
box b 1 2 3
vdisplay b -dispMode 1
vcamera -ortho
vfit
vzoom 0.1
vinfgrid
vdump $imagedir/${casename}_0.png
vinfgrid -vertical -drawAxis 0 -color 0 0 1 -origin 1 1 1 -inf 1 -lineThickness 0.05
vdump $imagedir/${casename}_1.png

View File

@@ -1,23 +0,0 @@
puts "=================================="
puts "Grid in perspective projection"
puts "=================================="
pload MODELING VISUALIZATION
vclear
vinit View1
vaxo
box b 1 2 3
vdisplay b -dispMode 1
vcamera -persp
vfit
vzoom 0.1
vinfgrid
vdump $imagedir/${casename}_0.png
vinfgrid -vertical -drawAxis 0 -color 0 0 1 -origin 1 1 1 -inf 1 -lineThickness 0.05
vdump $imagedir/${casename}_1.png