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
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
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
Hurstel
CGoGN
Commits
9e054a2d
Commit
9e054a2d
authored
Jul 16, 2014
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using doubles
parent
f5529246
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
13 deletions
+55
-13
Apps/SandBox/wallPaper.cpp
Apps/SandBox/wallPaper.cpp
+1
-1
Apps/SandBox/wallPaper.h
Apps/SandBox/wallPaper.h
+5
-1
include/Container/convert.h
include/Container/convert.h
+4
-4
include/Utils/Qt/qtQGLV.h
include/Utils/Qt/qtQGLV.h
+25
-2
include/Utils/Qt/qtSimple.h
include/Utils/Qt/qtSimple.h
+19
-2
src/Utils/vbo.cpp
src/Utils/vbo.cpp
+1
-3
No files found.
Apps/SandBox/wallPaper.cpp
View file @
9e054a2d
...
...
@@ -43,7 +43,7 @@ void MyQT::cb_initGL()
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
();
// create VBO for position
m_positionVBO
=
new
Utils
::
VBO
();
m_positionVBO
=
new
Utils
::
VBO
(
&
converterDF
);
m_positionVBO
->
updateData
(
position
);
m_shader
=
new
Utils
::
ShaderSimpleColor
();
...
...
Apps/SandBox/wallPaper.h
View file @
9e054a2d
...
...
@@ -46,7 +46,7 @@
using
namespace
CGoGN
;
struct
PFP
:
public
PFP_
STANDARD
struct
PFP
:
public
PFP_
DOUBLE
{
// definition of the map
typedef
EmbeddedMap2
MAP
;
...
...
@@ -67,7 +67,11 @@ public:
VertexAttribute
<
VEC3
,
MAP
>
position
;
Algo
::
Render
::
GL2
::
MapRender
*
m_render
;
// converter for automatic conversion when updating VBOs
ConvertVec3dToVec3f
converterDF
;
Utils
::
VBO
*
m_positionVBO
;
Utils
::
ShaderSimpleColor
*
m_shader
;
// FOR WALL PAPER
...
...
include/Container/convert.h
View file @
9e054a2d
...
...
@@ -319,7 +319,8 @@ protected:
public:
ConvertVec3dToVec3f
()
:
ConvertBuffer
(
sizeof
(
Geom
::
Vec3d
))
ConvertBuffer
(
sizeof
(
Geom
::
Vec3d
)),
m_typedBuffer
(
NULL
)
{}
~
ConvertVec3dToVec3f
()
...
...
@@ -349,15 +350,14 @@ public:
{
// cast ptr in & out with right type
const
Geom
::
Vec3d
*
typedIn
=
reinterpret_cast
<
const
Geom
::
Vec3d
*>
(
ptrIn
);
Geom
::
Vec3f
*
typedOut
=
reinterpret_cast
<
Geom
::
Vec3f
*>
(
m_buffer
)
;
Geom
::
Vec3f
*
typedOut
=
m_typedBuffer
;
// compute conversion
for
(
unsigned
int
i
=
0
;
i
<
m_nb
;
++
i
)
{
const
Geom
::
Vec3d
&
vd
=
*
typedIn
++
;
*
typedOut
++
=
Geom
::
Vec3f
(
float
(
vd
[
0
]),
float
(
vd
[
1
]),
float
(
vd
[
2
]));
// Geom::Vec3f& vf = *typedOut++;
// vf[0]=vd[0];vf[1]=vd[1];vf[2]=vd[2];
}
}
unsigned
int
vectorSize
()
...
...
include/Utils/Qt/qtQGLV.h
View file @
9e054a2d
...
...
@@ -193,12 +193,35 @@ public:
/**
* set width and pos center of object to draw
*/
void
setParamObject
(
float
width
,
float
*
pos
)
{
m_qglWidget
->
setParamObject
(
width
,
pos
);
}
template
<
typename
T
>
inline
void
setParamObject
(
T
width
,
T
*
pos
)
{
float
posF
[
3
];
posF
[
0
]
=
float
(
pos
[
0
]);
posF
[
1
]
=
float
(
pos
[
1
]);
posF
[
2
]
=
float
(
pos
[
2
]);
m_qglWidget
->
setParamObject
(
float
(
width
),
posF
);
}
/**
* set BB min & max corner of object to draw
*/
void
setObjectBB
(
float
*
bbmin
,
float
*
bbmax
)
{
m_qglWidget
->
setObjectBB
(
bbmin
,
bbmax
);
}
inline
void
setObjectBB
(
float
*
bbmin
,
float
*
bbmax
)
{
m_qglWidget
->
setObjectBB
(
bbmin
,
bbmax
);
}
template
<
typename
T
>
void
setObjectBB
(
T
*
bbmin
,
T
*
bbmax
)
{
float
bbminF
[
3
];
bbminF
[
0
]
=
float
(
bbmin
[
0
]);
bbminF
[
1
]
=
float
(
bbmin
[
1
]);
bbminF
[
2
]
=
float
(
bbmin
[
2
]);
float
bbmaxF
[
3
];
bbmaxF
[
0
]
=
float
(
bbmax
[
0
]);
bbmaxF
[
1
]
=
float
(
bbmax
[
1
]);
bbmaxF
[
2
]
=
float
(
bbmax
[
2
]);
m_qglWidget
->
setObjectBB
(
bbminF
,
bbmaxF
);
}
/**
* @brief get pointer on QGLViewer widget for direct access
...
...
include/Utils/Qt/qtSimple.h
View file @
9e054a2d
...
...
@@ -195,9 +195,26 @@ public:
/**
* set width and pos center of object to draw
*/
void
setParamObject
(
float
width
,
float
*
pos
)
{
m_glWidget
->
setParamObject
(
width
,
pos
);
}
template
<
typename
T
>
inline
void
setParamObject
(
T
width
,
T
*
pos
)
{
float
posF
[
3
];
posF
[
0
]
=
float
(
pos
[
0
]);
posF
[
1
]
=
float
(
pos
[
1
]);
posF
[
2
]
=
float
(
pos
[
2
]);
m_glWidget
->
setParamObject
(
float
(
width
),
posF
);
}
template
<
typename
T
>
inline
void
resetCenterOfRotation
(
T
width
,
T
*
pos
)
{
float
posF
[
3
];
posF
[
0
]
=
float
(
pos
[
0
]);
posF
[
1
]
=
float
(
pos
[
1
]);
posF
[
2
]
=
float
(
pos
[
2
]);
m_glWidget
->
resetCenterOfRotation
(
float
(
width
),
posF
);
}
void
resetCenterOfRotation
(
float
width
,
float
*
pos
)
{
m_glWidget
->
resetCenterOfRotation
(
width
,
pos
);
}
/**
* make the contex of glWidget current
...
...
src/Utils/vbo.cpp
View file @
9e054a2d
...
...
@@ -131,8 +131,6 @@ void VBO::updateData_withConversion(const AttributeMultiVectorGen* attrib, Conve
m_name
=
attrib
->
getName
();
m_typeName
=
attrib
->
getTypeName
();
// m_data_size = attrib->getSizeOfType() / conv->sizeElt();
m_data_size
=
conv
->
vectorSize
();
// alloue la memoire pour le buffer et initialise le conv
...
...
@@ -142,7 +140,7 @@ void VBO::updateData_withConversion(const AttributeMultiVectorGen* attrib, Conve
unsigned
int
byteTableSize
;
unsigned
int
nbb
=
attrib
->
getBlocksPointers
(
addr
,
byteTableSize
);
m_nbElts
=
nbb
*
attrib
->
getBlockSize
()
*
m_data_size
;
// m_nbElts = nbb * attrib->getBlockSize()/
m_data_size;
// bind buffer to update
glBindBuffer
(
GL_ARRAY_BUFFER
,
*
m_id
);
...
...
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