1 /**************************************************************************** 2 * MeshLab o o * 3 * A versatile mesh processing toolbox o o * 4 * _ O _ * 5 * Copyright(C) 2005 \/)\/ * 6 * Visual Computing Lab /\/| * 7 * ISTI - Italian National Research Council | * 8 * \ * 9 * All rights reserved. * 10 * * 11 * This program is free software; you can redistribute it and/or modify * 12 * it under the terms of the GNU General Public License as published by * 13 * the Free Software Foundation; either version 2 of the License, or * 14 * (at your option) any later version. * 15 * * 16 * This program is distributed in the hope that it will be useful, * 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 19 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * 20 * for more details. * 21 * * 22 ****************************************************************************/ 23 24 #ifndef __UTILS_WATERMARKPLUGIN_H 25 #define __UTILS_WATERMARKPLUGIN_H 26 27 #define RANGE_MARCHIO 1.0 // I valori della TabellaMarchio vanno da -RANGE_MARCHIO a +RANGE_MARCHIO (distribuiti UNIFORMEMENTE) 28 #define RAD_TO_DEG 57.295779513082320876798154814105 // Radianti*RAD_TO_DEG = Gradi 29 #define DEG_TO_RAD 0.017453292519943295769236907684886 // Gradi*DEG_TO_RAD = Radianti 30 #define PHIEXCLUSION_DEGREE 8.0 // Esclude dalla marchiature le coordinate polari con phi troppo vicine a 180.0 o a 0.0 31 32 #include "qstring.h" 33 #include "math.h" 34 #include <vector> 35 36 class utilsWatermark 37 { 38 public: utilsWatermark(void)39 utilsWatermark(void){} ~utilsWatermark(void)40 ~utilsWatermark(void){} 41 static unsigned int ComputeSeed(QString string_code); 42 static std::vector< std::vector<double> > CreateWatermarkTable(unsigned int seed); 43 static void sph2cartesian(double R, double theta, double phi, float &x, float &y, float &z); 44 static void cartesian2sph(double x, double y, double z, double &R, double &theta, double &phi); 45 static double round(double x); 46 static double thresholdRo(double muRhoH0, double varRhoH0, 47 double muRhoH1, double varRhoH1, 48 double Pf, double &Pm); 49 }; 50 51 #endif 52