Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
alta
alta
Commits
d9ce986b
Commit
d9ce986b
authored
Mar 10, 2016
by
Ludovic Courtès
Browse files
core: Move 'load_data_from_text' as a function in "data_storage.h".
parent
1eb25771
Changes
6
Hide whitespace changes
Inline
Side-by-side
sources/core/data.h
View file @
d9ce986b
/* ALTA --- Analysis of Bidirectional Reflectance Distribution Functions
Copyright (C) 2013, 2014, 2015 Inria
Copyright (C) 2013, 2014, 2015
, 2016
Inria
This file is part of ALTA.
...
...
@@ -87,6 +87,7 @@ class data : public parametrized
double
epsilon
=
std
::
pow
(
1.0
,
-
int
(
std
::
numeric_limits
<
double
>::
digits10
-
1
)));
friend
void
load_data_from_binary
(
std
::
istream
&
in
,
const
alta
::
arguments
&
header
,
alta
::
data
&
data
);
...
...
sources/core/data_storage.cpp
View file @
d9ce986b
/* ALTA --- Analysis of Bidirectional Reflectance Distribution Functions
Copyright (C) 2013, 2014, 2015 Inria
Copyright (C) 2013, 2014, 2015
, 2016
Inria
This file is part of ALTA.
...
...
@@ -23,11 +23,14 @@
//using namespace alta;
void
alta
::
vertical_segment
::
load_data_from_text
(
std
::
istream
&
input
,
const
arguments
&
header
,
alta
::
vertical_segment
&
result
,
const
arguments
&
args
)
void
alta
::
load_data_from_text
(
std
::
istream
&
input
,
const
alta
::
arguments
&
header
,
alta
::
vertical_segment
&
result
)
{
// FIXME: Eventually reinstate support for extra arguments when loading a
// file.
static
alta
::
arguments
args
;
vec
min
,
max
;
vec
ymin
,
ymax
;
...
...
sources/core/data_storage.h
View file @
d9ce986b
/* ALTA --- Analysis of Bidirectional Reflectance Distribution Functions
Copyright (C) 2013, 2014, 2015 Inria
Copyright (C) 2013, 2014, 2015
, 2016
Inria
This file is part of ALTA.
...
...
@@ -12,6 +12,7 @@
#include <iostream>
#include "data.h"
#include "vertical_segment.h"
#include "common.h"
#include "args.h"
...
...
@@ -23,6 +24,13 @@ namespace alta
// Write DATA to OUT in a compact binary format.
void
save_data_as_binary
(
std
::
ostream
&
out
,
const
alta
::
data
&
data
);
// Initialize DATA from the content of stream INPUT, which is in ALTA's
// native text format.
void
load_data_from_text
(
std
::
istream
&
input
,
const
alta
::
arguments
&
header
,
alta
::
vertical_segment
&
data
);
// Initialize DATA from the binary-formatted stream IN.
void
load_data_from_binary
(
std
::
istream
&
in
,
const
alta
::
arguments
&
header
,
alta
::
data
&
data
);
}
...
...
sources/core/vertical_segment.cpp
View file @
d9ce986b
/* ALTA --- Analysis of Bidirectional Reflectance Distribution Functions
Copyright (C) 2013, 2014, 2015 Inria
Copyright (C) 2013, 2014, 2015
, 2016
Inria
This file is part of ALTA.
...
...
@@ -91,7 +91,8 @@ void vertical_segment::load(const std::string& filename, const arguments& args)
load_data_from_binary
(
file
,
header
,
*
this
);
}
else
{
load_data_from_text
(
file
,
header
,
*
this
,
args
);
// FIXME: ARGS is currently ignored.
load_data_from_text
(
file
,
header
,
*
this
);
}
file
.
close
();
...
...
sources/core/vertical_segment.h
View file @
d9ce986b
...
...
@@ -129,6 +129,10 @@ class vertical_segment : public data
// Get data size
virtual
int
size
()
const
;
friend
void
load_data_from_text
(
std
::
istream
&
in
,
const
alta
::
arguments
&
header
,
alta
::
vertical_segment
&
data
);
private:
// method
protected:
// method
...
...
@@ -137,11 +141,6 @@ class vertical_segment : public data
// object. Note, the input and output dimension needs to be specified.
void
initializeToZero
(
unsigned
int
number_of_data_elements
);
static
void
load_data_from_text
(
std
::
istream
&
input
,
const
arguments
&
header
,
vertical_segment
&
result
,
const
arguments
&
args
);
//! \brief From a correct input configuration 'x' with size
//! dimX()+dimY(), generate a vertical ! segment satisfying this object's
//! parameters.
...
...
sources/plugins/data_interpolants/grid.cpp
View file @
d9ce986b
/* ALTA --- Analysis of Bidirectional Reflectance Distribution Functions
Copyright (C) 2013, 2014 Inria
Copyright (C) 2013, 2014
, 2016
Inria
This file is part of ALTA.
...
...
@@ -276,7 +276,8 @@ class BrdfGrid : public vertical_segment {
arguments
header
=
arguments
::
parse_header
(
file
);
initialize
(
header
,
false
);
load_data_from_text
(
file
,
header
,
*
this
,
args
);
// FIXME: ARGS is ignored.
load_data_from_text
(
file
,
header
,
*
this
);
}
void
save
(
const
std
::
string
&
filename
)
const
...
...
Ludovic Courtès
@lcourtes
mentioned in commit
8c90c23b
·
Feb 14, 2017
mentioned in commit
8c90c23b
mentioned in commit 8c90c23bd3a8ccb3c4165d23f44cc7830a2c1591
Toggle commit list
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