"Fossies" - the Fresh Open Source Software Archive

Member "mathmod-branches-r508-trunk/ui_modules/drawingoptions.h" (8 Mar 2021, 14859 Bytes) of package /linux/misc/mathmod-11.0-source.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "drawingoptions.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 10.1_vs_11.0.

    1 /***************************************************************************
    2  *   Copyright (C) 2021 by Abderrahman Taha                                *
    3  *                                                                         *
    4  *                                                                         *
    5  *   This program is free software; you can redistribute it and/or modify  *
    6  *   it under the terms of the GNU General Public License as published by  *
    7  *   the Free Software Foundation; either version 2 of the License, or     *
    8  *   (at your option) any later version.                                   *
    9  *                                                                         *
   10  *   This program is distributed in the hope that it will be useful,       *
   11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
   12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
   13  *   GNU General Public License for more details.                          *
   14  *                                                                         *
   15  *   You should have received a copy of the GNU General Public License     *
   16  *   along with this program; if not, write to the                         *
   17  *   Free Software Foundation, Inc.,                                       *
   18  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
   19  ***************************************************************************/
   20 
   21 #ifndef DRAWINGOPTIONS_H
   22 #define DRAWINGOPTIONS_H
   23 
   24 #include "../screenshot/video.h"
   25 #include "about.h"
   26 #include "addparam.h"
   27 #include "colorsoptions.h"
   28 #include "editor.h"
   29 #include "mathmod.h"
   30 #include "parametersoptions.h"
   31 #include "selectoptions.h"
   32 #include "sliderparam.h"
   33 #include "ui_drawingoptions.h"
   34 #include <QMainWindow>
   35 
   36 enum OptionnalParScriptFIELD { PAR_VECT, PAR_GRID, PAR_CND, PAR_CONST, PAR_FUNCT };
   37 
   38 enum OptionnalIsoScriptFIELD { ISO_VECT, ISO_GRID, ISO_CND, ISO_CONST, ISO_FUNCT };
   39 
   40 enum MandatoryIsoField
   41 {
   42     ISO_FXYZ,
   43     ISO_XMIN,
   44     ISO_XMAX,
   45     ISO_YMIN,
   46     ISO_YMAX,
   47     ISO_ZMIN,
   48     ISO_ZMAX,
   49     ISO_COMP,
   50     ISO_NAME
   51 };
   52 
   53 enum MandatoryParField
   54 {
   55     PAR_FX,
   56     PAR_FY,
   57     PAR_FZ,
   58     PAR_FW,
   59     PAR_UMIN,
   60     PAR_UMAX,
   61     PAR_VMIN,
   62     PAR_VMAX,
   63     PAR_COMP,
   64     PAR_NAME
   65 };
   66 
   67 struct SliderStruct
   68 {
   69     QScrollBar *SliderScrollBar;
   70     QLabel *SliderLabel;
   71     QLabel *SliderLabelMin;
   72     QLabel *SliderLabelMax;
   73     QGroupBox *SliderGroupeBox;
   74 };
   75 
   76 class DrawingOptions : public QMainWindow
   77 {
   78     Q_OBJECT
   79 
   80 public:
   81     DrawingOptions(QWidget *parent = nullptr);
   82     ~DrawingOptions();
   83     MathMod *MathmodRef;
   84     About ab;
   85     std::vector<QString> MandatoryParmetric3DFields={"Fx", "Fy","Fz", "Umin", "Umax", "Vmin", "Vmax", "Component", "Name"};
   86     std::vector<QString> MandatoryParmetric4DFields={"Fx", "Fy","Fz", "Fw", "Umin", "Umax", "Vmin", "Vmax", "Component", "Name"};
   87     std::vector<QString> MandatoryIsosurfaceFields={"Fxyz", "Xmin", "Xmax", "Ymin", "Ymax", "Zmin", "Zmax", "Component", "Name"};
   88     std::vector<QString> OptionalFields={"Grid", "Cnd","Const", "Funct", "Vect"};
   89     SlidersForm sliderconf;
   90     AddParamForm addnewparam;
   91     QTreeWidgetItem *IsolistItemRef;
   92     Parametersoptions *Parameters;
   93     SelectOptions select;
   94     Ui::DrawingOptions ui;
   95     QJsonObject JSONMathModels;
   96     SliderStruct *SliderArray;
   97     ScriptErrorType scriptErrorType;
   98     int evalErrorType;
   99     std::vector<OptionnalIsoScriptFIELD> OptIsoFields;
  100     std::vector<OptionnalParScriptFIELD> OptParFields;
  101     std::vector<MandatoryIsoField> MandIsoFields;
  102     std::vector<MandatoryParField> MandParFields;
  103     bool ShowCurrentObjectTree = false;
  104 public slots:
  105     void removeat(int, QJsonObject&, QString);
  106     void removeat2(int, QJsonObject&, QString);
  107     void appendall(QJsonObject&, QString, QTableWidget*);
  108     void replaceat(int, QJsonObject&, QString, QTextEdit*);
  109     void insertat(int, QJsonObject&, QString, QTextEdit*);
  110     void appednew(QJsonObject&, QString, QTextEdit*);
  111     void AddListModels(bool b = false);
  112     void Run_JsonObject_activeted();
  113     void CIndextoolButton_clicked(int);
  114     void BuildAllVect();
  115     void ShowErrorMessage(QJsonParseError &, QString &);
  116     void OptionalIsoScriptFieldprocess(const QJsonObject &,
  117                                        OptionnalIsoScriptFIELD);
  118     void OptionalParScriptFieldprocess(const QJsonObject &,
  119                                        OptionnalParScriptFIELD);
  120     void MandatoryIsoFieldprocess(const QJsonObject &, const MandatoryIsoField &);
  121     void MandatoryParFieldprocess(const QJsonObject &, const MandatoryParField &,
  122                                   const ModelType &mod = PAR_TYPE);
  123     void LoadMandatoryAndOptionnalFields(const QJsonObject &, const ModelType &,
  124                                          bool, const QJsonObject &, bool,
  125                                          const QJsonObject &);
  126     void LoadTexture(const QJsonObject &, const ModelType &);
  127     void LoadPigment(const QJsonObject &, const ModelType &);
  128     void updateCurrentTreestruct();
  129     void ErrorMsg() const;
  130     void MemoryErrorMsg(int) const;
  131     void SaveSlidersRef(int n = 20);
  132     void editorwin();
  133     void videoplay();
  134     void colorsoptions();
  135     void on_xyzg_valueChanged(int);
  136     void on_ChangeGrid_clicked();
  137     int on_choice_activated(const QString &);
  138     void LoadK3DSurfScript(QString, int);
  139     void slot_comboBox18_3_activated(const QString &);
  140     void slot_checkBox_clicked();
  141     void on_pushButton_clicked();
  142     void on_action_Exit_triggered();
  143     void on_actionTriangles_triggered();
  144     void on_actionInfos_triggered();
  145     void on_actionFill_triggered();
  146     void on_ObjectClasse_clicked(const QModelIndex &);
  147     void UpdateScriptEditorAndTreeObject();
  148     void UpdatePar3DModelDetailsPage(TreeStruct &);
  149     void UpdatePar4DModelDetailsPage(TreeStruct &);
  150     void UpdateIsoModelDetailsPage(TreeStruct &);
  151     void UpdateTreeObject();
  152     void on_updateButton_clicked();
  153     void on_updateJObject(QJsonObject &);
  154     void RunUpdatedJObject(QJsonObject &);
  155     void slot_pushButton_2_clicked();
  156     void slot_unselect_clicked();
  157     void slot_XYZscrollBar_valueChanged(int);
  158     void UpdateDescription(int, ModelType, TreeStruct &);
  159     void oncolor_2activated(int index);
  160     void onred_2valueChanged(int);
  161     void ongreen_2valueChanged(int);
  162     void onblue_2valueChanged(int);
  163     void on_updateParam_clicked();
  164     void on_actionPolygonWavefront_obj_triggered();
  165     void on_actionColorPolygonWavefront_obj_triggered();
  166     void on_linecolumn_2_valueChanged(int);
  167     int JSON_choice_activated(const QString &);
  168     void ShowJsonModel(const QJsonObject &, int textureIndex = -1);
  169     void DrawJsonModel(const QJsonObject &, int textureIndex = -1,
  170                        bool Inspect = true);
  171     bool VerifiedJsonModel(const QJsonObject &, bool Inspect = true);
  172     bool VerifiedIsoJsonModel(const QJsonObject &);
  173     bool VerifyParEmptySpace(const QJsonObject &);
  174     bool VerifyIsoEmptySpace(const QJsonObject &);
  175     bool VerifyParFieldEmptySpace(const QJsonObject &, const MandatoryParField &);
  176     QString MandatoryParFieldToQString(const MandatoryParField &);
  177     bool VerifyIsoFieldEmptySpace(const QJsonObject &, const MandatoryIsoField &);
  178     QString MandatoryIsoFieldToQString(const MandatoryIsoField &);
  179     bool VerifiedParJsonModel(const QJsonObject &);
  180     void AddObjectToMySelectionTree();
  181     void AddIsoObjectToTree(QTreeWidgetItem *, TreeStruct &);
  182     void AddParObjectToTree(QTreeWidgetItem *, TreeStruct &);
  183     void ObjArrayToString(QJsonArray &, QString &);
  184     void AddParametersToTree(QTreeWidgetItem *, TreeStruct &);
  185     void on_IsoComponent_activated(int);
  186     void on_ParamComponent_activated(int);
  187     void on_xycheckBox_clicked();
  188     void on_xyhorizontalScrollBar_valueChanged(int);
  189     void on_xzcheckBox_clicked();
  190     void on_xzhorizontalScrollBar_valueChanged(int);
  191     void on_yzcheckBox_clicked();
  192     void on_yzhorizontalScrollBar_valueChanged(int);
  193     void on_xwcheckBox_clicked();
  194     void on_xwhorizontalScrollBar_valueChanged(int);
  195     void on_ywcheckBox_clicked();
  196     void on_ywhorizontalScrollBar_valueChanged(int);
  197     void on_zwcheckBox_clicked();
  198     void on_zwhorizontalScrollBar_valueChanged(int);
  199     void on_linecolumn_3_valueChanged(int);
  200     void oncolor_4activated(int);
  201     void on_uv4D_clicked();
  202     void on_uv_clicked();
  203     void on_InitMatrix_clicked();
  204     void on_ActivateCND_clicked(bool);
  205     void on_TBordercheckBox_clicked(bool);
  206     void on_TCNDcheckBox_clicked(bool);
  207     void on_FCNDcheckBox_clicked(bool);
  208     void on_TNCNDcheckBox_clicked(bool);
  209     void on_FNCNDcheckBox_clicked(bool);
  210     void on_actionMesh_triggered();
  211     void on_calculate_clicked();
  212     void on_actionAbout_2_triggered();
  213     void LoadNewFileModels(bool upd = false);
  214     void on_actionLoad_json_script_triggered();
  215     void on_red_ParIso_valueChanged(int);
  216     void on_green_ParIso_valueChanged(int);
  217     void on_blue_ParIso_valueChanged(int);
  218     void Multiplier(int, int, int, QJsonObject &, int index = 0);
  219     void UpdateGui(int);
  220     void UpdateGuiMaxgrid();
  221     void ShowSliders(const QJsonObject &);
  222     void on_actionScreenshot_triggered();
  223     void on_actionEditor_triggered();
  224     void on_actionColors_triggered();
  225     void update_slider_param();
  226     void add_new_param();
  227     void update_infos_param(int);
  228     void SearchListModels();
  229     void ParseItemTree(QTreeWidgetItem *, QList<bool> &, bool view = false);
  230     QTreeWidgetItem *ChildItemTreeProperty(QTreeWidgetItem *item,
  231                                            QString proprty);
  232 private slots:
  233     void on_Infos_clicked();
  234     void on_Mesh_clicked();
  235     void on_Norm_clicked();
  236     void on_Fill_clicked();
  237     void on_Trian_clicked();
  238     void on_actionOpenGL_triggered();
  239     void on_cut_clicked();
  240     void on_actionConvert_K3DS_script_triggered();
  241     void on_actionConfiguration_triggered();
  242     void on_actionColors_2_triggered();
  243     void on_Load_clicked();
  244     void on_ParamComponent_2_activated(int);
  245     void on_updateParam_2_clicked();
  246     void on_Multiplier_clicked();
  247     void on_TimeStepScrollBar_valueChanged(int);
  248     void on_InitTButton_clicked();
  249     void on_pushButton_2_clicked();
  250     void on_xyhorizontalScrollBar2_valueChanged(int);
  251     void on_xzhorizontalScrollBar2_valueChanged(int);
  252     void on_yzhorizontalScrollBar2_valueChanged(int);
  253     void on_xycheckBox2_clicked();
  254     void on_xzcheckBox2_clicked();
  255     void on_yzcheckBox2_clicked();
  256     void on_InitMatrix_2_clicked();
  257     void on_xyzcheckBox2_clicked();
  258     void on_pushButton_3_clicked();
  259     void on_cut_2_clicked();
  260     void on_pushButton_4_clicked();
  261     void on_color_5_activated(int);
  262     void on_transparent_ParIso_valueChanged(int);
  263     void on_comboBoxTexture_activated(int);
  264     void on_comboBoxPigment_activated(int);
  265     void on_actionTrianglesWavefront_obj_triggered();
  266     void on_actionColorTrianglesWavefront_obj_triggered();
  267     void on_ShowtextureScript_clicked();
  268     void on_pushButton_5_clicked();
  269     void on_C1ScrollBar_valueChanged(int);
  270     void on_C2ScrollBar_valueChanged(int);
  271     void on_C3ScrollBar_valueChanged(int);
  272     void on_C4ScrollBar_valueChanged(int);
  273     void on_C5ScrollBar_valueChanged(int);
  274     void on_PredefinedSets_activated(int);
  275     void on_C6ScrollBar_valueChanged(int);
  276     void on_C7ScrollBar_valueChanged(int);
  277     void on_C8ScrollBar_valueChanged(int);
  278     void on_C9ScrollBar_valueChanged(int);
  279     void on_C10ScrollBar_valueChanged(int);
  280     void on_C11ScrollBar_valueChanged(int);
  281     void on_C12ScrollBar_valueChanged(int);
  282     void on_C13ScrollBar_valueChanged(int);
  283     void on_C14ScrollBar_valueChanged(int);
  284     void on_C15ScrollBar_valueChanged(int);
  285     void on_C16ScrollBar_valueChanged(int);
  286     void on_C17ScrollBar_valueChanged(int);
  287     void on_C18ScrollBar_valueChanged(int);
  288     void on_C19ScrollBar_valueChanged(int);
  289     void on_C20ScrollBar_valueChanged(int);
  290     void CScrollBar_valueChanged(int, int);
  291     void on_C20toolButton_clicked();
  292     void on_C19toolButton_clicked();
  293     void on_C18toolButton_clicked();
  294     void on_C17toolButton_clicked();
  295     void on_C16toolButton_clicked();
  296     void on_C15toolButton_clicked();
  297     void on_C14toolButton_clicked();
  298     void on_C13toolButton_clicked();
  299     void on_C12toolButton_clicked();
  300     void on_C11toolButton_clicked();
  301     void on_C10toolButton_clicked();
  302     void on_C9toolButton_clicked();
  303     void on_C8toolButton_clicked();
  304     void on_C7toolButton_clicked();
  305     void on_C6toolButton_clicked();
  306     void on_C5toolButton_clicked();
  307     void on_C4toolButton_clicked();
  308     void on_C3toolButton_clicked();
  309     void on_C2toolButton_clicked();
  310     void on_C1toolButton_clicked();
  311     void on_AddSetButton_clicked();
  312     void on_CutSetButton_clicked();
  313     void HideSliders();
  314     void on_AddParam_clicked();
  315     void on_CutParam_clicked();
  316     void on_actionFrames_triggered();
  317     void on_red_Specular_valueChanged(int);
  318     void SetSpecularValues(int *);
  319     void SetAmbientValues(int *);
  320     void SetDiffuseValues(int *);
  321     void SetShininessValue(int);
  322     void SetThreadValues(int *);
  323     void on_green_Specular_valueChanged(int);
  324     void on_blue_Specular_valueChanged(int);
  325     void on_transparent_Specular_valueChanged(int);
  326     void on_ShininessScrollBar_valueChanged(int);
  327     void on_ThreadNumberScrollBar_valueChanged(int);
  328     void on_StopCalculationsButton_clicked();
  329     void on_stopButton_clicked();
  330     void on_lineScrollBar_valueChanged(int);
  331     void on_coloneScrollBar_valueChanged(int);
  332     void on_actionScripts_selection_triggered();
  333     void on_actionBoundingBox_clicked();
  334     void on_actionAnimation_Rotation_triggered();
  335     void on_actionMorph_use_t_parameter_triggered();
  336     void on_TreeViewButton_clicked();
  337     void ApplypushButton_clicked();
  338     void on_ObjectClasseCurrent_clicked(const QModelIndex &index);
  339     void on_parisocomboBox_currentIndexChanged(int index);
  340     void on_ApplypushButton_clicked();
  341     void on_ApplypushButton_2_clicked();
  342     void on_ApplypushButton_3_clicked();
  343     void updateParametricGridSliders(int);
  344     void on_actionDocumentation_triggered();
  345     void on_ScaleButton_clicked();
  346     void on_ShowIsoComp_clicked();
  347     void updateShowIsoCmp(int);
  348     void updateShowParComp(int);
  349     void on_ShowParComp_clicked();
  350     void on_actionAxe_triggered();
  351     void on_actionPlan_triggered();
  352     void on_actionDetach_WinInfos_triggered();
  353     void on_red_Ambient_valueChanged(int value);
  354     void on_green_Ambient_valueChanged(int value);
  355     void on_blue_Ambient_valueChanged(int value);
  356     void on_transparent_Ambient_valueChanged(int value);
  357     void on_red_Diffuse_valueChanged(int value);
  358     void on_green_Diffuse_valueChanged(int value);
  359     void on_blue_Diffuse_valueChanged(int value);
  360     void on_transparent_Diffuse_valueChanged(int value);
  361 };
  362 #endif