Commit 9dd58fb2 authored by Jan Möbius's avatar Jan Möbius

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5080 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 58f53b30
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
Library()
glew()
glut()
openmesh()
contains( OPENFLIPPER , OpenFlipper ){
ftgl()
message(ACG Library is Building for OpenFlipper )
}
DIRECTORIES = . Geometry Config/ Geometry/Types GL Glut IO Math QtWidgets Scenegraph QtScenegraph ShaderUtils Utils
win32 {
DEFINES += _USE_MATH_DEFINES NOMINMAX INCLUDE_TEMPLATES
# CONFIG += static
DEFINES += ACGDLL
contains( OPENFLIPPER , OpenFlipper ){
DESTDIR = $${TOPDIR}/OpenFlipper/$${BUILDDIRECTORY}
}
}
macx {
QMAKE_LFLAGS_SONAME = -install_name$${LITERAL_WHITESPACE}$${TOPDIR}/ACG/lib/$${BUILDDIRECTORY}/
export( QMAKE_LFLAGS_SONAME )
}
# Input
HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
installs()
################################################################################
File added
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenMesh_Core", "..\..\OpenMesh\Core\OpenMesh_Core.vcproj", "{ED38FC0A-3C42-4D41-B234-B2912430DE52}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenMesh_Tools", "..\..\OpenMesh\Tools\OpenMesh_Tools.vcproj", "{682CF0FD-24AD-44AC-8438-A6BECD7ABE1C}"
ProjectSection(ProjectDependencies) = postProject
{ED38FC0A-3C42-4D41-B234-B2912430DE52} = {ED38FC0A-3C42-4D41-B234-B2912430DE52}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ACG_VC2005", "ACG_VC2005\ACG_VC2005.vcproj", "{C19056DB-9E3F-4D52-8D0E-0CEDD42B8DDC}"
ProjectSection(ProjectDependencies) = postProject
{682CF0FD-24AD-44AC-8438-A6BECD7ABE1C} = {682CF0FD-24AD-44AC-8438-A6BECD7ABE1C}
{ED38FC0A-3C42-4D41-B234-B2912430DE52} = {ED38FC0A-3C42-4D41-B234-B2912430DE52}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MVIEW", "MVIEW\MVIEW.vcproj", "{F3285AAB-E8C1-40B6-BC57-C0D46F18BBE1}"
ProjectSection(ProjectDependencies) = postProject
{ED38FC0A-3C42-4D41-B234-B2912430DE52} = {ED38FC0A-3C42-4D41-B234-B2912430DE52}
{C19056DB-9E3F-4D52-8D0E-0CEDD42B8DDC} = {C19056DB-9E3F-4D52-8D0E-0CEDD42B8DDC}
{682CF0FD-24AD-44AC-8438-A6BECD7ABE1C} = {682CF0FD-24AD-44AC-8438-A6BECD7ABE1C}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ED38FC0A-3C42-4D41-B234-B2912430DE52}.Debug|Win32.ActiveCfg = Debug|Win32
{ED38FC0A-3C42-4D41-B234-B2912430DE52}.Debug|Win32.Build.0 = Debug|Win32
{ED38FC0A-3C42-4D41-B234-B2912430DE52}.Release|Win32.ActiveCfg = Release|Win32
{ED38FC0A-3C42-4D41-B234-B2912430DE52}.Release|Win32.Build.0 = Release|Win32
{682CF0FD-24AD-44AC-8438-A6BECD7ABE1C}.Debug|Win32.ActiveCfg = Debug|Win32
{682CF0FD-24AD-44AC-8438-A6BECD7ABE1C}.Debug|Win32.Build.0 = Debug|Win32
{682CF0FD-24AD-44AC-8438-A6BECD7ABE1C}.Release|Win32.ActiveCfg = Release|Win32
{682CF0FD-24AD-44AC-8438-A6BECD7ABE1C}.Release|Win32.Build.0 = Release|Win32
{C19056DB-9E3F-4D52-8D0E-0CEDD42B8DDC}.Debug|Win32.ActiveCfg = Debug|Win32
{C19056DB-9E3F-4D52-8D0E-0CEDD42B8DDC}.Debug|Win32.Build.0 = Debug|Win32
{C19056DB-9E3F-4D52-8D0E-0CEDD42B8DDC}.Release|Win32.ActiveCfg = Release|Win32
{C19056DB-9E3F-4D52-8D0E-0CEDD42B8DDC}.Release|Win32.Build.0 = Release|Win32
{F3285AAB-E8C1-40B6-BC57-C0D46F18BBE1}.Debug|Win32.ActiveCfg = Debug|Win32
{F3285AAB-E8C1-40B6-BC57-C0D46F18BBE1}.Debug|Win32.Build.0 = Debug|Win32
{F3285AAB-E8C1-40B6-BC57-C0D46F18BBE1}.Release|Win32.ActiveCfg = Release|Win32
{F3285AAB-E8C1-40B6-BC57-C0D46F18BBE1}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
File added
This diff is collapsed.
========================================================================
STATIC LIBRARY : ACG_VC2008 Project Overview
========================================================================
AppWizard has created this ACG_VC2008 library project for you.
No source files were created as part of your project.
ACG_VC2008.vcproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Config
#==============================================================================
buildtargets: build createLinks
# subdirs to process
SUBDIRS := Math IO Utils ShaderUtils GL Glut Scenegraph QtWidgets MeshTools Geometry
PACKAGES := glew glut opengl qt openmesh2
PROJ_LIBS := OpenMesh/Core
MODULES := cxxlib
createLinks:
directory := $(ARCH)_$(COMP)$(COMP_VERSION)_$(CODE_LEVEL)
targetlink-exists := $(shell test -d "./lib/$(directory)" && echo targetlink-found)
ifneq ($(targetlink-exists), targetlink-found)
$(shell mkdir ./lib/$(directory) )
$(shell ln -s ../../$(directory)/libACG.so ./lib/$(directory)/ )
endif
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Rules
#==============================================================================
# CXX_CFLAGS += -DACG_HIDE_DEPRECATED
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Config
#==============================================================================
#ifneq ($(OS),IRIX64)
#SUBDIRS = $(call find-subdirs)
#else
SUBDIRS = mview
#endif
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Rules
#==============================================================================
#ifndef ACGDLLEXPORT
#ifdef WIN32
#ifdef ACGDLL
#ifdef USEACG
#define ACGDLLEXPORT __declspec(dllimport)
#define ACGDLLEXPORTONLY
#else
#define ACGDLLEXPORT __declspec(dllexport)
#define ACGDLLEXPORTONLY __declspec(dllexport)
#endif
#else
#define ACGDLLEXPORT
#define ACGDLLEXPORTONLY
#endif
#else
#define ACGDLLEXPORT
#define ACGDLLEXPORTONLY
#endif
#endif
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Config
#==============================================================================
MODULES := doxygen
DOXY_PROJECT_NAME = ACG
DOXY_FILE_PATTERNS = *.cc *.hh *.docu
DOXY_EXCLUDE_DIRS = $(proj-dir)/Templates $(proj-dir)/Apps
DOXY_EXCLUDE_PATTERNS = CVS $(build-dir) *.moc.cc
DOXY_EXAMPLE_PATH =
DOXY_EXAMPLE_PATTERNS = *.cc *.hh
DOXY_GENERATE_HTML = YES
DOXY_GENERATE_LATEX = NO
DOXY_GENERATE_RTF = NO
DOXY_GENERATE_MAN = NO
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Rules
#==============================================================================
/**
\mainpage ACG Main Page
\li \ref naming_conventions
\li \ref compiling_ACG
*/
//-----------------------------------------------------------------------------
/** \page naming_conventions Naming Conventions
Please follow the naming conventions, if you extend the %ACG-code !
<b>Files:</b>
\li \c MyClass.cc for C++-Implementation of class \c MyClass
\li \c MyClass.hh for C++-Header of class \c MyClass
<b>Classes:</b>
\li Class names start with a capital letter: \c MyClass
\li Class templates end with \c T: \c MyClassTemplateT
<b>Variables:</b>
\li One leading underscore for parameters in function-calls: \c _var
\li One trailing underscore for member-variables: \c var_
\li Two trailing underscores for static member-variables: \c var__
<b>Functions:</b>
\li Words are speparated by underscores: \c my_function()
<b>Accessing members:</b>
\li To get the member \c xxx_ use <tt> const& xxx() const </tt>
\li To set the member \c xxx_ use <tt> void set_xxx(arg) </tt>
**/
//-----------------------------------------------------------------------------
/** \page compiling_ACG Compiling ACG
Just use our tool \c acgmake.
**/
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//=============================================================================
//
// Documents all used namespaces for doxygen
//
//=============================================================================
/** \namespace ACG::QtWidgets
This namespace holds the Qt based GUI elements.
**/
/** \namespace ACG::SceneGraph
This namespace holds the ACG scene graph, all its nodes and helpers.
**/
/** \namespace ACG::Geometry
This namespace holds some geometric types as well as geometry algorithms.
**/
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Config
#==============================================================================
SUBDIRS = $(call find-subdirs)
PACKAGES := glew opengl glut OpenMesh2
PROJ_LIBS :=
MODULES := cxxlib
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Rules
#==============================================================================
//=============================================================================
//
// OpenFlipper
// Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
// www.openflipper.org
//
//-----------------------------------------------------------------------------
//
// License
//
// OpenFlipper is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>.
//
//-----------------------------------------------------------------------------
//
// $Revision$
// $Author$
// $Date$
//
//=============================================================================
//=============================================================================
//
// CLASS ColorTranslator - IMPLEMENTATION
//
//=============================================================================
//== INCLUDES =================================================================
#include "ColorTranslator.hh"
#include <iostream>
//== NAMESPACES ===============================================================
namespace ACG {
namespace SceneGraph {
//== IMPLEMENTATION ==========================================================
void
ColorTranslator::
initialize()
{
glGetIntegerv( GL_RED_BITS, &red_bits_ );
glGetIntegerv( GL_GREEN_BITS, &green_bits_ );
glGetIntegerv( GL_BLUE_BITS, &blue_bits_ );
if (red_bits_ > 8) red_bits_ = 8;
if (green_bits_ > 8) green_bits_ = 8;
if (blue_bits_ > 8) blue_bits_ = 8;
red_mask_ = ((1 << red_bits_) - 1);
green_mask_ = ((1 << green_bits_) - 1);
blue_mask_ = ((1 << blue_bits_) - 1);
red_shift_ = 8 - red_bits_;
green_shift_ = 8 - green_bits_;
blue_shift_ = 8 - blue_bits_;
red_round_ = 1 << (red_shift_ - 1);
green_round_ = 1 << (green_shift_ - 1);
blue_round_ = 1 << (blue_shift_ - 1);
initialized_ = true;
}
//-----------------------------------------------------------------------------
Vec3uc
ColorTranslator::
index2color(unsigned int _idx) const
{
assert(initialized());
unsigned char r, g, b;
unsigned int idx(_idx+1);
b = ((idx & blue_mask_) << blue_shift_) | blue_round_;
idx >>= blue_bits_;
g = ((idx & green_mask_) << green_shift_) | green_round_;
idx >>= green_bits_;
r = ((idx & red_mask_) << red_shift_) | red_round_;
idx >>= red_bits_;
if (!idx)
return Vec3uc(r, g, b);
else
{
std::cerr << "Can't convert index " << _idx << " to RGB\n";
return Vec3uc(0, 0, 0);
}
}
//-----------------------------------------------------------------------------
int
ColorTranslator::
color2index(Vec3uc _rgb) const
{
assert(initialized());
unsigned int result;
result = _rgb[0] >> red_shift_;
result <<= green_bits_;
result |= _rgb[1] >> green_shift_;
result <<= blue_bits_;
result |= _rgb[2] >> blue_shift_;
return (result-1);
}
//-----------------------------------------------------------------------------
unsigned int
ColorTranslator::max_index() const
{
assert(initialized());
return (1 << (red_bits_+green_bits_+blue_bits_))-1;
}
//=============================================================================
} // namespace SceneGraph
} // namespace ACG
//=============================================================================
//=============================================================================
//
// OpenFlipper
// Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
// www.openflipper.org
//
//-----------------------------------------------------------------------------
//
// License
//
// OpenFlipper is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>.
//
//-----------------------------------------------------------------------------
//
// $Revision$
// $Author$
// $Date$
//
//=============================================================================
//=============================================================================
//
// CLASS ColorTranslator
//
//=============================================================================
#ifndef ACG_COLORTRANSLATOR_HH
#define ACG_COLORTRANSLATOR_HH
//== INCLUDES =================================================================
#include "gl.hh"
#include "../Math/VectorT.hh"
//== NAMESPACES ===============================================================
namespace ACG {
namespace SceneGraph {
//== CLASS DEFINITION =========================================================
/** This class can be used to translate colors to integers. Use this
e.g. for color index picking, i.e. drawing objects using a color
corresponding to an unique index.
*/
class ACGDLLEXPORT ColorTranslator
{
public:
/// Default constructor.
ColorTranslator() : initialized_(false) {};
/// Destructor.
~ColorTranslator() {};
/// init (takes current GL context)
void initialize();
/// has it been initialized?
bool initialized() const { return initialized_; }
/// index -> color (one buffer)
Vec3uc index2color(unsigned int _idx) const;
/// color -> index (one buffer)
int color2index(Vec3uc _rgb) const;
/// returns maximal convertable index
unsigned int max_index() const;
private:
bool initialized_;
GLint red_bits_, green_bits_, blue_bits_;
GLuint red_mask_, green_mask_, blue_mask_;
GLuint red_shift_, green_shift_, blue_shift_;
GLuint red_round_, green_round_, blue_round_;
};
//=============================================================================
} // namespace SceneGraph
} // namespace ACG
//=============================================================================
#endif // ACG_COLORTRANSLATOR_HH defined
//=============================================================================
This diff is collapsed.
This diff is collapsed.
//=============================================================================
//
// OpenFlipper
// Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
// www.openflipper.org
//
//-----------------------------------------------------------------------------
//
// License
//
// OpenFlipper is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or