Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alta
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alta
alta
Commits
7f0c908a
Commit
7f0c908a
authored
Feb 18, 2013
by
Laurent Belcour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a tool to convert a .function into a gnuplot file
parent
98488744
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
101 additions
and
8 deletions
+101
-8
sources/core/plugins_manager.cpp
sources/core/plugins_manager.cpp
+6
-4
sources/softs/brdf2gnuplot/brdf2gnuplot.pro
sources/softs/brdf2gnuplot/brdf2gnuplot.pro
+7
-0
sources/softs/brdf2gnuplot/main.cpp
sources/softs/brdf2gnuplot/main.cpp
+84
-0
sources/softs/generate_data/generate_data.pro
sources/softs/generate_data/generate_data.pro
+0
-0
sources/softs/generate_data/main.cpp
sources/softs/generate_data/main.cpp
+0
-0
sources/softs/plugin_loader/main.cpp
sources/softs/plugin_loader/main.cpp
+0
-0
sources/softs/plugin_loader/plugin_loader.pro
sources/softs/plugin_loader/plugin_loader.pro
+0
-0
sources/softs/rational_1d/main.cpp
sources/softs/rational_1d/main.cpp
+0
-0
sources/softs/rational_1d/rational_1d.pro
sources/softs/rational_1d/rational_1d.pro
+0
-0
sources/softs/softs.pro
sources/softs/softs.pro
+1
-1
sources/sources.pro
sources/sources.pro
+3
-3
No files found.
sources/core/plugins_manager.cpp
View file @
7f0c908a
#include "plugins_manager.h"
#include "rational_function.h"
#include "vertical_segment.h"
#include <QCoreApplication>
#include <QPluginLoader>
...
...
@@ -83,7 +85,7 @@ function* plugins_manager::get_function() const
{
if
(
_functions
.
empty
())
{
return
NULL
;
return
new
rational_function
()
;
}
else
{
...
...
@@ -94,7 +96,7 @@ data* plugins_manager::get_data() const
{
if
(
_datas
.
empty
())
{
return
NULL
;
return
new
vertical_segment
()
;
}
else
{
...
...
@@ -121,7 +123,7 @@ function* plugins_manager::get_function(const std::string& n) const
{
if
(
_functions
.
count
(
n
)
==
0
)
{
return
NULL
;
return
new
rational_function
()
;
}
else
{
...
...
@@ -132,7 +134,7 @@ data* plugins_manager::get_data(const std::string& n) const
{
if
(
_datas
.
count
(
n
)
==
0
)
{
return
NULL
;
return
new
vertical_segment
()
;
}
else
{
...
...
sources/softs/brdf2gnuplot/brdf2gnuplot.pro
0 → 100644
View file @
7f0c908a
CONFIG
+=
qt
INCLUDEPATH
+=
..
/../
DESTDIR
=
..
/../
build
SOURCES
+=
main
.
cpp
LIBS
+=
-
L
..
/../
build
-
lcore
sources/softs/brdf2gnuplot/main.cpp
0 → 100644
View file @
7f0c908a
#include <core/args.h>
#include <core/data.h>
#include <core/function.h>
#include <core/fitter.h>
#include <core/plugins_manager.h>
#include <QApplication>
#include <iostream>
#include <vector>
#include <iostream>
#include <fstream>
#include <limits>
#include <cstdlib>
int
main
(
int
argc
,
char
**
argv
)
{
QApplication
app
(
argc
,
argv
,
false
);
arguments
args
(
argc
,
argv
)
;
plugins_manager
manager
(
args
)
;
if
(
args
.
is_defined
(
"help"
))
{
std
::
cout
<<
"<<HELP>> brdf2gnuplot --input brdf.file --output gnuplot.file --func function.lib --data data.file"
<<
std
::
endl
;
std
::
cout
<<
" - input, output and data are mandatory parameters"
<<
std
::
endl
;
}
if
(
!
args
.
is_defined
(
"input"
))
{
std
::
cerr
<<
"<<ERROR>> the input filename is not defined"
<<
std
::
endl
;
return
1
;
}
if
(
!
args
.
is_defined
(
"output"
))
{
std
::
cerr
<<
"<<ERROR>> the output filename is not defined"
<<
std
::
endl
;
return
1
;
}
function
*
f
=
NULL
;
if
(
args
.
is_defined
(
"func"
))
{
std
::
cout
<<
"<<INFO>> Using plugin function
\"
"
<<
args
[
"func"
]
<<
"
\"
"
<<
std
::
endl
;
f
=
manager
.
get_function
(
args
[
"func"
])
;
}
else
{
f
=
manager
.
get_function
()
;
}
data
*
d
=
NULL
;
if
(
args
.
is_defined
(
"data"
))
{
std
::
cout
<<
"<<INFO>> Using data
\"
"
<<
args
[
"data"
]
<<
"
\"
"
<<
std
::
endl
;
d
=
manager
.
get_data
()
;
d
->
load
(
args
[
"data"
])
;
}
// Load the BRDF
f
->
load
(
args
[
"input"
]);
// Create output file
std
::
ofstream
file
(
args
[
"output"
].
c_str
(),
std
::
ios_base
::
trunc
);
if
(
d
!=
NULL
)
{
for
(
int
i
=
0
;
i
<
d
->
size
();
++
i
)
{
vec
v
=
d
->
get
(
i
)
;
vec
y2
=
f
->
value
(
v
)
;
for
(
int
u
=
0
;
u
<
d
->
dimX
();
++
u
)
file
<<
v
[
u
]
<<
"
\t
"
;
for
(
int
u
=
0
;
u
<
d
->
dimY
();
++
u
)
file
<<
y2
[
u
]
<<
"
\t
"
;
file
<<
std
::
endl
;
}
}
else
{
std
::
cerr
<<
"<<ERROR>> --data is not defined"
<<
std
::
endl
;
}
return
0
;
}
sources/
tes
ts/generate_data/generate_data.pro
→
sources/
sof
ts/generate_data/generate_data.pro
View file @
7f0c908a
File moved
sources/
tes
ts/generate_data/main.cpp
→
sources/
sof
ts/generate_data/main.cpp
View file @
7f0c908a
File moved
sources/
tes
ts/plugin_loader/main.cpp
→
sources/
sof
ts/plugin_loader/main.cpp
View file @
7f0c908a
File moved
sources/
tes
ts/plugin_loader/plugin_loader.pro
→
sources/
sof
ts/plugin_loader/plugin_loader.pro
View file @
7f0c908a
File moved
sources/
tes
ts/rational_1d/main.cpp
→
sources/
sof
ts/rational_1d/main.cpp
View file @
7f0c908a
File moved
sources/
tes
ts/rational_1d/rational_1d.pro
→
sources/
sof
ts/rational_1d/rational_1d.pro
View file @
7f0c908a
File moved
sources/
tests/tes
ts.pro
→
sources/
softs/sof
ts.pro
View file @
7f0c908a
TEMPLATE
=
subdirs
SUBDIRS
=
generate_data
\
plugin_loader
\
#
rational_1d
brdf2gnuplot
sources/sources.pro
View file @
7f0c908a
TEMPLATE
=
subdirs
SUBDIRS
=
core
\
plugins
\
tes
ts
sof
ts
plugins
.
depends
=
core
tes
ts
.
depends
=
core
tes
ts
.
depends
=
plugins
sof
ts
.
depends
=
core
sof
ts
.
depends
=
plugins
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment