forked from bartvdbraak/blender
soc-2008-mxcurioni: moved the style module and data files to Blender's standard directory (.blender/scripts/freestyle), cleaned up some useless files. As of this revision, the environment variable FREESTYLE_BLENDER_DIR is NOT needed anymore
This commit is contained in:
parent
e71af35f58
commit
7e3a4c84e4
@ -22,20 +22,23 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "../system/StringUtils.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
extern "C" {
|
||||
#include "api2_2x/EXPP_interface.h"
|
||||
}
|
||||
|
||||
namespace Config {
|
||||
Path* Path::_pInstance = 0;
|
||||
Path::Path() {
|
||||
// get the root directory
|
||||
//soc
|
||||
setRootDir(getEnvVar("FREESTYLE_BLENDER_DIR"));
|
||||
setRootDir( bpy_gethome(1) );
|
||||
|
||||
_pInstance = this;
|
||||
}
|
||||
void Path::setRootDir(const string& iRootDir) {
|
||||
_ProjectDir = iRootDir;
|
||||
_ProjectDir = iRootDir + string(DIR_SEP.c_str()) + "freestyle";
|
||||
_ModelsPath = "";
|
||||
_PatternsPath = _ProjectDir + string(DIR_SEP.c_str()) + "data"
|
||||
+ string(DIR_SEP.c_str()) + "textures" + string(DIR_SEP.c_str())
|
||||
@ -43,9 +46,8 @@ void Path::setRootDir(const string& iRootDir) {
|
||||
_BrushesPath = _ProjectDir + string(DIR_SEP.c_str()) + "data"
|
||||
+ string(DIR_SEP.c_str()) + "textures" + string(DIR_SEP.c_str())
|
||||
+ "brushes" + string(DIR_SEP.c_str());
|
||||
_PythonPath = _ProjectDir + string(DIR_SEP.c_str()) + "python"
|
||||
+ string(PATH_SEP.c_str()) + _ProjectDir + string(DIR_SEP.c_str())
|
||||
+ "style_modules_blender" + string(DIR_SEP.c_str()) ;
|
||||
_PythonPath = _ProjectDir + string(DIR_SEP.c_str())
|
||||
+ "style_modules" + string(DIR_SEP.c_str()) ;
|
||||
if (getenv("PYTHONPATH")) {
|
||||
_PythonPath += string(PATH_SEP.c_str()) + string(getenv("PYTHONPATH"));
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ extern "C" {
|
||||
controller->Clear();
|
||||
|
||||
if( strlen(style_module) == 0 ){
|
||||
string path( pathconfig->getProjectDir() + Config::DIR_SEP + "style_modules_blender" + Config::DIR_SEP + "contour.py" );
|
||||
string path( pathconfig->getProjectDir() + Config::DIR_SEP + "style_modules" + Config::DIR_SEP + "contour.py" );
|
||||
strcpy( style_module, path.c_str() );
|
||||
}
|
||||
|
||||
|
@ -1,176 +0,0 @@
|
||||
# This file should be viewed as a -*- mode: Makefile -*-
|
||||
|
||||
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
||||
# A p p l i c a t i o n & L i b r a r i e s #
|
||||
# b u i l d c o n f i g u r a t i o n #
|
||||
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
||||
|
||||
#
|
||||
# APPLICATION
|
||||
#
|
||||
#######################################
|
||||
|
||||
APPNAME = Freestyle
|
||||
APPVERSION_MAJ = 2
|
||||
APPVERSION_MID = 2
|
||||
APPVERSION_MIN = 0
|
||||
APPVERSION = $${APPVERSION_MAJ}.$${APPVERSION_MID}.$${APPVERSION_MIN}
|
||||
|
||||
PYTHON_VERSION_MAJ = 2
|
||||
PYTHON_VERSION_MIN = 5
|
||||
|
||||
LIB3DS_VERSION_MAJ = 1
|
||||
LIB3DS_VERSION_MIN = 30
|
||||
|
||||
#
|
||||
# CONFIG
|
||||
#
|
||||
#######################################
|
||||
|
||||
CONFIG -= debug release ReleaseBuild Release build_pass precompile_header debug_and_release debug_and_release_target
|
||||
CONFIG *= qt shared stl exceptions rtti thread
|
||||
CONFIG *= release # debug or release
|
||||
CONFIG *= warn_off # warn_off or warn_on
|
||||
mac:CONFIG += x86
|
||||
#mac:CONFIG += ppc
|
||||
#mac:CONFIG *= lib_bundle
|
||||
|
||||
#mac:QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.4u.sdk
|
||||
#message($$CONFIG)
|
||||
#CONFIG *= static
|
||||
#CONFIG *= profiling
|
||||
|
||||
|
||||
|
||||
QT += opengl
|
||||
|
||||
#
|
||||
# LIBRARIES
|
||||
#
|
||||
#######################################
|
||||
|
||||
debug{
|
||||
LIB_GEOMETRY = $${APPNAME}Geometry_d
|
||||
LIB_IMAGE = $${APPNAME}Image_d
|
||||
LIB_RENDERING = $${APPNAME}Rendering_d
|
||||
LIB_SCENE_GRAPH = $${APPNAME}SceneGraph_d
|
||||
LIB_SYSTEM = $${APPNAME}System_d
|
||||
LIB_VIEW_MAP = $${APPNAME}ViewMap_d
|
||||
LIB_STROKE = $${APPNAME}Stroke_d
|
||||
LIB_WINGED_EDGE = $${APPNAME}WingedEdge_d
|
||||
}else{
|
||||
LIB_GEOMETRY = $${APPNAME}Geometry
|
||||
LIB_IMAGE = $${APPNAME}Image
|
||||
LIB_RENDERING = $${APPNAME}Rendering
|
||||
LIB_SCENE_GRAPH = $${APPNAME}SceneGraph
|
||||
LIB_SYSTEM = $${APPNAME}System
|
||||
LIB_VIEW_MAP = $${APPNAME}ViewMap
|
||||
LIB_STROKE = $${APPNAME}Stroke
|
||||
LIB_WINGED_EDGE = $${APPNAME}WingedEdge
|
||||
}
|
||||
|
||||
LIBVERSION = $${APPVERSION_MAJ}.$${APPVERSION_MID}
|
||||
|
||||
|
||||
#
|
||||
# FLAGS
|
||||
#
|
||||
#######################################
|
||||
|
||||
win32:QMAKE_CXXFLAGS *= /GR /GX
|
||||
win32:QMAKE_CFLAGS *= /GR /GX
|
||||
irix-n32:QMAKE_CFLAGS *= -LANG:std
|
||||
irix-n32:QMAKE_CXXFLAGS *= -LANG:std
|
||||
linux-g++:QMAKE_CFLAGS *= -Wno-deprecated
|
||||
linux-g++:QMAKE_CXXFLAGS *= -Wno-deprecated
|
||||
cygwin-g++:QMAKE_CFLAGS *= -Wno-deprecated
|
||||
cygwin-g++:QMAKE_CXXFLAGS *= -Wno-deprecated -mno-win32
|
||||
mac:QMAKE_CFLAGS *= -Wno-deprecated
|
||||
mac:QMAKE_CXXFLAGS *= -Wno-deprecated
|
||||
|
||||
linux-g++:QMAKE_CFLAGS_RELEASE = -O3 -funroll-loops -fomit-frame-pointer -ffast-math -march=i686
|
||||
linux-g++:QMAKE_CXXFLAGS_RELEASE = -O3 -funroll-loops -fomit-frame-pointer -ffast-math -march=i686
|
||||
cygwin-g++:QMAKE_CFLAGS_RELEASE = -O3 -funroll-loops -fomit-frame-pointer -ffast-math -march=i686
|
||||
cygwin-g++:QMAKE_CXXFLAGS_RELEASE = -O3 -funroll-loops -fomit-frame-pointer -ffast-math -march=i686
|
||||
mac:QMAKE_CFLAGS_RELEASE = -O3 -funroll-loops -fomit-frame-pointer -ffast-math -march=i686
|
||||
mac:QMAKE_CXXFLAGS_RELEASE = -O3 -funroll-loops -fomit-frame-pointer -ffast-math -march=i686
|
||||
|
||||
profiling {
|
||||
linux-g++:QMAKE_CFLAGS_DEBUG = -pg
|
||||
linux-g++:QMAKE_CXXFLAGS_DEBUG = -pg
|
||||
linux-g++:QMAKE_LFLAGS_DEBUG = -pg
|
||||
cygwin-g++:QMAKE_CFLAGS_DEBUG = -pg
|
||||
cygwin-g++:QMAKE_CXXFLAGS_DEBUG = -pg
|
||||
cygwin-g++:QMAKE_LFLAGS_DEBUG = -pg
|
||||
mac:QMAKE_CFLAGS_DEBUG = -pg
|
||||
mac:QMAKE_CXXFLAGS_DEBUG = -pg
|
||||
mac:QMAKE_LFLAGS_DEBUG = -pg
|
||||
}
|
||||
|
||||
#
|
||||
# DEFINES
|
||||
#
|
||||
#######################################
|
||||
|
||||
win32:DEFINES *= WIN32 QT_DLL QT_THREAD_SUPPORT
|
||||
linux-g++:DEFINES *= LINUX
|
||||
cygwin-g++:DEFINES *= CYGWIN
|
||||
irix-n32:DEFINES *= IRIX
|
||||
mac:DEFINES *= MACOSX
|
||||
|
||||
#
|
||||
# BUILD DIRECTORIES (RELATIVE)
|
||||
#
|
||||
#######################################
|
||||
|
||||
release {
|
||||
win32 {
|
||||
REL_OBJECTS_DIR = \\win32\\release\\obj
|
||||
REL_DESTDIR = \\win32\\release
|
||||
}
|
||||
linux-g++ {
|
||||
REL_OBJECTS_DIR = linux-g++/release/obj
|
||||
REL_DESTDIR = linux-g++/release
|
||||
}
|
||||
cygwin-g++ {
|
||||
REL_OBJECTS_DIR = cygwin-g++/release/obj
|
||||
REL_DESTDIR = cygwin-g++/release
|
||||
}
|
||||
irix-n32 {
|
||||
REL_OBJECTS_DIR = irix-n32/release/obj
|
||||
REL_DESTDIR = irix-n32/release
|
||||
}
|
||||
mac {
|
||||
REL_OBJECTS_DIR = macosx/release/obj
|
||||
REL_DESTDIR = macosx/release
|
||||
}
|
||||
}
|
||||
debug {
|
||||
win32 {
|
||||
REL_OBJECTS_DIR = \\win32\\debug\\obj
|
||||
REL_DESTDIR = \\win32\\debug
|
||||
}
|
||||
linux-g++ {
|
||||
REL_OBJECTS_DIR = linux-g++/debug/obj
|
||||
REL_DESTDIR = linux-g++/debug
|
||||
}
|
||||
cygwin-g++ {
|
||||
REL_OBJECTS_DIR = cygwin-g++/debug/obj
|
||||
REL_DESTDIR = cygwin-g++/debug
|
||||
}
|
||||
irix-n32 {
|
||||
REL_OBJECTS_DIR = irix-n32/debug/obj
|
||||
REL_DESTDIR = irix-n32/debug
|
||||
}
|
||||
mac {
|
||||
REL_OBJECTS_DIR = macosx/debug/obj
|
||||
REL_DESTDIR = macosx/debug
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# INSTALL
|
||||
#
|
||||
#######################################
|
||||
|
||||
#QMAKE_COPY_FILE = $${QMAKE_COPY} -P
|
@ -1,113 +0,0 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Freestyle_d", "app\app_d.vcproj", "{0BC94A80-9E3E-40D8-B2CF-6594F96361C5}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{DFCED64E-AEFA-4D06-8609-DE23A69D0361} = {DFCED64E-AEFA-4D06-8609-DE23A69D0361}
|
||||
{AF37DD50-8CD3-4339-AB32-C6F8F770CB30} = {AF37DD50-8CD3-4339-AB32-C6F8F770CB30}
|
||||
{FA76B552-8A89-4A50-92F7-A77935515005} = {FA76B552-8A89-4A50-92F7-A77935515005}
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE} = {3E1C0A57-8206-402F-A12E-3B100F121DDE}
|
||||
{9F2B9C57-F57F-4A8A-9590-6DDD1E51433C} = {9F2B9C57-F57F-4A8A-9590-6DDD1E51433C}
|
||||
{4C44396A-8016-4360-8F5C-35CA6CC282BD} = {4C44396A-8016-4360-8F5C-35CA6CC282BD}
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A} = {AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}
|
||||
{858093EF-6B95-4D0F-AA0A-CF187C6F369F} = {858093EF-6B95-4D0F-AA0A-CF187C6F369F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleGeometry_d", "geometry\geometry_d.vcproj", "{3E1C0A57-8206-402F-A12E-3B100F121DDE}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A} = {AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleImage_d", "image\image_d.vcproj", "{4C44396A-8016-4360-8F5C-35CA6CC282BD}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A} = {AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleRendering_d", "rendering\rendering_d.vcproj", "{9F2B9C57-F57F-4A8A-9590-6DDD1E51433C}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{DFCED64E-AEFA-4D06-8609-DE23A69D0361} = {DFCED64E-AEFA-4D06-8609-DE23A69D0361}
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE} = {3E1C0A57-8206-402F-A12E-3B100F121DDE}
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A} = {AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}
|
||||
{858093EF-6B95-4D0F-AA0A-CF187C6F369F} = {858093EF-6B95-4D0F-AA0A-CF187C6F369F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleSceneGraph_d", "scene_graph\scene_graph_d.vcproj", "{858093EF-6B95-4D0F-AA0A-CF187C6F369F}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE} = {3E1C0A57-8206-402F-A12E-3B100F121DDE}
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A} = {AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleStroke_d", "stroke\stroke_d.vcproj", "{DFCED64E-AEFA-4D06-8609-DE23A69D0361}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{FA76B552-8A89-4A50-92F7-A77935515005} = {FA76B552-8A89-4A50-92F7-A77935515005}
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE} = {3E1C0A57-8206-402F-A12E-3B100F121DDE}
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A} = {AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleSystem_d", "system\system_d.vcproj", "{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleViewMap_d", "view_map\view_map_d.vcproj", "{FA76B552-8A89-4A50-92F7-A77935515005}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{AF37DD50-8CD3-4339-AB32-C6F8F770CB30} = {AF37DD50-8CD3-4339-AB32-C6F8F770CB30}
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE} = {3E1C0A57-8206-402F-A12E-3B100F121DDE}
|
||||
{4C44396A-8016-4360-8F5C-35CA6CC282BD} = {4C44396A-8016-4360-8F5C-35CA6CC282BD}
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A} = {AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleWingedEdge_d", "winged_edge\winged_edge_d.vcproj", "{AF37DD50-8CD3-4339-AB32-C6F8F770CB30}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE} = {3E1C0A57-8206-402F-A12E-3B100F121DDE}
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A} = {AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}
|
||||
{858093EF-6B95-4D0F-AA0A-CF187C6F369F} = {858093EF-6B95-4D0F-AA0A-CF187C6F369F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectDependencies) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{0BC94A80-9E3E-40D8-B2CF-6594F96361C5}.Debug.ActiveCfg = Debug|Win32
|
||||
{0BC94A80-9E3E-40D8-B2CF-6594F96361C5}.Debug.Build.0 = Debug|Win32
|
||||
{0BC94A80-9E3E-40D8-B2CF-6594F96361C5}.Release.ActiveCfg = Debug|Win32
|
||||
{0BC94A80-9E3E-40D8-B2CF-6594F96361C5}.Release.Build.0 = Debug|Win32
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE}.Debug.ActiveCfg = Debug|Win32
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE}.Debug.Build.0 = Debug|Win32
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE}.Release.ActiveCfg = Debug|Win32
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE}.Release.Build.0 = Debug|Win32
|
||||
{4C44396A-8016-4360-8F5C-35CA6CC282BD}.Debug.ActiveCfg = Debug|Win32
|
||||
{4C44396A-8016-4360-8F5C-35CA6CC282BD}.Debug.Build.0 = Debug|Win32
|
||||
{4C44396A-8016-4360-8F5C-35CA6CC282BD}.Release.ActiveCfg = Debug|Win32
|
||||
{4C44396A-8016-4360-8F5C-35CA6CC282BD}.Release.Build.0 = Debug|Win32
|
||||
{9F2B9C57-F57F-4A8A-9590-6DDD1E51433C}.Debug.ActiveCfg = Debug|Win32
|
||||
{9F2B9C57-F57F-4A8A-9590-6DDD1E51433C}.Debug.Build.0 = Debug|Win32
|
||||
{9F2B9C57-F57F-4A8A-9590-6DDD1E51433C}.Release.ActiveCfg = Debug|Win32
|
||||
{9F2B9C57-F57F-4A8A-9590-6DDD1E51433C}.Release.Build.0 = Debug|Win32
|
||||
{858093EF-6B95-4D0F-AA0A-CF187C6F369F}.Debug.ActiveCfg = Debug|Win32
|
||||
{858093EF-6B95-4D0F-AA0A-CF187C6F369F}.Debug.Build.0 = Debug|Win32
|
||||
{858093EF-6B95-4D0F-AA0A-CF187C6F369F}.Release.ActiveCfg = Debug|Win32
|
||||
{858093EF-6B95-4D0F-AA0A-CF187C6F369F}.Release.Build.0 = Debug|Win32
|
||||
{DFCED64E-AEFA-4D06-8609-DE23A69D0361}.Debug.ActiveCfg = Debug|Win32
|
||||
{DFCED64E-AEFA-4D06-8609-DE23A69D0361}.Debug.Build.0 = Debug|Win32
|
||||
{DFCED64E-AEFA-4D06-8609-DE23A69D0361}.Release.ActiveCfg = Debug|Win32
|
||||
{DFCED64E-AEFA-4D06-8609-DE23A69D0361}.Release.Build.0 = Debug|Win32
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}.Debug.ActiveCfg = Debug|Win32
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}.Debug.Build.0 = Debug|Win32
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}.Release.ActiveCfg = Debug|Win32
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}.Release.Build.0 = Debug|Win32
|
||||
{FA76B552-8A89-4A50-92F7-A77935515005}.Debug.ActiveCfg = Debug|Win32
|
||||
{FA76B552-8A89-4A50-92F7-A77935515005}.Debug.Build.0 = Debug|Win32
|
||||
{FA76B552-8A89-4A50-92F7-A77935515005}.Release.ActiveCfg = Release|Win32
|
||||
{FA76B552-8A89-4A50-92F7-A77935515005}.Release.Build.0 = Release|Win32
|
||||
{AF37DD50-8CD3-4339-AB32-C6F8F770CB30}.Debug.ActiveCfg = Debug|Win32
|
||||
{AF37DD50-8CD3-4339-AB32-C6F8F770CB30}.Debug.Build.0 = Debug|Win32
|
||||
{AF37DD50-8CD3-4339-AB32-C6F8F770CB30}.Release.ActiveCfg = Debug|Win32
|
||||
{AF37DD50-8CD3-4339-AB32-C6F8F770CB30}.Release.Build.0 = Debug|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -1,111 +0,0 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Freestyle", "app\app.vcproj", "{0BC94A80-9E3E-40D8-B2CF-6594F96361C5}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{DFCED64E-AEFA-4D06-8609-DE23A69D0361} = {DFCED64E-AEFA-4D06-8609-DE23A69D0361}
|
||||
{AF37DD50-8CD3-4339-AB32-C6F8F770CB30} = {AF37DD50-8CD3-4339-AB32-C6F8F770CB30}
|
||||
{FA76B552-8A89-4A50-92F7-A77935515005} = {FA76B552-8A89-4A50-92F7-A77935515005}
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE} = {3E1C0A57-8206-402F-A12E-3B100F121DDE}
|
||||
{9F2B9C57-F57F-4A8A-9590-6DDD1E51433C} = {9F2B9C57-F57F-4A8A-9590-6DDD1E51433C}
|
||||
{4C44396A-8016-4360-8F5C-35CA6CC282BD} = {4C44396A-8016-4360-8F5C-35CA6CC282BD}
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A} = {AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}
|
||||
{858093EF-6B95-4D0F-AA0A-CF187C6F369F} = {858093EF-6B95-4D0F-AA0A-CF187C6F369F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleGeometry", "geometry\geometry.vcproj", "{3E1C0A57-8206-402F-A12E-3B100F121DDE}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A} = {AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleImage", "image\image.vcproj", "{4C44396A-8016-4360-8F5C-35CA6CC282BD}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A} = {AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleRendering", "rendering\rendering.vcproj", "{9F2B9C57-F57F-4A8A-9590-6DDD1E51433C}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{DFCED64E-AEFA-4D06-8609-DE23A69D0361} = {DFCED64E-AEFA-4D06-8609-DE23A69D0361}
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE} = {3E1C0A57-8206-402F-A12E-3B100F121DDE}
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A} = {AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}
|
||||
{858093EF-6B95-4D0F-AA0A-CF187C6F369F} = {858093EF-6B95-4D0F-AA0A-CF187C6F369F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleSceneGraph", "scene_graph\scene_graph.vcproj", "{858093EF-6B95-4D0F-AA0A-CF187C6F369F}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE} = {3E1C0A57-8206-402F-A12E-3B100F121DDE}
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A} = {AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleStroke", "stroke\stroke.vcproj", "{DFCED64E-AEFA-4D06-8609-DE23A69D0361}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{FA76B552-8A89-4A50-92F7-A77935515005} = {FA76B552-8A89-4A50-92F7-A77935515005}
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE} = {3E1C0A57-8206-402F-A12E-3B100F121DDE}
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A} = {AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleSystem", "system\system.vcproj", "{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleViewMap", "view_map\view_map.vcproj", "{FA76B552-8A89-4A50-92F7-A77935515005}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{AF37DD50-8CD3-4339-AB32-C6F8F770CB30} = {AF37DD50-8CD3-4339-AB32-C6F8F770CB30}
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE} = {3E1C0A57-8206-402F-A12E-3B100F121DDE}
|
||||
{4C44396A-8016-4360-8F5C-35CA6CC282BD} = {4C44396A-8016-4360-8F5C-35CA6CC282BD}
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A} = {AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleWingedEdge", "winged_edge\winged_edge.vcproj", "{AF37DD50-8CD3-4339-AB32-C6F8F770CB30}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE} = {3E1C0A57-8206-402F-A12E-3B100F121DDE}
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A} = {AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}
|
||||
{858093EF-6B95-4D0F-AA0A-CF187C6F369F} = {858093EF-6B95-4D0F-AA0A-CF187C6F369F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{0BC94A80-9E3E-40D8-B2CF-6594F96361C5}.Debug.ActiveCfg = Debug|Win32
|
||||
{0BC94A80-9E3E-40D8-B2CF-6594F96361C5}.Debug.Build.0 = Debug|Win32
|
||||
{0BC94A80-9E3E-40D8-B2CF-6594F96361C5}.Release.ActiveCfg = Release|Win32
|
||||
{0BC94A80-9E3E-40D8-B2CF-6594F96361C5}.Release.Build.0 = Release|Win32
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE}.Debug.ActiveCfg = Debug|Win32
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE}.Debug.Build.0 = Debug|Win32
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE}.Release.ActiveCfg = Release|Win32
|
||||
{3E1C0A57-8206-402F-A12E-3B100F121DDE}.Release.Build.0 = Release|Win32
|
||||
{4C44396A-8016-4360-8F5C-35CA6CC282BD}.Debug.ActiveCfg = Debug|Win32
|
||||
{4C44396A-8016-4360-8F5C-35CA6CC282BD}.Debug.Build.0 = Debug|Win32
|
||||
{4C44396A-8016-4360-8F5C-35CA6CC282BD}.Release.ActiveCfg = Release|Win32
|
||||
{4C44396A-8016-4360-8F5C-35CA6CC282BD}.Release.Build.0 = Release|Win32
|
||||
{9F2B9C57-F57F-4A8A-9590-6DDD1E51433C}.Debug.ActiveCfg = Debug|Win32
|
||||
{9F2B9C57-F57F-4A8A-9590-6DDD1E51433C}.Debug.Build.0 = Debug|Win32
|
||||
{9F2B9C57-F57F-4A8A-9590-6DDD1E51433C}.Release.ActiveCfg = Release|Win32
|
||||
{9F2B9C57-F57F-4A8A-9590-6DDD1E51433C}.Release.Build.0 = Release|Win32
|
||||
{858093EF-6B95-4D0F-AA0A-CF187C6F369F}.Debug.ActiveCfg = Debug|Win32
|
||||
{858093EF-6B95-4D0F-AA0A-CF187C6F369F}.Debug.Build.0 = Debug|Win32
|
||||
{858093EF-6B95-4D0F-AA0A-CF187C6F369F}.Release.ActiveCfg = Release|Win32
|
||||
{858093EF-6B95-4D0F-AA0A-CF187C6F369F}.Release.Build.0 = Release|Win32
|
||||
{DFCED64E-AEFA-4D06-8609-DE23A69D0361}.Debug.ActiveCfg = Debug|Win32
|
||||
{DFCED64E-AEFA-4D06-8609-DE23A69D0361}.Debug.Build.0 = Debug|Win32
|
||||
{DFCED64E-AEFA-4D06-8609-DE23A69D0361}.Release.ActiveCfg = Release|Win32
|
||||
{DFCED64E-AEFA-4D06-8609-DE23A69D0361}.Release.Build.0 = Release|Win32
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}.Debug.ActiveCfg = Debug|Win32
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}.Debug.Build.0 = Debug|Win32
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}.Release.ActiveCfg = Release|Win32
|
||||
{AE79BAD6-6F46-4AA1-BBEA-28CC209FC28A}.Release.Build.0 = Release|Win32
|
||||
{FA76B552-8A89-4A50-92F7-A77935515005}.Debug.ActiveCfg = Debug|Win32
|
||||
{FA76B552-8A89-4A50-92F7-A77935515005}.Debug.Build.0 = Debug|Win32
|
||||
{FA76B552-8A89-4A50-92F7-A77935515005}.Release.ActiveCfg = Release|Win32
|
||||
{FA76B552-8A89-4A50-92F7-A77935515005}.Release.Build.0 = Release|Win32
|
||||
{AF37DD50-8CD3-4339-AB32-C6F8F770CB30}.Debug.ActiveCfg = Debug|Win32
|
||||
{AF37DD50-8CD3-4339-AB32-C6F8F770CB30}.Debug.Build.0 = Debug|Win32
|
||||
{AF37DD50-8CD3-4339-AB32-C6F8F770CB30}.Release.ActiveCfg = Release|Win32
|
||||
{AF37DD50-8CD3-4339-AB32-C6F8F770CB30}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -1,87 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual C++ Express 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleSystem_d", "system\system_d.vcproj", "{AAAAA9BB-8C01-3BC3-9808-AB6717F08393}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleGeometry_d", "geometry\geometry_d.vcproj", "{5F60164C-8544-3259-A8CB-24636A092489}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleImage_d", "image\image_d.vcproj", "{28F6AC11-2A9B-3886-97DD-82FB353409CB}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleSceneGraph_d", "scene_graph\scene_graph_d.vcproj", "{C98C60D8-9836-30A5-BEA9-0D320E5AF308}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{AAAAA9BB-8C01-3BC3-9808-AB6717F08393} = {AAAAA9BB-8C01-3BC3-9808-AB6717F08393}
|
||||
{5F60164C-8544-3259-A8CB-24636A092489} = {5F60164C-8544-3259-A8CB-24636A092489}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleWingedEdge_d", "winged_edge\winged_edge_d.vcproj", "{E46825D6-9581-3D8A-96FE-7C90BC188602}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{5F60164C-8544-3259-A8CB-24636A092489} = {5F60164C-8544-3259-A8CB-24636A092489}
|
||||
{AAAAA9BB-8C01-3BC3-9808-AB6717F08393} = {AAAAA9BB-8C01-3BC3-9808-AB6717F08393}
|
||||
{C98C60D8-9836-30A5-BEA9-0D320E5AF308} = {C98C60D8-9836-30A5-BEA9-0D320E5AF308}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleViewMap_d", "view_map\view_map_d.vcproj", "{6769BAB7-2894-3453-B07A-58C32D6646E3}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{C98C60D8-9836-30A5-BEA9-0D320E5AF308} = {C98C60D8-9836-30A5-BEA9-0D320E5AF308}
|
||||
{E46825D6-9581-3D8A-96FE-7C90BC188602} = {E46825D6-9581-3D8A-96FE-7C90BC188602}
|
||||
{AAAAA9BB-8C01-3BC3-9808-AB6717F08393} = {AAAAA9BB-8C01-3BC3-9808-AB6717F08393}
|
||||
{5F60164C-8544-3259-A8CB-24636A092489} = {5F60164C-8544-3259-A8CB-24636A092489}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleStroke_d", "stroke\stroke_d.vcproj", "{EDA5F096-B8D0-336F-82DB-501B2F00C1CD}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{5F60164C-8544-3259-A8CB-24636A092489} = {5F60164C-8544-3259-A8CB-24636A092489}
|
||||
{6769BAB7-2894-3453-B07A-58C32D6646E3} = {6769BAB7-2894-3453-B07A-58C32D6646E3}
|
||||
{AAAAA9BB-8C01-3BC3-9808-AB6717F08393} = {AAAAA9BB-8C01-3BC3-9808-AB6717F08393}
|
||||
{E46825D6-9581-3D8A-96FE-7C90BC188602} = {E46825D6-9581-3D8A-96FE-7C90BC188602}
|
||||
{C98C60D8-9836-30A5-BEA9-0D320E5AF308} = {C98C60D8-9836-30A5-BEA9-0D320E5AF308}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleRendering_d", "rendering\rendering_d.vcproj", "{D5EA771F-A1FF-3F68-A391-98EEEB407E78}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{5F60164C-8544-3259-A8CB-24636A092489} = {5F60164C-8544-3259-A8CB-24636A092489}
|
||||
{EDA5F096-B8D0-336F-82DB-501B2F00C1CD} = {EDA5F096-B8D0-336F-82DB-501B2F00C1CD}
|
||||
{AAAAA9BB-8C01-3BC3-9808-AB6717F08393} = {AAAAA9BB-8C01-3BC3-9808-AB6717F08393}
|
||||
{C98C60D8-9836-30A5-BEA9-0D320E5AF308} = {C98C60D8-9836-30A5-BEA9-0D320E5AF308}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Freestyle_d", "app\app_d.vcproj", "{606D6459-D5F6-3A09-8962-50E8551545AB}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{C98C60D8-9836-30A5-BEA9-0D320E5AF308} = {C98C60D8-9836-30A5-BEA9-0D320E5AF308}
|
||||
{E46825D6-9581-3D8A-96FE-7C90BC188602} = {E46825D6-9581-3D8A-96FE-7C90BC188602}
|
||||
{AAAAA9BB-8C01-3BC3-9808-AB6717F08393} = {AAAAA9BB-8C01-3BC3-9808-AB6717F08393}
|
||||
{6769BAB7-2894-3453-B07A-58C32D6646E3} = {6769BAB7-2894-3453-B07A-58C32D6646E3}
|
||||
{EDA5F096-B8D0-336F-82DB-501B2F00C1CD} = {EDA5F096-B8D0-336F-82DB-501B2F00C1CD}
|
||||
{5F60164C-8544-3259-A8CB-24636A092489} = {5F60164C-8544-3259-A8CB-24636A092489}
|
||||
{D5EA771F-A1FF-3F68-A391-98EEEB407E78} = {D5EA771F-A1FF-3F68-A391-98EEEB407E78}
|
||||
{28F6AC11-2A9B-3886-97DD-82FB353409CB} = {28F6AC11-2A9B-3886-97DD-82FB353409CB}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{AAAAA9BB-8C01-3BC3-9808-AB6717F08393}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{AAAAA9BB-8C01-3BC3-9808-AB6717F08393}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{5F60164C-8544-3259-A8CB-24636A092489}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{5F60164C-8544-3259-A8CB-24636A092489}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{28F6AC11-2A9B-3886-97DD-82FB353409CB}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{28F6AC11-2A9B-3886-97DD-82FB353409CB}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C98C60D8-9836-30A5-BEA9-0D320E5AF308}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C98C60D8-9836-30A5-BEA9-0D320E5AF308}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E46825D6-9581-3D8A-96FE-7C90BC188602}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E46825D6-9581-3D8A-96FE-7C90BC188602}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{6769BAB7-2894-3453-B07A-58C32D6646E3}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{6769BAB7-2894-3453-B07A-58C32D6646E3}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{EDA5F096-B8D0-336F-82DB-501B2F00C1CD}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{EDA5F096-B8D0-336F-82DB-501B2F00C1CD}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{D5EA771F-A1FF-3F68-A391-98EEEB407E78}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{D5EA771F-A1FF-3F68-A391-98EEEB407E78}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{606D6459-D5F6-3A09-8962-50E8551545AB}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{606D6459-D5F6-3A09-8962-50E8551545AB}.Debug|Win32.Build.0 = Debug|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -1,87 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual C++ Express 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Freestyle", "app\app.vcproj", "{B56F2464-158F-32C1-A9F7-EE85397706EC}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{555B73B2-B07B-3865-9D41-0FB69091E0C9} = {555B73B2-B07B-3865-9D41-0FB69091E0C9}
|
||||
{F6589FA0-9FA2-31F9-BD0F-FFE303DE8759} = {F6589FA0-9FA2-31F9-BD0F-FFE303DE8759}
|
||||
{9A93A87D-09E4-3492-A68C-A7B1A38DE002} = {9A93A87D-09E4-3492-A68C-A7B1A38DE002}
|
||||
{3804962B-1D5B-382E-B69E-96FFB2372A46} = {3804962B-1D5B-382E-B69E-96FFB2372A46}
|
||||
{A494B81F-F5EC-35DE-8DDC-4F6FD6B536D5} = {A494B81F-F5EC-35DE-8DDC-4F6FD6B536D5}
|
||||
{35891119-E049-35BB-AB8E-8536817F5CEE} = {35891119-E049-35BB-AB8E-8536817F5CEE}
|
||||
{0FDD8610-0785-3089-900D-53F786E9AC9B} = {0FDD8610-0785-3089-900D-53F786E9AC9B}
|
||||
{1D57A40D-AE4B-3E40-A023-4F37C9D7446C} = {1D57A40D-AE4B-3E40-A023-4F37C9D7446C}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleGeometry", "geometry\geometry.vcproj", "{1D57A40D-AE4B-3E40-A023-4F37C9D7446C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleImage", "image\image.vcproj", "{A494B81F-F5EC-35DE-8DDC-4F6FD6B536D5}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleRendering", "rendering\rendering.vcproj", "{0FDD8610-0785-3089-900D-53F786E9AC9B}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{1D57A40D-AE4B-3E40-A023-4F37C9D7446C} = {1D57A40D-AE4B-3E40-A023-4F37C9D7446C}
|
||||
{35891119-E049-35BB-AB8E-8536817F5CEE} = {35891119-E049-35BB-AB8E-8536817F5CEE}
|
||||
{3804962B-1D5B-382E-B69E-96FFB2372A46} = {3804962B-1D5B-382E-B69E-96FFB2372A46}
|
||||
{9A93A87D-09E4-3492-A68C-A7B1A38DE002} = {9A93A87D-09E4-3492-A68C-A7B1A38DE002}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleSceneGraph", "scene_graph\scene_graph.vcproj", "{35891119-E049-35BB-AB8E-8536817F5CEE}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{3804962B-1D5B-382E-B69E-96FFB2372A46} = {3804962B-1D5B-382E-B69E-96FFB2372A46}
|
||||
{1D57A40D-AE4B-3E40-A023-4F37C9D7446C} = {1D57A40D-AE4B-3E40-A023-4F37C9D7446C}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleStroke", "stroke\stroke.vcproj", "{9A93A87D-09E4-3492-A68C-A7B1A38DE002}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{1D57A40D-AE4B-3E40-A023-4F37C9D7446C} = {1D57A40D-AE4B-3E40-A023-4F37C9D7446C}
|
||||
{35891119-E049-35BB-AB8E-8536817F5CEE} = {35891119-E049-35BB-AB8E-8536817F5CEE}
|
||||
{3804962B-1D5B-382E-B69E-96FFB2372A46} = {3804962B-1D5B-382E-B69E-96FFB2372A46}
|
||||
{F6589FA0-9FA2-31F9-BD0F-FFE303DE8759} = {F6589FA0-9FA2-31F9-BD0F-FFE303DE8759}
|
||||
{555B73B2-B07B-3865-9D41-0FB69091E0C9} = {555B73B2-B07B-3865-9D41-0FB69091E0C9}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleSystem", "system\system.vcproj", "{3804962B-1D5B-382E-B69E-96FFB2372A46}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleViewMap", "view_map\view_map.vcproj", "{F6589FA0-9FA2-31F9-BD0F-FFE303DE8759}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{555B73B2-B07B-3865-9D41-0FB69091E0C9} = {555B73B2-B07B-3865-9D41-0FB69091E0C9}
|
||||
{3804962B-1D5B-382E-B69E-96FFB2372A46} = {3804962B-1D5B-382E-B69E-96FFB2372A46}
|
||||
{35891119-E049-35BB-AB8E-8536817F5CEE} = {35891119-E049-35BB-AB8E-8536817F5CEE}
|
||||
{1D57A40D-AE4B-3E40-A023-4F37C9D7446C} = {1D57A40D-AE4B-3E40-A023-4F37C9D7446C}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreestyleWingedEdge", "winged_edge\winged_edge.vcproj", "{555B73B2-B07B-3865-9D41-0FB69091E0C9}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{1D57A40D-AE4B-3E40-A023-4F37C9D7446C} = {1D57A40D-AE4B-3E40-A023-4F37C9D7446C}
|
||||
{35891119-E049-35BB-AB8E-8536817F5CEE} = {35891119-E049-35BB-AB8E-8536817F5CEE}
|
||||
{3804962B-1D5B-382E-B69E-96FFB2372A46} = {3804962B-1D5B-382E-B69E-96FFB2372A46}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B56F2464-158F-32C1-A9F7-EE85397706EC}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B56F2464-158F-32C1-A9F7-EE85397706EC}.Release|Win32.Build.0 = Release|Win32
|
||||
{1D57A40D-AE4B-3E40-A023-4F37C9D7446C}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1D57A40D-AE4B-3E40-A023-4F37C9D7446C}.Release|Win32.Build.0 = Release|Win32
|
||||
{A494B81F-F5EC-35DE-8DDC-4F6FD6B536D5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{A494B81F-F5EC-35DE-8DDC-4F6FD6B536D5}.Release|Win32.Build.0 = Release|Win32
|
||||
{0FDD8610-0785-3089-900D-53F786E9AC9B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0FDD8610-0785-3089-900D-53F786E9AC9B}.Release|Win32.Build.0 = Release|Win32
|
||||
{35891119-E049-35BB-AB8E-8536817F5CEE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{35891119-E049-35BB-AB8E-8536817F5CEE}.Release|Win32.Build.0 = Release|Win32
|
||||
{9A93A87D-09E4-3492-A68C-A7B1A38DE002}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{9A93A87D-09E4-3492-A68C-A7B1A38DE002}.Release|Win32.Build.0 = Release|Win32
|
||||
{3804962B-1D5B-382E-B69E-96FFB2372A46}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{3804962B-1D5B-382E-B69E-96FFB2372A46}.Release|Win32.Build.0 = Release|Win32
|
||||
{F6589FA0-9FA2-31F9-BD0F-FFE303DE8759}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F6589FA0-9FA2-31F9-BD0F-FFE303DE8759}.Release|Win32.Build.0 = Release|Win32
|
||||
{555B73B2-B07B-3865-9D41-0FB69091E0C9}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{555B73B2-B07B-3865-9D41-0FB69091E0C9}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -1,18 +0,0 @@
|
||||
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
||||
# W A R N I N G ! ! ! #
|
||||
# a u t h o r i z e d p e r s o n a l o n l y #
|
||||
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
||||
|
||||
TEMPLATE = subdirs
|
||||
SUBDIRS = system \
|
||||
image \
|
||||
geometry \
|
||||
scene_graph \
|
||||
winged_edge \
|
||||
view_map \
|
||||
stroke \
|
||||
rendering \
|
||||
# swig \
|
||||
app
|
||||
|
||||
|
@ -1,183 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import os,sys,string
|
||||
|
||||
install_dependencies=["GLUT",\
|
||||
"QtCore", "QtGui", "QtXml", \
|
||||
"libQGLViewer", "FreestyleSystem", "FreestyleRendering",\
|
||||
"FreestyleImage","FreestyleGeometry", "FreestyleSceneGraph", "FreestyleWingedEdge",\
|
||||
"FreestyleViewMap", "FreestyleStroke"]
|
||||
|
||||
if not("FREESTYLE_DIR" in os.environ):
|
||||
print "FREESTYLE_DIR must be set to your Freestyle directory"
|
||||
sys.exit()
|
||||
|
||||
src_dir_path=os.environ['FREESTYLE_DIR']
|
||||
dest_dir_path=os.path.join(os.environ['FREESTYLE_DIR'], "freestyle.2.0.0-macosx-x86")
|
||||
bundle_name="Freestyle.app"
|
||||
bundle_path=os.path.join(dest_dir_path,bundle_name)
|
||||
frameworks_path=os.path.join(bundle_path,"Contents/Frameworks")
|
||||
exe_path=os.path.join(bundle_path, "Contents/MacOS")
|
||||
original_lib_path=os.path.join(src_dir_path,"build/macosx/release/lib")
|
||||
original_exe_path=os.path.join(src_dir_path,"build/macosx/release",bundle_name,"Contents/MacOS")
|
||||
|
||||
|
||||
|
||||
# Builds a dictionary of dependencies for
|
||||
# a given binary
|
||||
# The table format is:
|
||||
# "dependency name" "dependency path"
|
||||
def buildDependenciesTable(binary_file, dep_table):
|
||||
cmd="otool -L %s" % binary_file
|
||||
#print cmd
|
||||
#otool_output = os.system(cmd)
|
||||
otool_output = os.popen(cmd).read().split('\n')
|
||||
for dep_text in otool_output:
|
||||
if (dep_text.count(":") == 0):
|
||||
dep = dep_text.split(' ')[0].lstrip()
|
||||
dep_base_name=os.path.basename(dep)
|
||||
dep_table[dep_base_name] = dep
|
||||
|
||||
|
||||
def fixPaths(dep_table):
|
||||
for k,v in dep_table.items():
|
||||
if(k.count("Freestyle")):
|
||||
dep_table[k] = os.path.join(src_dir_path, "build/macosx/release/lib",v)
|
||||
if(k.count("QGLViewer")):
|
||||
dep_table[k] = os.path.join("/usr/lib", v)
|
||||
|
||||
def extractFrameworkBaseDir(framework_lib):
|
||||
parts=framework_lib.split("/")
|
||||
head="/"
|
||||
tail=""
|
||||
in_head=True
|
||||
for p in parts:
|
||||
if(in_head == True):
|
||||
head=os.path.join(head,p)
|
||||
else:
|
||||
tail=os.path.join(tail,p)
|
||||
if(p.count(".framework") != 0):
|
||||
in_head=False
|
||||
return (head,tail)
|
||||
|
||||
def installDependencies(dep_table, install_dependencies, new_dep_table):
|
||||
for k,v in dep_table.items():
|
||||
for d in install_dependencies:
|
||||
if(k.count(d)!=0):
|
||||
framework_dir_path=v
|
||||
cp_option=""
|
||||
head=""
|
||||
tail=""
|
||||
if(v.count("framework")):
|
||||
(head,tail) = extractFrameworkBaseDir(v)
|
||||
framework_dir_path=head
|
||||
cp_option="-R"
|
||||
lib_name=os.path.split(framework_dir_path)[1]
|
||||
target=os.path.join(frameworks_path,lib_name)
|
||||
# update new table
|
||||
if(tail != ""):
|
||||
new_dep_table[k] = os.path.join("@executable_path/../Frameworks",lib_name,tail)
|
||||
else:
|
||||
new_dep_table[k] = os.path.join("@executable_path/../Frameworks",lib_name)
|
||||
if(os.path.exists(target) != True):
|
||||
cmd = "cp %s %s %s" % (cp_option, framework_dir_path,frameworks_path)
|
||||
print "Installing dependency:",lib_name
|
||||
os.system(cmd)
|
||||
|
||||
def updatePathsToDependencies(binary_file, install_dependencies, dep_table, new_dep_table):
|
||||
# executable:
|
||||
f_dep_table={}
|
||||
buildDependenciesTable(binary_file,f_dep_table)
|
||||
for k,v in f_dep_table.items():
|
||||
# is k in install_dependencies?
|
||||
for ld in install_dependencies:
|
||||
if(k.count(ld) != 0):
|
||||
#print new_dep_table
|
||||
cmd="install_name_tool -change %s %s %s" % (v,new_dep_table[k], binary_file)
|
||||
os.system(cmd)
|
||||
# check
|
||||
cmd="otool -L %s" % binary_file
|
||||
os.system(cmd)
|
||||
|
||||
def cleanDir(dir, to_delete):
|
||||
os.chdir(dir)
|
||||
#print os.getcwd()
|
||||
for d in os.listdir("."):
|
||||
#print d
|
||||
if(d == "Headers"):
|
||||
cmd="rm -rf Headers"
|
||||
to_delete.append(os.path.join(dir,d))
|
||||
#os.system(cmd)
|
||||
elif(d.count("debug") != 0):
|
||||
cmd="rm -rf %s"%(d)
|
||||
#print cmd
|
||||
to_delete.append(os.path.join(dir,d))
|
||||
#os.system(cmd)
|
||||
elif(os.path.isdir(d) == True):
|
||||
#print d
|
||||
cleanDir(os.path.join(dir,d), to_delete)
|
||||
#else:
|
||||
# print d
|
||||
os.chdir(os.path.join(dir,".."))
|
||||
#print os.getcwd()
|
||||
|
||||
|
||||
# build bundle structure
|
||||
if( os.path.exists(dest_dir_path) != True):
|
||||
print "Creating directory",dest_dir_path
|
||||
os.mkdir(dest_dir_path)
|
||||
|
||||
if(os.path.exists(bundle_path) != True):
|
||||
print "Creating the bundle structure", bundle_path
|
||||
cmd = "cp -R %s %s" % (os.path.join(src_dir_path, "build/macosx/release/",bundle_name), bundle_path)
|
||||
os.system(cmd)
|
||||
os.mkdir(os.path.join(bundle_path,"Contents/Frameworks"))
|
||||
|
||||
|
||||
dep_table = {}
|
||||
new_dep_table = {}
|
||||
# Executable
|
||||
for f in os.listdir(original_exe_path):
|
||||
if(f[0] == '.'):
|
||||
continue
|
||||
exe_file_path=os.path.join(original_exe_path, f)
|
||||
buildDependenciesTable(exe_file_path, dep_table)
|
||||
|
||||
# Frameworks
|
||||
for f in os.listdir(original_lib_path):
|
||||
if (f.count("framework") == 0):
|
||||
continue
|
||||
f_name=f.split('.')[0]
|
||||
fwk_path=os.path.join(original_lib_path, "%s.framework" % f_name,f_name)
|
||||
buildDependenciesTable(fwk_path, dep_table)
|
||||
|
||||
# Fix ad-hoc paths
|
||||
fixPaths(dep_table)
|
||||
|
||||
# install dependent libs
|
||||
installDependencies(dep_table, install_dependencies, new_dep_table)
|
||||
|
||||
# update paths to installed dependencies
|
||||
for f in os.listdir(exe_path):
|
||||
if(f[0] == '.'):
|
||||
continue
|
||||
updatePathsToDependencies(os.path.join(exe_path,f), install_dependencies, dep_table, new_dep_table)
|
||||
|
||||
# Frameworks
|
||||
for f in os.listdir(frameworks_path):
|
||||
if (f.count("framework") == 0):
|
||||
continue
|
||||
f_name=f.split('.')[0]
|
||||
fwk_path=os.path.join(frameworks_path, "%s.framework" % f_name,f_name)
|
||||
updatePathsToDependencies(fwk_path, install_dependencies, dep_table, new_dep_table)
|
||||
|
||||
|
||||
# Clean-up
|
||||
# Remove debug libs
|
||||
print "Cleaning..."
|
||||
to_delete=[]
|
||||
cleanDir(bundle_path, to_delete)
|
||||
for f in to_delete:
|
||||
cmd = "rm -rf %s"%f
|
||||
print cmd
|
||||
os.system(cmd)
|
@ -1,110 +0,0 @@
|
||||
# This file should be viewed as a -*- mode: Makefile -*-
|
||||
|
||||
contains( CONFIG, 3ds1.20 ) {
|
||||
message ("Using 3ds 1.2.0 module")
|
||||
linux-g++:INCLUDEPATH *= $(HOME)/INCLUDE/LINUX
|
||||
linux-g++:LIBS *= -L$(HOME)/LIB/LINUX -l3ds
|
||||
cygwin-g++:INCLUDEPATH *= /usr/lib/lib3ds-1.2.0
|
||||
cygwin-g++:LIBS *= -L/usr/lib/lib3ds-1.2.0/lib3ds -l3ds
|
||||
mac:INCLUDEPATH *= /usr/local/include
|
||||
mac:LIBS *= -l3ds
|
||||
mac:QMAKE_LIBDIR *= /usr/local/lib
|
||||
win32: INCLUDEPATH *= C:\include\lib3ds\1.2.0
|
||||
win32: QMAKE_LIBDIR *= C:\lib\lib3ds\1.2.0
|
||||
win32:debug: LIBS *= lib3ds-120sd.lib
|
||||
win32:release: LIBS *= lib3ds-120s.lib
|
||||
}
|
||||
|
||||
contains( CONFIG, 3ds1.30 ) {
|
||||
message ("Using 3ds 1.3.0 module")
|
||||
linux-g++:INCLUDEPATH *= $(HOME)/INCLUDE/LINUX
|
||||
linux-g++:LIBS *= -L$(HOME)/LIB/LINUX -l3ds
|
||||
cygwin-g++:INCLUDEPATH *= /usr/lib/lib3ds-1.3.0
|
||||
cygwin-g++:LIBS *= -L/usr/lib/lib3ds-1.3.0/lib3ds -l3ds
|
||||
mac:INCLUDEPATH *= /usr/local/include
|
||||
mac:LIBS *= -l3ds
|
||||
mac:QMAKE_LIBDIR *= /usr/local/lib
|
||||
win32: INCLUDEPATH *= C:\include\lib3ds\1.3.0
|
||||
win32: QMAKE_LIBDIR *= C:\lib\lib3ds\1.3.0
|
||||
win32:debug: LIBS *= lib3ds-1_3d.lib
|
||||
win32:release: LIBS *= lib3ds-1_3.lib
|
||||
}
|
||||
|
||||
contains( CONFIG, qglviewer ) {
|
||||
message ("Using QGLViewer module")
|
||||
CONFIG *= qt thread opengl glut
|
||||
linux-g++:INCLUDEPATH *= $(HOME)/INCLUDE
|
||||
linux-g++:LIBS *= -L$(HOME)/LIB/LINUX -lQGLViewer
|
||||
cygwin-g++:LIBS *= -lQGLViewer
|
||||
win32: INCLUDEPATH *= $(HOME)\INCLUDE
|
||||
win32: QMAKE_LIBDIR *= $(HOME)\LIB
|
||||
win32: LIBS *= QGLViewer.lib
|
||||
}
|
||||
|
||||
contains( CONFIG, python2.3) {
|
||||
message ("Using python 2.3 module")
|
||||
linux-g++:INCLUDEPATH *= /usr/include/python2.3
|
||||
linux-g++:LIBS *= -lpthread -lm -lutil
|
||||
linux-g++:LIBS *= -L/usr/local/lib/ -lpython2.3 -L$(HOME)/LIB/LINUX
|
||||
win32: INCLUDEPATH *= C:\python23\include
|
||||
win32: QMAKE_LIBDIR *= C:\python23\libs
|
||||
win32: LIBS *= python23.lib
|
||||
}
|
||||
|
||||
contains( CONFIG, python2.4) {
|
||||
message ("Using python 2.4 module")
|
||||
linux-g++:INCLUDEPATH *= /usr/include/python2.4
|
||||
linux-g++:LIBS *= -lpthread -lm -lutil
|
||||
linux-g++:LIBS *= -L/usr/local/lib/ -lpython2.4 -L$(HOME)/LIB/LINUX
|
||||
cygwin-g++:INCLUDEPATH *= /usr/include/python2.4
|
||||
cygwin-g++:LIBS *= -lpthread -lm -lutil
|
||||
cygwin-g++:LIBS *= -L/usr/lib/python2.4/config -lpython2.4
|
||||
win32: INCLUDEPATH *= C:\python24\include
|
||||
win32: QMAKE_LIBDIR *= C:\python24\libs
|
||||
win32: LIBS *= python24.lib
|
||||
}
|
||||
|
||||
contains( CONFIG, python2.5) {
|
||||
message ("Using python 2.5 module")
|
||||
linux-g++:INCLUDEPATH *= /usr/include/python2.5
|
||||
linux-g++:LIBS *= -lpthread -lm -lutil
|
||||
linux-g++:LIBS *= -L/usr/local/lib/ -lpython2.5 -L$(HOME)/LIB/LINUX
|
||||
mac: INCLUDEPATH *= /usr/include/python2.5
|
||||
mac: LIBS *= -L/usr/lib/python2.5/config -lpython2.5
|
||||
cygwin-g++:INCLUDEPATH *= /usr/include/python2.5
|
||||
cygwin-g++:LIBS *= -lpthread -lm -lutil
|
||||
cygwin-g++:LIBS *= -L/usr/lib/python2.5/config -lpython2.5
|
||||
win32: INCLUDEPATH *= C:\python25\include
|
||||
win32: QMAKE_LIBDIR *= C:\python25\libs
|
||||
win32: LIBS *= python25.lib
|
||||
}
|
||||
|
||||
|
||||
contains( CONFIG, glut) {
|
||||
message ("Using glut module")
|
||||
linux-g++:LIBS *= -lglut -lXi
|
||||
cygwin-g++:LIBS *= -lglut -lXi
|
||||
mac: LIBS *= -framework Glut
|
||||
win32:INCLUDEPATH *= C:\include
|
||||
win32: QMAKE_LIBDIR *= C:\lib\glut
|
||||
win32: LIBS *= glut32.lib
|
||||
}
|
||||
|
||||
contains( CONFIG, qglviewer2 ) {
|
||||
message ("Using QGLViewer module")
|
||||
CONFIG *= qt thread opengl glut
|
||||
linux-g++:INCLUDEPATH *= $(HOME)/INCLUDE
|
||||
linux-g++:LIBS *= -L$(HOME)/LIB/LINUX -lQGLViewer
|
||||
mac: LIBS *= -lQGLViewer
|
||||
cygwin-g++:LIBS *= -lQGLViewer2
|
||||
win32: INCLUDEPATH *= C:\include\QGLViewer\2.2.5
|
||||
win32{
|
||||
release{
|
||||
QMAKE_LIBDIR *= C:\lib\QGLViewer\release
|
||||
}
|
||||
debug{
|
||||
QMAKE_LIBDIR *= C:\lib\QGLViewer\debug
|
||||
}
|
||||
}
|
||||
win32: LIBS *= QGLViewer2.lib
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
@echo off
|
||||
for /D %%d in (*) do call :FOR2 %%d
|
||||
rem cd ..
|
||||
goto :EOF
|
||||
|
||||
:FOR2
|
||||
set componentpath=%1
|
||||
set dirname=%~n1
|
||||
for %%p in (%componentpath%\*.pro) do if exist %%p call :DSP %%p
|
||||
|
||||
goto :EOF
|
||||
|
||||
:DSP
|
||||
set drive=%~d1
|
||||
set filepath=%~p1
|
||||
cd %drive%%filepath%
|
||||
rem echo %drive%%filepath%
|
||||
set filename=%~n1
|
||||
echo creating %filename%_d.vcproj from %filename%.pro ...
|
||||
if %filename% == app (
|
||||
qmake -t vcapp -win32 -o %filename%_d %filename%.pro
|
||||
) else (
|
||||
qmake -t vclib -win32 -o %filename%_d %filename%.pro
|
||||
)
|
||||
cd..
|
@ -1,25 +0,0 @@
|
||||
@echo off
|
||||
for /D %%d in (*) do call :FOR2 %%d
|
||||
rem cd ..
|
||||
goto :EOF
|
||||
|
||||
:FOR2
|
||||
set componentpath=%1
|
||||
set dirname=%~n1
|
||||
for %%p in (%componentpath%\*.pro) do if exist %%p call :DSP %%p
|
||||
|
||||
goto :EOF
|
||||
|
||||
:DSP
|
||||
set drive=%~d1
|
||||
set filepath=%~p1
|
||||
cd %drive%%filepath%
|
||||
rem echo %drive%%filepath%
|
||||
set filename=%~n1
|
||||
echo creating %filename%.vcproj from %filename%.pro ...
|
||||
if %filename% == app (
|
||||
qmake -t vcapp -win32 -o %filename% %filename%.pro
|
||||
) else (
|
||||
qmake -t vclib -win32 -o %filename% %filename%.pro
|
||||
)
|
||||
cd..
|
@ -1,739 +0,0 @@
|
||||
#
|
||||
# Filename : ChainingIterators.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Chaining Iterators to be used with chaining operators
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
|
||||
## the natural chaining iterator
|
||||
## It follows the edges of same nature following the topology of
|
||||
## objects with preseance on silhouettes, then borders,
|
||||
## then suggestive contours, then everything else. It doesn't chain the same ViewEdge twice
|
||||
## You can specify whether to stay in the selection or not.
|
||||
class pyChainSilhouetteIterator(ChainingIterator):
|
||||
def __init__(self, stayInSelection=1):
|
||||
ChainingIterator.__init__(self, stayInSelection, 1,None,1)
|
||||
def getExactTypeName(self):
|
||||
return "pyChainSilhouetteIterator"
|
||||
def init(self):
|
||||
pass
|
||||
def traverse(self, iter):
|
||||
winner = None
|
||||
it = AdjacencyIterator(iter)
|
||||
nextVertex = self.getVertex()
|
||||
if(nextVertex.getNature() & Nature.T_VERTEX != 0):
|
||||
tvertex = nextVertex.castToTVertex()
|
||||
mateVE = tvertex.mate(self.getCurrentEdge())
|
||||
while(it.isEnd() == 0):
|
||||
ve = it.getObject()
|
||||
if(ve.getId() == mateVE.getId() ):
|
||||
winner = ve
|
||||
break
|
||||
it.increment()
|
||||
else:
|
||||
## case of NonTVertex
|
||||
natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
|
||||
for i in range(len(natures)):
|
||||
currentNature = self.getCurrentEdge().getNature()
|
||||
if(natures[i] & currentNature):
|
||||
count=0
|
||||
while(it.isEnd() == 0):
|
||||
visitNext = 0
|
||||
oNature = it.getObject().getNature()
|
||||
if(oNature & natures[i] != 0):
|
||||
if(natures[i] != oNature):
|
||||
for j in range(i):
|
||||
if(natures[j] & oNature != 0):
|
||||
visitNext = 1
|
||||
break
|
||||
if(visitNext != 0):
|
||||
break
|
||||
count = count+1
|
||||
winner = it.getObject()
|
||||
it.increment()
|
||||
if(count != 1):
|
||||
winner = None
|
||||
break
|
||||
return winner
|
||||
|
||||
## the natural chaining iterator
|
||||
## It follows the edges of same nature on the same
|
||||
## objects with preseance on silhouettes, then borders,
|
||||
## then suggestive contours, then everything else. It doesn't chain the same ViewEdge twice
|
||||
## You can specify whether to stay in the selection or not.
|
||||
## You can specify whether to chain iterate over edges that were
|
||||
## already visited or not.
|
||||
class pyChainSilhouetteGenericIterator(ChainingIterator):
|
||||
def __init__(self, stayInSelection=1, stayInUnvisited=1):
|
||||
ChainingIterator.__init__(self, stayInSelection, stayInUnvisited,None,1)
|
||||
def getExactTypeName(self):
|
||||
return "pyChainSilhouetteGenericIterator"
|
||||
def init(self):
|
||||
pass
|
||||
def traverse(self, iter):
|
||||
winner = None
|
||||
it = AdjacencyIterator(iter)
|
||||
nextVertex = self.getVertex()
|
||||
if(nextVertex.getNature() & Nature.T_VERTEX != 0):
|
||||
tvertex = nextVertex.castToTVertex()
|
||||
mateVE = tvertex.mate(self.getCurrentEdge())
|
||||
while(it.isEnd() == 0):
|
||||
ve = it.getObject()
|
||||
if(ve.getId() == mateVE.getId() ):
|
||||
winner = ve
|
||||
break
|
||||
it.increment()
|
||||
else:
|
||||
## case of NonTVertex
|
||||
natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
|
||||
for i in range(len(natures)):
|
||||
currentNature = self.getCurrentEdge().getNature()
|
||||
if(natures[i] & currentNature):
|
||||
count=0
|
||||
while(it.isEnd() == 0):
|
||||
visitNext = 0
|
||||
oNature = it.getObject().getNature()
|
||||
ve = it.getObject()
|
||||
if(ve.getId() == self.getCurrentEdge().getId()):
|
||||
it.increment()
|
||||
continue
|
||||
if(oNature & natures[i] != 0):
|
||||
if(natures[i] != oNature):
|
||||
for j in range(i):
|
||||
if(natures[j] & oNature != 0):
|
||||
visitNext = 1
|
||||
break
|
||||
if(visitNext != 0):
|
||||
break
|
||||
count = count+1
|
||||
winner = ve
|
||||
it.increment()
|
||||
if(count != 1):
|
||||
winner = None
|
||||
break
|
||||
return winner
|
||||
|
||||
class pyExternalContourChainingIterator(ChainingIterator):
|
||||
def __init__(self):
|
||||
ChainingIterator.__init__(self, 0, 1,None,1)
|
||||
self._isExternalContour = ExternalContourUP1D()
|
||||
|
||||
def getExactTypeName(self):
|
||||
return "pyExternalContourIterator"
|
||||
|
||||
def init(self):
|
||||
self._nEdges = 0
|
||||
self._isInSelection = 1
|
||||
|
||||
def checkViewEdge(self, ve, orientation):
|
||||
if(orientation != 0):
|
||||
vertex = ve.B()
|
||||
else:
|
||||
vertex = ve.A()
|
||||
it = AdjacencyIterator(vertex,1,1)
|
||||
while(it.isEnd() == 0):
|
||||
ave = it.getObject()
|
||||
if(self._isExternalContour(ave)):
|
||||
return 1
|
||||
it.increment()
|
||||
print "pyExternlContourChainingIterator : didn't find next edge"
|
||||
return 0
|
||||
def traverse(self, iter):
|
||||
winner = None
|
||||
it = AdjacencyIterator(iter)
|
||||
while(it.isEnd() == 0):
|
||||
ve = it.getObject()
|
||||
if(self._isExternalContour(ve)):
|
||||
if (ve.getTimeStamp() == GetTimeStampCF()):
|
||||
winner = ve
|
||||
it.increment()
|
||||
|
||||
self._nEdges = self._nEdges+1
|
||||
if(winner == None):
|
||||
orient = 1
|
||||
it = AdjacencyIterator(iter)
|
||||
while(it.isEnd() == 0):
|
||||
ve = it.getObject()
|
||||
if(it.isIncoming() != 0):
|
||||
orient = 0
|
||||
good = self.checkViewEdge(ve,orient)
|
||||
if(good != 0):
|
||||
winner = ve
|
||||
it.increment()
|
||||
return winner
|
||||
|
||||
## the natural chaining iterator
|
||||
## with a sketchy multiple touch
|
||||
class pySketchyChainSilhouetteIterator(ChainingIterator):
|
||||
def __init__(self, nRounds=3,stayInSelection=1):
|
||||
ChainingIterator.__init__(self, stayInSelection, 0,None,1)
|
||||
self._timeStamp = GetTimeStampCF()+nRounds
|
||||
self._nRounds = nRounds
|
||||
def getExactTypeName(self):
|
||||
return "pySketchyChainSilhouetteIterator"
|
||||
def init(self):
|
||||
self._timeStamp = GetTimeStampCF()+self._nRounds
|
||||
def traverse(self, iter):
|
||||
winner = None
|
||||
it = AdjacencyIterator(iter)
|
||||
nextVertex = self.getVertex()
|
||||
if(nextVertex.getNature() & Nature.T_VERTEX != 0):
|
||||
tvertex = nextVertex.castToTVertex()
|
||||
mateVE = tvertex.mate(self.getCurrentEdge())
|
||||
while(it.isEnd() == 0):
|
||||
ve = it.getObject()
|
||||
if(ve.getId() == mateVE.getId() ):
|
||||
winner = ve
|
||||
break
|
||||
it.increment()
|
||||
else:
|
||||
## case of NonTVertex
|
||||
natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
|
||||
for i in range(len(natures)):
|
||||
currentNature = self.getCurrentEdge().getNature()
|
||||
if(natures[i] & currentNature):
|
||||
count=0
|
||||
while(it.isEnd() == 0):
|
||||
visitNext = 0
|
||||
oNature = it.getObject().getNature()
|
||||
ve = it.getObject()
|
||||
if(ve.getId() == self.getCurrentEdge().getId()):
|
||||
it.increment()
|
||||
continue
|
||||
if(oNature & natures[i] != 0):
|
||||
if(natures[i] != oNature):
|
||||
for j in range(i):
|
||||
if(natures[j] & oNature != 0):
|
||||
visitNext = 1
|
||||
break
|
||||
if(visitNext != 0):
|
||||
break
|
||||
count = count+1
|
||||
winner = ve
|
||||
it.increment()
|
||||
if(count != 1):
|
||||
winner = None
|
||||
break
|
||||
if(winner == None):
|
||||
winner = self.getCurrentEdge()
|
||||
if(winner.getChainingTimeStamp() == self._timeStamp):
|
||||
winner = None
|
||||
return winner
|
||||
|
||||
|
||||
# Chaining iterator designed for sketchy style.
|
||||
# can chain several times the same ViewEdge
|
||||
# in order to produce multiple strokes per ViewEdge.
|
||||
class pySketchyChainingIterator(ChainingIterator):
|
||||
def __init__(self, nRounds=3, stayInSelection=1):
|
||||
ChainingIterator.__init__(self, stayInSelection, 0,None,1)
|
||||
self._timeStamp = GetTimeStampCF()+nRounds
|
||||
self._nRounds = nRounds
|
||||
def getExactTypeName(self):
|
||||
return "pySketchyChainingIterator"
|
||||
|
||||
def init(self):
|
||||
self._timeStamp = GetTimeStampCF()+self._nRounds
|
||||
|
||||
def traverse(self, iter):
|
||||
winner = None
|
||||
it = AdjacencyIterator(iter)
|
||||
while(it.isEnd() == 0):
|
||||
ve = it.getObject()
|
||||
if(ve.getId() == self.getCurrentEdge().getId()):
|
||||
it.increment()
|
||||
continue
|
||||
winner = ve
|
||||
it.increment()
|
||||
if(winner == None):
|
||||
winner = self.getCurrentEdge()
|
||||
if(winner.getChainingTimeStamp() == self._timeStamp):
|
||||
return None
|
||||
return winner
|
||||
|
||||
|
||||
## Chaining iterator that fills small occlusions
|
||||
## percent
|
||||
## The max length of the occluded part
|
||||
## expressed in % of the total chain length
|
||||
class pyFillOcclusionsRelativeChainingIterator(ChainingIterator):
|
||||
def __init__(self, percent):
|
||||
ChainingIterator.__init__(self, 0, 1,None,1)
|
||||
self._length = 0
|
||||
self._percent = float(percent)
|
||||
def getExactTypeName(self):
|
||||
return "pyFillOcclusionsChainingIterator"
|
||||
def init(self):
|
||||
# each time we're evaluating a chain length
|
||||
# we try to do it once. Thus we reinit
|
||||
# the chain length here:
|
||||
self._length = 0
|
||||
def traverse(self, iter):
|
||||
winner = None
|
||||
winnerOrientation = 0
|
||||
print self.getCurrentEdge().getId().getFirst(), self.getCurrentEdge().getId().getSecond()
|
||||
it = AdjacencyIterator(iter)
|
||||
nextVertex = self.getVertex()
|
||||
if(nextVertex.getNature() & Nature.T_VERTEX != 0):
|
||||
tvertex = nextVertex.castToTVertex()
|
||||
mateVE = tvertex.mate(self.getCurrentEdge())
|
||||
while(it.isEnd() == 0):
|
||||
ve = it.getObject()
|
||||
if(ve.getId() == mateVE.getId() ):
|
||||
winner = ve
|
||||
if(it.isIncoming() == 0):
|
||||
winnerOrientation = 1
|
||||
else:
|
||||
winnerOrientation = 0
|
||||
break
|
||||
it.increment()
|
||||
else:
|
||||
## case of NonTVertex
|
||||
natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
|
||||
for nat in natures:
|
||||
if(self.getCurrentEdge().getNature() & nat != 0):
|
||||
count=0
|
||||
while(it.isEnd() == 0):
|
||||
ve = it.getObject()
|
||||
if(ve.getNature() & nat != 0):
|
||||
count = count+1
|
||||
winner = ve
|
||||
if(it.isIncoming() == 0):
|
||||
winnerOrientation = 1
|
||||
else:
|
||||
winnerOrientation = 0
|
||||
it.increment()
|
||||
if(count != 1):
|
||||
winner = None
|
||||
break
|
||||
if(winner != None):
|
||||
# check whether this edge was part of the selection
|
||||
if(winner.getTimeStamp() != GetTimeStampCF()):
|
||||
#print "---", winner.getId().getFirst(), winner.getId().getSecond()
|
||||
# if not, let's check whether it's short enough with
|
||||
# respect to the chain made without staying in the selection
|
||||
#------------------------------------------------------------
|
||||
# Did we compute the prospective chain length already ?
|
||||
if(self._length == 0):
|
||||
#if not, let's do it
|
||||
_it = pyChainSilhouetteGenericIterator(0,0)
|
||||
_it.setBegin(winner)
|
||||
_it.setCurrentEdge(winner)
|
||||
_it.setOrientation(winnerOrientation)
|
||||
_it.init()
|
||||
while(_it.isEnd() == 0):
|
||||
ve = _it.getObject()
|
||||
#print "--------", ve.getId().getFirst(), ve.getId().getSecond()
|
||||
self._length = self._length + ve.getLength2D()
|
||||
_it.increment()
|
||||
if(_it.isBegin() != 0):
|
||||
break;
|
||||
_it.setBegin(winner)
|
||||
_it.setCurrentEdge(winner)
|
||||
_it.setOrientation(winnerOrientation)
|
||||
if(_it.isBegin() == 0):
|
||||
_it.decrement()
|
||||
while ((_it.isEnd() == 0) and (_it.isBegin() == 0)):
|
||||
ve = _it.getObject()
|
||||
#print "--------", ve.getId().getFirst(), ve.getId().getSecond()
|
||||
self._length = self._length + ve.getLength2D()
|
||||
_it.decrement()
|
||||
|
||||
# let's do the comparison:
|
||||
# nw let's compute the length of this connex non selected part:
|
||||
connexl = 0
|
||||
_cit = pyChainSilhouetteGenericIterator(0,0)
|
||||
_cit.setBegin(winner)
|
||||
_cit.setCurrentEdge(winner)
|
||||
_cit.setOrientation(winnerOrientation)
|
||||
_cit.init()
|
||||
while((_cit.isEnd() == 0) and (_cit.getObject().getTimeStamp() != GetTimeStampCF())):
|
||||
ve = _cit.getObject()
|
||||
#print "-------- --------", ve.getId().getFirst(), ve.getId().getSecond()
|
||||
connexl = connexl + ve.getLength2D()
|
||||
_cit.increment()
|
||||
if(connexl > self._percent * self._length):
|
||||
winner = None
|
||||
return winner
|
||||
|
||||
## Chaining iterator that fills small occlusions
|
||||
## size
|
||||
## The max length of the occluded part
|
||||
## expressed in pixels
|
||||
class pyFillOcclusionsAbsoluteChainingIterator(ChainingIterator):
|
||||
def __init__(self, length):
|
||||
ChainingIterator.__init__(self, 0, 1,None,1)
|
||||
self._length = float(length)
|
||||
def getExactTypeName(self):
|
||||
return "pySmallFillOcclusionsChainingIterator"
|
||||
def init(self):
|
||||
pass
|
||||
def traverse(self, iter):
|
||||
winner = None
|
||||
winnerOrientation = 0
|
||||
#print self.getCurrentEdge().getId().getFirst(), self.getCurrentEdge().getId().getSecond()
|
||||
it = AdjacencyIterator(iter)
|
||||
nextVertex = self.getVertex()
|
||||
if(nextVertex.getNature() & Nature.T_VERTEX != 0):
|
||||
tvertex = nextVertex.castToTVertex()
|
||||
mateVE = tvertex.mate(self.getCurrentEdge())
|
||||
while(it.isEnd() == 0):
|
||||
ve = it.getObject()
|
||||
if(ve.getId() == mateVE.getId() ):
|
||||
winner = ve
|
||||
if(it.isIncoming() == 0):
|
||||
winnerOrientation = 1
|
||||
else:
|
||||
winnerOrientation = 0
|
||||
break
|
||||
it.increment()
|
||||
else:
|
||||
## case of NonTVertex
|
||||
natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
|
||||
for nat in natures:
|
||||
if(self.getCurrentEdge().getNature() & nat != 0):
|
||||
count=0
|
||||
while(it.isEnd() == 0):
|
||||
ve = it.getObject()
|
||||
if(ve.getNature() & nat != 0):
|
||||
count = count+1
|
||||
winner = ve
|
||||
if(it.isIncoming() == 0):
|
||||
winnerOrientation = 1
|
||||
else:
|
||||
winnerOrientation = 0
|
||||
it.increment()
|
||||
if(count != 1):
|
||||
winner = None
|
||||
break
|
||||
if(winner != None):
|
||||
# check whether this edge was part of the selection
|
||||
if(winner.getTimeStamp() != GetTimeStampCF()):
|
||||
#print "---", winner.getId().getFirst(), winner.getId().getSecond()
|
||||
# nw let's compute the length of this connex non selected part:
|
||||
connexl = 0
|
||||
_cit = pyChainSilhouetteGenericIterator(0,0)
|
||||
_cit.setBegin(winner)
|
||||
_cit.setCurrentEdge(winner)
|
||||
_cit.setOrientation(winnerOrientation)
|
||||
_cit.init()
|
||||
while((_cit.isEnd() == 0) and (_cit.getObject().getTimeStamp() != GetTimeStampCF())):
|
||||
ve = _cit.getObject()
|
||||
#print "-------- --------", ve.getId().getFirst(), ve.getId().getSecond()
|
||||
connexl = connexl + ve.getLength2D()
|
||||
_cit.increment()
|
||||
if(connexl > self._length):
|
||||
winner = None
|
||||
return winner
|
||||
|
||||
|
||||
## Chaining iterator that fills small occlusions
|
||||
## percent
|
||||
## The max length of the occluded part
|
||||
## expressed in % of the total chain length
|
||||
class pyFillOcclusionsAbsoluteAndRelativeChainingIterator(ChainingIterator):
|
||||
def __init__(self, percent, l):
|
||||
ChainingIterator.__init__(self, 0, 1,None,1)
|
||||
self._length = 0
|
||||
self._absLength = l
|
||||
self._percent = float(percent)
|
||||
def getExactTypeName(self):
|
||||
return "pyFillOcclusionsChainingIterator"
|
||||
def init(self):
|
||||
# each time we're evaluating a chain length
|
||||
# we try to do it once. Thus we reinit
|
||||
# the chain length here:
|
||||
self._length = 0
|
||||
def traverse(self, iter):
|
||||
winner = None
|
||||
winnerOrientation = 0
|
||||
print self.getCurrentEdge().getId().getFirst(), self.getCurrentEdge().getId().getSecond()
|
||||
it = AdjacencyIterator(iter)
|
||||
nextVertex = self.getVertex()
|
||||
if(nextVertex.getNature() & Nature.T_VERTEX != 0):
|
||||
tvertex = nextVertex.castToTVertex()
|
||||
mateVE = tvertex.mate(self.getCurrentEdge())
|
||||
while(it.isEnd() == 0):
|
||||
ve = it.getObject()
|
||||
if(ve.getId() == mateVE.getId() ):
|
||||
winner = ve
|
||||
if(it.isIncoming() == 0):
|
||||
winnerOrientation = 1
|
||||
else:
|
||||
winnerOrientation = 0
|
||||
break
|
||||
it.increment()
|
||||
else:
|
||||
## case of NonTVertex
|
||||
natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
|
||||
for nat in natures:
|
||||
if(self.getCurrentEdge().getNature() & nat != 0):
|
||||
count=0
|
||||
while(it.isEnd() == 0):
|
||||
ve = it.getObject()
|
||||
if(ve.getNature() & nat != 0):
|
||||
count = count+1
|
||||
winner = ve
|
||||
if(it.isIncoming() == 0):
|
||||
winnerOrientation = 1
|
||||
else:
|
||||
winnerOrientation = 0
|
||||
it.increment()
|
||||
if(count != 1):
|
||||
winner = None
|
||||
break
|
||||
if(winner != None):
|
||||
# check whether this edge was part of the selection
|
||||
if(winner.getTimeStamp() != GetTimeStampCF()):
|
||||
#print "---", winner.getId().getFirst(), winner.getId().getSecond()
|
||||
# if not, let's check whether it's short enough with
|
||||
# respect to the chain made without staying in the selection
|
||||
#------------------------------------------------------------
|
||||
# Did we compute the prospective chain length already ?
|
||||
if(self._length == 0):
|
||||
#if not, let's do it
|
||||
_it = pyChainSilhouetteGenericIterator(0,0)
|
||||
_it.setBegin(winner)
|
||||
_it.setCurrentEdge(winner)
|
||||
_it.setOrientation(winnerOrientation)
|
||||
_it.init()
|
||||
while(_it.isEnd() == 0):
|
||||
ve = _it.getObject()
|
||||
#print "--------", ve.getId().getFirst(), ve.getId().getSecond()
|
||||
self._length = self._length + ve.getLength2D()
|
||||
_it.increment()
|
||||
if(_it.isBegin() != 0):
|
||||
break;
|
||||
_it.setBegin(winner)
|
||||
_it.setCurrentEdge(winner)
|
||||
_it.setOrientation(winnerOrientation)
|
||||
if(_it.isBegin() == 0):
|
||||
_it.decrement()
|
||||
while ((_it.isEnd() == 0) and (_it.isBegin() == 0)):
|
||||
ve = _it.getObject()
|
||||
#print "--------", ve.getId().getFirst(), ve.getId().getSecond()
|
||||
self._length = self._length + ve.getLength2D()
|
||||
_it.decrement()
|
||||
|
||||
# let's do the comparison:
|
||||
# nw let's compute the length of this connex non selected part:
|
||||
connexl = 0
|
||||
_cit = pyChainSilhouetteGenericIterator(0,0)
|
||||
_cit.setBegin(winner)
|
||||
_cit.setCurrentEdge(winner)
|
||||
_cit.setOrientation(winnerOrientation)
|
||||
_cit.init()
|
||||
while((_cit.isEnd() == 0) and (_cit.getObject().getTimeStamp() != GetTimeStampCF())):
|
||||
ve = _cit.getObject()
|
||||
#print "-------- --------", ve.getId().getFirst(), ve.getId().getSecond()
|
||||
connexl = connexl + ve.getLength2D()
|
||||
_cit.increment()
|
||||
if((connexl > self._percent * self._length) or (connexl > self._absLength)):
|
||||
winner = None
|
||||
return winner
|
||||
|
||||
## Chaining iterator that fills small occlusions without caring about the
|
||||
## actual selection
|
||||
## percent
|
||||
## The max length of the occluded part
|
||||
## expressed in % of the total chain length
|
||||
class pyFillQi0AbsoluteAndRelativeChainingIterator(ChainingIterator):
|
||||
def __init__(self, percent, l):
|
||||
ChainingIterator.__init__(self, 0, 1,None,1)
|
||||
self._length = 0
|
||||
self._absLength = l
|
||||
self._percent = float(percent)
|
||||
def getExactTypeName(self):
|
||||
return "pyFillOcclusionsChainingIterator"
|
||||
def init(self):
|
||||
# each time we're evaluating a chain length
|
||||
# we try to do it once. Thus we reinit
|
||||
# the chain length here:
|
||||
self._length = 0
|
||||
def traverse(self, iter):
|
||||
winner = None
|
||||
winnerOrientation = 0
|
||||
print self.getCurrentEdge().getId().getFirst(), self.getCurrentEdge().getId().getSecond()
|
||||
it = AdjacencyIterator(iter)
|
||||
nextVertex = self.getVertex()
|
||||
if(nextVertex.getNature() & Nature.T_VERTEX != 0):
|
||||
tvertex = nextVertex.castToTVertex()
|
||||
mateVE = tvertex.mate(self.getCurrentEdge())
|
||||
while(it.isEnd() == 0):
|
||||
ve = it.getObject()
|
||||
if(ve.getId() == mateVE.getId() ):
|
||||
winner = ve
|
||||
if(it.isIncoming() == 0):
|
||||
winnerOrientation = 1
|
||||
else:
|
||||
winnerOrientation = 0
|
||||
break
|
||||
it.increment()
|
||||
else:
|
||||
## case of NonTVertex
|
||||
natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
|
||||
for nat in natures:
|
||||
if(self.getCurrentEdge().getNature() & nat != 0):
|
||||
count=0
|
||||
while(it.isEnd() == 0):
|
||||
ve = it.getObject()
|
||||
if(ve.getNature() & nat != 0):
|
||||
count = count+1
|
||||
winner = ve
|
||||
if(it.isIncoming() == 0):
|
||||
winnerOrientation = 1
|
||||
else:
|
||||
winnerOrientation = 0
|
||||
it.increment()
|
||||
if(count != 1):
|
||||
winner = None
|
||||
break
|
||||
if(winner != None):
|
||||
# check whether this edge was part of the selection
|
||||
if(winner.qi() != 0):
|
||||
#print "---", winner.getId().getFirst(), winner.getId().getSecond()
|
||||
# if not, let's check whether it's short enough with
|
||||
# respect to the chain made without staying in the selection
|
||||
#------------------------------------------------------------
|
||||
# Did we compute the prospective chain length already ?
|
||||
if(self._length == 0):
|
||||
#if not, let's do it
|
||||
_it = pyChainSilhouetteGenericIterator(0,0)
|
||||
_it.setBegin(winner)
|
||||
_it.setCurrentEdge(winner)
|
||||
_it.setOrientation(winnerOrientation)
|
||||
_it.init()
|
||||
while(_it.isEnd() == 0):
|
||||
ve = _it.getObject()
|
||||
#print "--------", ve.getId().getFirst(), ve.getId().getSecond()
|
||||
self._length = self._length + ve.getLength2D()
|
||||
_it.increment()
|
||||
if(_it.isBegin() != 0):
|
||||
break;
|
||||
_it.setBegin(winner)
|
||||
_it.setCurrentEdge(winner)
|
||||
_it.setOrientation(winnerOrientation)
|
||||
if(_it.isBegin() == 0):
|
||||
_it.decrement()
|
||||
while ((_it.isEnd() == 0) and (_it.isBegin() == 0)):
|
||||
ve = _it.getObject()
|
||||
#print "--------", ve.getId().getFirst(), ve.getId().getSecond()
|
||||
self._length = self._length + ve.getLength2D()
|
||||
_it.decrement()
|
||||
|
||||
# let's do the comparison:
|
||||
# nw let's compute the length of this connex non selected part:
|
||||
connexl = 0
|
||||
_cit = pyChainSilhouetteGenericIterator(0,0)
|
||||
_cit.setBegin(winner)
|
||||
_cit.setCurrentEdge(winner)
|
||||
_cit.setOrientation(winnerOrientation)
|
||||
_cit.init()
|
||||
while((_cit.isEnd() == 0) and (_cit.getObject().qi() != 0)):
|
||||
ve = _cit.getObject()
|
||||
#print "-------- --------", ve.getId().getFirst(), ve.getId().getSecond()
|
||||
connexl = connexl + ve.getLength2D()
|
||||
_cit.increment()
|
||||
if((connexl > self._percent * self._length) or (connexl > self._absLength)):
|
||||
winner = None
|
||||
return winner
|
||||
|
||||
|
||||
## the natural chaining iterator
|
||||
## It follows the edges of same nature on the same
|
||||
## objects with preseance on silhouettes, then borders,
|
||||
## then suggestive contours, then everything else. It doesn't chain the same ViewEdge twice
|
||||
## You can specify whether to stay in the selection or not.
|
||||
class pyNoIdChainSilhouetteIterator(ChainingIterator):
|
||||
def __init__(self, stayInSelection=1):
|
||||
ChainingIterator.__init__(self, stayInSelection, 1,None,1)
|
||||
def getExactTypeName(self):
|
||||
return "pyChainSilhouetteIterator"
|
||||
def init(self):
|
||||
pass
|
||||
def traverse(self, iter):
|
||||
winner = None
|
||||
it = AdjacencyIterator(iter)
|
||||
nextVertex = self.getVertex()
|
||||
if(nextVertex.getNature() & Nature.T_VERTEX != 0):
|
||||
tvertex = nextVertex.castToTVertex()
|
||||
mateVE = tvertex.mate(self.getCurrentEdge())
|
||||
while(it.isEnd() == 0):
|
||||
ve = it.getObject()
|
||||
feB = self.getCurrentEdge().fedgeB()
|
||||
feA = ve.fedgeA()
|
||||
vB = feB.vertexB()
|
||||
vA = feA.vertexA()
|
||||
if vA.getId().getFirst() == vB.getId().getFirst():
|
||||
winner = ve
|
||||
break
|
||||
feA = self.getCurrentEdge().fedgeA()
|
||||
feB = ve.fedgeB()
|
||||
vB = feB.vertexB()
|
||||
vA = feA.vertexA()
|
||||
if vA.getId().getFirst() == vB.getId().getFirst():
|
||||
winner = ve
|
||||
break
|
||||
feA = self.getCurrentEdge().fedgeB()
|
||||
feB = ve.fedgeB()
|
||||
vB = feB.vertexB()
|
||||
vA = feA.vertexB()
|
||||
if vA.getId().getFirst() == vB.getId().getFirst():
|
||||
winner = ve
|
||||
break
|
||||
feA = self.getCurrentEdge().fedgeA()
|
||||
feB = ve.fedgeA()
|
||||
vB = feB.vertexA()
|
||||
vA = feA.vertexA()
|
||||
if vA.getId().getFirst() == vB.getId().getFirst():
|
||||
winner = ve
|
||||
break
|
||||
it.increment()
|
||||
else:
|
||||
## case of NonTVertex
|
||||
natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
|
||||
for i in range(len(natures)):
|
||||
currentNature = self.getCurrentEdge().getNature()
|
||||
if(natures[i] & currentNature):
|
||||
count=0
|
||||
while(it.isEnd() == 0):
|
||||
visitNext = 0
|
||||
oNature = it.getObject().getNature()
|
||||
if(oNature & natures[i] != 0):
|
||||
if(natures[i] != oNature):
|
||||
for j in range(i):
|
||||
if(natures[j] & oNature != 0):
|
||||
visitNext = 1
|
||||
break
|
||||
if(visitNext != 0):
|
||||
break
|
||||
count = count+1
|
||||
winner = it.getObject()
|
||||
it.increment()
|
||||
if(count != 1):
|
||||
winner = None
|
||||
break
|
||||
return winner
|
||||
|
@ -1,81 +0,0 @@
|
||||
from freestyle_init import *
|
||||
|
||||
|
||||
class pyInverseCurvature2DAngleF0D(UnaryFunction0DDouble):
|
||||
def getName(self):
|
||||
return "InverseCurvature2DAngleF0D"
|
||||
|
||||
def __call__(self, inter):
|
||||
func = Curvature2DAngleF0D()
|
||||
c = func(inter)
|
||||
return (3.1415 - c)
|
||||
|
||||
class pyCurvilinearLengthF0D(UnaryFunction0DDouble):
|
||||
def getName(self):
|
||||
return "CurvilinearLengthF0D"
|
||||
|
||||
def __call__(self, inter):
|
||||
i0d = inter.getObject()
|
||||
s = i0d.getExactTypeName()
|
||||
if (string.find(s, "CurvePoint") == -1):
|
||||
print "CurvilinearLengthF0D: not implemented yet for %s" % (s)
|
||||
return -1
|
||||
cp = castToCurvePoint(i0d)
|
||||
return cp.t2d()
|
||||
|
||||
## estimate anisotropy of density
|
||||
class pyDensityAnisotropyF0D(UnaryFunction0DDouble):
|
||||
def __init__(self,level):
|
||||
UnaryFunction0DDouble.__init__(self)
|
||||
self.IsoDensity = ReadCompleteViewMapPixelF0D(level)
|
||||
self.d0Density = ReadSteerableViewMapPixelF0D(0, level)
|
||||
self.d1Density = ReadSteerableViewMapPixelF0D(1, level)
|
||||
self.d2Density = ReadSteerableViewMapPixelF0D(2, level)
|
||||
self.d3Density = ReadSteerableViewMapPixelF0D(3, level)
|
||||
def getName(self):
|
||||
return "pyDensityAnisotropyF0D"
|
||||
def __call__(self, inter):
|
||||
c_iso = self.IsoDensity(inter)
|
||||
c_0 = self.d0Density(inter)
|
||||
c_1 = self.d1Density(inter)
|
||||
c_2 = self.d2Density(inter)
|
||||
c_3 = self.d3Density(inter)
|
||||
cMax = max( max(c_0,c_1), max(c_2,c_3))
|
||||
cMin = min( min(c_0,c_1), min(c_2,c_3))
|
||||
if ( c_iso == 0 ):
|
||||
v = 0
|
||||
else:
|
||||
v = (cMax-cMin)/c_iso
|
||||
return (v)
|
||||
|
||||
## Returns the gradient vector for a pixel
|
||||
## l
|
||||
## the level at which one wants to compute the gradient
|
||||
class pyViewMapGradientVectorF0D(UnaryFunction0DVec2f):
|
||||
def __init__(self, l):
|
||||
UnaryFunction0DVec2f.__init__(self)
|
||||
self._l = l
|
||||
self._step = pow(2,self._l)
|
||||
def getName(self):
|
||||
return "pyViewMapGradientVectorF0D"
|
||||
def __call__(self, iter):
|
||||
p = iter.getObject().getPoint2D()
|
||||
gx = ReadCompleteViewMapPixelCF(self._l, int(p.x()+self._step), int(p.y()))- ReadCompleteViewMapPixelCF(self._l, int(p.x()), int(p.y()))
|
||||
gy = ReadCompleteViewMapPixelCF(self._l, int(p.x()), int(p.y()+self._step))- ReadCompleteViewMapPixelCF(self._l, int(p.x()), int(p.y()))
|
||||
return Vec2f(gx, gy)
|
||||
|
||||
class pyViewMapGradientNormF0D(UnaryFunction0DDouble):
|
||||
def __init__(self, l):
|
||||
UnaryFunction0DDouble.__init__(self)
|
||||
self._l = l
|
||||
self._step = pow(2,self._l)
|
||||
def getName(self):
|
||||
return "pyViewMapGradientNormF0D"
|
||||
def __call__(self, iter):
|
||||
p = iter.getObject().getPoint2D()
|
||||
gx = ReadCompleteViewMapPixelCF(self._l, int(p.x()+self._step), int(p.y()))- ReadCompleteViewMapPixelCF(self._l, int(p.x()), int(p.y()))
|
||||
gy = ReadCompleteViewMapPixelCF(self._l, int(p.x()), int(p.y()+self._step))- ReadCompleteViewMapPixelCF(self._l, int(p.x()), int(p.y()))
|
||||
grad = Vec2f(gx, gy)
|
||||
return grad.norm()
|
||||
|
||||
|
@ -1,45 +0,0 @@
|
||||
from freestyle_init import *
|
||||
from Functions0D import *
|
||||
import string
|
||||
|
||||
class pyGetInverseProjectedZF1D(UnaryFunction1DDouble):
|
||||
def getName(self):
|
||||
return "pyGetInverseProjectedZF1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
func = GetProjectedZF1D()
|
||||
z = func(inter)
|
||||
return (1.0 - z)
|
||||
|
||||
class pyGetSquareInverseProjectedZF1D(UnaryFunction1DDouble):
|
||||
def getName(self):
|
||||
return "pyGetInverseProjectedZF1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
func = GetProjectedZF1D()
|
||||
z = func(inter)
|
||||
return (1.0 - z*z)
|
||||
|
||||
class pyDensityAnisotropyF1D(UnaryFunction1DDouble):
|
||||
def __init__(self,level, integrationType=IntegrationType.MEAN, sampling=2.0):
|
||||
UnaryFunction1DDouble.__init__(self, integrationType)
|
||||
self._func = pyDensityAnisotropyF0D(level)
|
||||
self._integration = integrationType
|
||||
self._sampling = sampling
|
||||
def getName(self):
|
||||
return "pyDensityAnisotropyF1D"
|
||||
def __call__(self, inter):
|
||||
v = integrateDouble(self._func, inter.pointsBegin(self._sampling), inter.pointsEnd(self._sampling), self._integration)
|
||||
return v
|
||||
|
||||
class pyViewMapGradientNormF1D(UnaryFunction1DDouble):
|
||||
def __init__(self,l, integrationType, sampling=2.0):
|
||||
UnaryFunction1DDouble.__init__(self, integrationType)
|
||||
self._func = pyViewMapGradientNormF0D(l)
|
||||
self._integration = integrationType
|
||||
self._sampling = sampling
|
||||
def getName(self):
|
||||
return "pyViewMapGradientNormF1D"
|
||||
def __call__(self, inter):
|
||||
v = integrateDouble(self._func, inter.pointsBegin(self._sampling), inter.pointsEnd(self._sampling), self._integration)
|
||||
return v
|
@ -1,70 +0,0 @@
|
||||
from freestyle_init import *
|
||||
from Functions1D import *
|
||||
from random import *
|
||||
|
||||
class pyZBP1D(BinaryPredicate1D):
|
||||
def getName(self):
|
||||
return "pyZBP1D"
|
||||
|
||||
def __call__(self, i1, i2):
|
||||
func = GetZF1D()
|
||||
return (func(i1) > func(i2))
|
||||
|
||||
class pyZDiscontinuityBP1D(BinaryPredicate1D):
|
||||
def __init__(self, iType = IntegrationType.MEAN):
|
||||
BinaryPredicate1D.__init__(self)
|
||||
self._GetZDiscontinuity = ZDiscontinuityF1D(iType)
|
||||
|
||||
def getName(self):
|
||||
return "pyZDiscontinuityBP1D"
|
||||
|
||||
def __call__(self, i1, i2):
|
||||
return (self._GetZDiscontinuity(i1) > self._GetZDiscontinuity(i2))
|
||||
|
||||
class pyLengthBP1D(BinaryPredicate1D):
|
||||
def getName(self):
|
||||
return "LengthBP1D"
|
||||
|
||||
def __call__(self, i1, i2):
|
||||
return (i1.getLength2D() > i2.getLength2D())
|
||||
|
||||
class pySilhouetteFirstBP1D(BinaryPredicate1D):
|
||||
def getName(self):
|
||||
return "SilhouetteFirstBP1D"
|
||||
|
||||
def __call__(self, inter1, inter2):
|
||||
bpred = SameShapeIdBP1D()
|
||||
if (bpred(inter1, inter2) != 1):
|
||||
return 0
|
||||
if (inter1.getNature() & Nature.SILHOUETTE):
|
||||
return (inter2.getNature() & Nature.SILHOUETTE)
|
||||
return (inter1.getNature() == inter2.getNature())
|
||||
|
||||
class pyNatureBP1D(BinaryPredicate1D):
|
||||
def getName(self):
|
||||
return "NatureBP1D"
|
||||
|
||||
def __call__(self, inter1, inter2):
|
||||
return (inter1.getNature() & inter2.getNature())
|
||||
|
||||
class pyViewMapGradientNormBP1D(BinaryPredicate1D):
|
||||
def __init__(self,l, sampling=2.0):
|
||||
BinaryPredicate1D.__init__(self)
|
||||
self._GetGradient = pyViewMapGradientNormF1D(l, IntegrationType.MEAN)
|
||||
def getName(self):
|
||||
return "pyViewMapGradientNormBP1D"
|
||||
def __call__(self, i1,i2):
|
||||
print "compare gradient"
|
||||
return (self._GetGradient(i1) > self._GetGradient(i2))
|
||||
|
||||
class pyShuffleBP1D(BinaryPredicate1D):
|
||||
def __init__(self):
|
||||
BinaryPredicate1D.__init__(self)
|
||||
seed(1)
|
||||
def getName(self):
|
||||
return "pyNearAndContourFirstBP1D"
|
||||
|
||||
def __call__(self, inter1, inter2):
|
||||
r1 = uniform(0,1)
|
||||
r2 = uniform(0,1)
|
||||
return (r1<r2)
|
@ -1,103 +0,0 @@
|
||||
from freestyle_init import *
|
||||
from Functions0D import *
|
||||
|
||||
class pyHigherCurvature2DAngleUP0D(UnaryPredicate0D):
|
||||
def __init__(self,a):
|
||||
UnaryPredicate0D.__init__(self)
|
||||
self._a = a
|
||||
|
||||
def getName(self):
|
||||
return "HigherCurvature2DAngleUP0D"
|
||||
|
||||
def __call__(self, inter):
|
||||
func = Curvature2DAngleF0D()
|
||||
a = func(inter)
|
||||
return ( a > self._a)
|
||||
|
||||
class pyUEqualsUP0D(UnaryPredicate0D):
|
||||
def __init__(self,u, w):
|
||||
UnaryPredicate0D.__init__(self)
|
||||
self._u = u
|
||||
self._w = w
|
||||
|
||||
def getName(self):
|
||||
return "UEqualsUP0D"
|
||||
|
||||
def __call__(self, inter):
|
||||
func = pyCurvilinearLengthF0D()
|
||||
u = func(inter)
|
||||
return ( ( u > (self._u-self._w) ) and ( u < (self._u+self._w) ) )
|
||||
|
||||
class pyVertexNatureUP0D(UnaryPredicate0D):
|
||||
def __init__(self,nature):
|
||||
UnaryPredicate0D.__init__(self)
|
||||
self._nature = nature
|
||||
|
||||
def getName(self):
|
||||
return "pyVertexNatureUP0D"
|
||||
|
||||
def __call__(self, inter):
|
||||
v = inter.getObject()
|
||||
nat = v.getNature()
|
||||
if(nat & self._nature):
|
||||
return 1;
|
||||
return 0
|
||||
|
||||
## check whether an Interface0DIterator
|
||||
## is a TVertex and is the one that is
|
||||
## hidden (inferred from the context)
|
||||
class pyBackTVertexUP0D(UnaryPredicate0D):
|
||||
def __init__(self):
|
||||
UnaryPredicate0D.__init__(self)
|
||||
self._getQI = QuantitativeInvisibilityF0D()
|
||||
def getName(self):
|
||||
return "pyBackTVertexUP0D"
|
||||
def __call__(self, iter):
|
||||
v = iter.getObject()
|
||||
nat = v.getNature()
|
||||
if(nat & Nature.T_VERTEX == 0):
|
||||
return 0
|
||||
next = iter
|
||||
if(next.isEnd()):
|
||||
return 0
|
||||
if(self._getQI(next) != 0):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
class pyParameterUP0DGoodOne(UnaryPredicate0D):
|
||||
def __init__(self,pmin,pmax):
|
||||
UnaryPredicate0D.__init__(self)
|
||||
self._m = pmin
|
||||
self._M = pmax
|
||||
#self.getCurvilinearAbscissa = GetCurvilinearAbscissaF0D()
|
||||
|
||||
def getName(self):
|
||||
return "pyCurvilinearAbscissaHigherThanUP0D"
|
||||
|
||||
def __call__(self, inter):
|
||||
#s = self.getCurvilinearAbscissa(inter)
|
||||
u = inter.u()
|
||||
#print u
|
||||
return ((u>=self._m) and (u<=self._M))
|
||||
|
||||
class pyParameterUP0D(UnaryPredicate0D):
|
||||
def __init__(self,pmin,pmax):
|
||||
UnaryPredicate0D.__init__(self)
|
||||
self._m = pmin
|
||||
self._M = pmax
|
||||
#self.getCurvilinearAbscissa = GetCurvilinearAbscissaF0D()
|
||||
|
||||
def getName(self):
|
||||
return "pyCurvilinearAbscissaHigherThanUP0D"
|
||||
|
||||
def __call__(self, inter):
|
||||
func = Curvature2DAngleF0D()
|
||||
c = func(inter)
|
||||
b1 = (c>0.1)
|
||||
#s = self.getCurvilinearAbscissa(inter)
|
||||
u = inter.u()
|
||||
#print u
|
||||
b = ((u>=self._m) and (u<=self._M))
|
||||
return b and b1
|
||||
|
||||
|
@ -1,381 +0,0 @@
|
||||
from freestyle_init import *
|
||||
from Functions1D import *
|
||||
|
||||
count = 0
|
||||
class pyNFirstUP1D(UnaryPredicate1D):
|
||||
def __init__(self, n):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self.__n = n
|
||||
def __call__(self, inter):
|
||||
global count
|
||||
count = count + 1
|
||||
if count <= self.__n:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
class pyHigherLengthUP1D(UnaryPredicate1D):
|
||||
def __init__(self,l):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._l = l
|
||||
|
||||
def getName(self):
|
||||
return "HigherLengthUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
return (inter.getLength2D() > self._l)
|
||||
|
||||
class pyNatureUP1D(UnaryPredicate1D):
|
||||
def __init__(self,nature):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._nature = nature
|
||||
self._getNature = CurveNatureF1D()
|
||||
|
||||
def getName(self):
|
||||
return "pyNatureUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
if(self._getNature(inter) & self._nature):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
class pyHigherNumberOfTurnsUP1D(UnaryPredicate1D):
|
||||
def __init__(self,n,a):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._n = n
|
||||
self._a = a
|
||||
|
||||
def getName(self):
|
||||
return "HigherNumberOfTurnsUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
count = 0
|
||||
func = Curvature2DAngleF0D()
|
||||
it = inter.verticesBegin()
|
||||
while(it.isEnd() == 0):
|
||||
if(func(it) > self._a):
|
||||
count = count+1
|
||||
if(count > self._n):
|
||||
return 1
|
||||
it.increment()
|
||||
return 0
|
||||
|
||||
class pyDensityUP1D(UnaryPredicate1D):
|
||||
def __init__(self,wsize,threshold, integration = IntegrationType.MEAN, sampling=2.0):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._wsize = wsize
|
||||
self._threshold = threshold
|
||||
self._integration = integration
|
||||
self._func = DensityF1D(self._wsize, self._integration, sampling)
|
||||
|
||||
def getName(self):
|
||||
return "pyDensityUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
if(self._func(inter) < self._threshold):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
class pyLowSteerableViewMapDensityUP1D(UnaryPredicate1D):
|
||||
def __init__(self,threshold, level,integration = IntegrationType.MEAN):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._threshold = threshold
|
||||
self._level = level
|
||||
self._integration = integration
|
||||
|
||||
def getName(self):
|
||||
return "pyLowSteerableViewMapDensityUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
func = GetSteerableViewMapDensityF1D(self._level, self._integration)
|
||||
v = func(inter)
|
||||
print v
|
||||
if(v < self._threshold):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
class pyLowDirectionalViewMapDensityUP1D(UnaryPredicate1D):
|
||||
def __init__(self,threshold, orientation, level,integration = IntegrationType.MEAN):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._threshold = threshold
|
||||
self._orientation = orientation
|
||||
self._level = level
|
||||
self._integration = integration
|
||||
|
||||
def getName(self):
|
||||
return "pyLowDirectionalViewMapDensityUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
func = GetDirectionalViewMapDensityF1D(self._orientation, self._level, self._integration)
|
||||
v = func(inter)
|
||||
#print v
|
||||
if(v < self._threshold):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
class pyHighSteerableViewMapDensityUP1D(UnaryPredicate1D):
|
||||
def __init__(self,threshold, level,integration = IntegrationType.MEAN):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._threshold = threshold
|
||||
self._level = level
|
||||
self._integration = integration
|
||||
self._func = GetSteerableViewMapDensityF1D(self._level, self._integration)
|
||||
def getName(self):
|
||||
return "pyHighSteerableViewMapDensityUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
|
||||
v = self._func(inter)
|
||||
if(v > self._threshold):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
class pyHighDirectionalViewMapDensityUP1D(UnaryPredicate1D):
|
||||
def __init__(self,threshold, orientation, level,integration = IntegrationType.MEAN, sampling=2.0):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._threshold = threshold
|
||||
self._orientation = orientation
|
||||
self._level = level
|
||||
self._integration = integration
|
||||
self._sampling = sampling
|
||||
def getName(self):
|
||||
return "pyLowDirectionalViewMapDensityUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
func = GetDirectionalViewMapDensityF1D(self._orientation, self._level, self._integration, self._sampling)
|
||||
v = func(inter)
|
||||
if(v > self._threshold):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
class pyHighViewMapDensityUP1D(UnaryPredicate1D):
|
||||
def __init__(self,threshold, level,integration = IntegrationType.MEAN, sampling=2.0):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._threshold = threshold
|
||||
self._level = level
|
||||
self._integration = integration
|
||||
self._sampling = sampling
|
||||
self._func = GetCompleteViewMapDensityF1D(self._level, self._integration, self._sampling) # 2.0 is the smpling
|
||||
|
||||
def getName(self):
|
||||
return "pyHighViewMapDensityUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
#print "toto"
|
||||
#print func.getName()
|
||||
#print inter.getExactTypeName()
|
||||
v= self._func(inter)
|
||||
if(v > self._threshold):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
class pyDensityFunctorUP1D(UnaryPredicate1D):
|
||||
def __init__(self,wsize,threshold, functor, funcmin=0.0, funcmax=1.0, integration = IntegrationType.MEAN):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._wsize = wsize
|
||||
self._threshold = float(threshold)
|
||||
self._functor = functor
|
||||
self._funcmin = float(funcmin)
|
||||
self._funcmax = float(funcmax)
|
||||
self._integration = integration
|
||||
|
||||
def getName(self):
|
||||
return "pyDensityFunctorUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
func = DensityF1D(self._wsize, self._integration)
|
||||
res = self._functor(inter)
|
||||
k = (res-self._funcmin)/(self._funcmax-self._funcmin)
|
||||
if(func(inter) < self._threshold*k):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
class pyZSmallerUP1D(UnaryPredicate1D):
|
||||
def __init__(self,z, integration=IntegrationType.MEAN):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._z = z
|
||||
self._integration = integration
|
||||
def getName(self):
|
||||
return "pyZSmallerUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
func = GetProjectedZF1D(self._integration)
|
||||
if(func(inter) < self._z):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
class pyIsOccludedByUP1D(UnaryPredicate1D):
|
||||
def __init__(self,id):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._id = id
|
||||
def getName(self):
|
||||
return "pyIsOccludedByUP1D"
|
||||
def __call__(self, inter):
|
||||
func = GetShapeF1D()
|
||||
shapes = func(inter)
|
||||
for s in shapes:
|
||||
if(s.getId() == self._id):
|
||||
return 0
|
||||
it = inter.verticesBegin()
|
||||
itlast = inter.verticesEnd()
|
||||
itlast.decrement()
|
||||
v = it.getObject()
|
||||
vlast = itlast.getObject()
|
||||
tvertex = v.castToTVertex()
|
||||
if(tvertex != None):
|
||||
#print "TVertex: [ ", tvertex.getId().getFirst(), ",", tvertex.getId().getSecond()," ]"
|
||||
eit = tvertex.edgesBegin()
|
||||
while(eit.isEnd() == 0):
|
||||
ve = eit.getObject().first
|
||||
if(ve.shape_id() == self._id):
|
||||
return 1
|
||||
#print "-------", ve.getId().getFirst(), "-", ve.getId().getSecond()
|
||||
eit.increment()
|
||||
tvertex = vlast.castToTVertex()
|
||||
if(tvertex != None):
|
||||
#print "TVertex: [ ", tvertex.getId().getFirst(), ",", tvertex.getId().getSecond()," ]"
|
||||
eit = tvertex.edgesBegin()
|
||||
while(eit.isEnd() == 0):
|
||||
ve = eit.getObject().first
|
||||
if(ve.shape_id() == self._id):
|
||||
return 1
|
||||
#print "-------", ve.getId().getFirst(), "-", ve.getId().getSecond()
|
||||
eit.increment()
|
||||
return 0
|
||||
|
||||
class pyIsInOccludersListUP1D(UnaryPredicate1D):
|
||||
def __init__(self,id):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._id = id
|
||||
def getName(self):
|
||||
return "pyIsInOccludersListUP1D"
|
||||
def __call__(self, inter):
|
||||
func = GetOccludersF1D()
|
||||
occluders = func(inter)
|
||||
for a in occluders:
|
||||
if(a.getId() == self._id):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
class pyIsOccludedByItselfUP1D(UnaryPredicate1D):
|
||||
def __init__(self):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self.__func1 = GetOccludersF1D()
|
||||
self.__func2 = GetShapeF1D()
|
||||
def getName(self):
|
||||
return "pyIsOccludedByItselfUP1D"
|
||||
def __call__(self, inter):
|
||||
lst1 = self.__func1(inter)
|
||||
lst2 = self.__func2(inter)
|
||||
for vs1 in lst1:
|
||||
for vs2 in lst2:
|
||||
if vs1.getId() == vs2.getId():
|
||||
return 1
|
||||
return 0
|
||||
|
||||
class pyIsOccludedByIdListUP1D(UnaryPredicate1D):
|
||||
def __init__(self, idlist):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._idlist = idlist
|
||||
self.__func1 = GetOccludersF1D()
|
||||
def getName(self):
|
||||
return "pyIsOccludedByIdListUP1D"
|
||||
def __call__(self, inter):
|
||||
lst1 = self.__func1(inter)
|
||||
for vs1 in lst1:
|
||||
for id in self._idlist:
|
||||
if vs1.getId() == id:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
class pyShapeIdListUP1D(UnaryPredicate1D):
|
||||
def __init__(self,idlist):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._idlist = idlist
|
||||
self._funcs = []
|
||||
for id in idlist :
|
||||
self._funcs.append(ShapeUP1D(id.getFirst(), id.getSecond()))
|
||||
|
||||
def getName(self):
|
||||
return "pyShapeIdUP1D"
|
||||
def __call__(self, inter):
|
||||
for func in self._funcs :
|
||||
if(func(inter) == 1) :
|
||||
return 1
|
||||
return 0
|
||||
|
||||
## deprecated
|
||||
class pyShapeIdUP1D(UnaryPredicate1D):
|
||||
def __init__(self,id):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._id = id
|
||||
def getName(self):
|
||||
return "pyShapeIdUP1D"
|
||||
def __call__(self, inter):
|
||||
func = GetShapeF1D()
|
||||
shapes = func(inter)
|
||||
for a in shapes:
|
||||
if(a.getId() == self._id):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
class pyHighDensityAnisotropyUP1D(UnaryPredicate1D):
|
||||
def __init__(self,threshold, level, sampling=2.0):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._l = threshold
|
||||
self.func = pyDensityAnisotropyF1D(level, IntegrationType.MEAN, sampling)
|
||||
def getName(self):
|
||||
return "pyHighDensityAnisotropyUP1D"
|
||||
def __call__(self, inter):
|
||||
return (self.func(inter) > self._l)
|
||||
|
||||
class pyHighViewMapGradientNormUP1D(UnaryPredicate1D):
|
||||
def __init__(self,threshold, l, sampling=2.0):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._threshold = threshold
|
||||
self._GetGradient = pyViewMapGradientNormF1D(l, IntegrationType.MEAN)
|
||||
def getName(self):
|
||||
return "pyHighViewMapGradientNormUP1D"
|
||||
def __call__(self, inter):
|
||||
gn = self._GetGradient(inter)
|
||||
#print gn
|
||||
return (gn > self._threshold)
|
||||
|
||||
class pyDensityVariableSigmaUP1D(UnaryPredicate1D):
|
||||
def __init__(self,functor, sigmaMin,sigmaMax, lmin, lmax, tmin, tmax, integration = IntegrationType.MEAN, sampling=2.0):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._functor = functor
|
||||
self._sigmaMin = float(sigmaMin)
|
||||
self._sigmaMax = float(sigmaMax)
|
||||
self._lmin = float(lmin)
|
||||
self._lmax = float(lmax)
|
||||
self._tmin = tmin
|
||||
self._tmax = tmax
|
||||
self._integration = integration
|
||||
self._sampling = sampling
|
||||
|
||||
def getName(self):
|
||||
return "pyDensityUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
sigma = (self._sigmaMax-self._sigmaMin)/(self._lmax-self._lmin)*(self._functor(inter)-self._lmin) + self._sigmaMin
|
||||
t = (self._tmax-self._tmin)/(self._lmax-self._lmin)*(self._functor(inter)-self._lmin) + self._tmin
|
||||
if(sigma<self._sigmaMin):
|
||||
sigma = self._sigmaMin
|
||||
self._func = DensityF1D(sigma, self._integration, self._sampling)
|
||||
d = self._func(inter)
|
||||
if(d<t):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
class pyClosedCurveUP1D(UnaryPredicate1D):
|
||||
def __call__(self, inter):
|
||||
it = inter.verticesBegin()
|
||||
itlast = inter.verticesEnd()
|
||||
itlast.decrement()
|
||||
vlast = itlast.getObject()
|
||||
v = it.getObject()
|
||||
print v.getId().getFirst(), v.getId().getSecond()
|
||||
print vlast.getId().getFirst(), vlast.getId().getSecond()
|
||||
if(v.getId() == vlast.getId()):
|
||||
return 1
|
||||
return 0
|
@ -1,75 +0,0 @@
|
||||
#
|
||||
# Filename : anisotropic_diffusion.py
|
||||
# Author : Fredo Durand
|
||||
# Date : 12/08/2004
|
||||
# Purpose : Smoothes lines using an anisotropic diffusion scheme
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from shaders import *
|
||||
from vector import *
|
||||
from PredicatesU0D import *
|
||||
from math import *
|
||||
|
||||
## thickness modifiers
|
||||
|
||||
normalInfo=Normal2DF0D()
|
||||
curvatureInfo=Curvature2DAngleF0D()
|
||||
|
||||
def edgestopping(x, sigma):
|
||||
return exp(- x*x/(2*sigma*sigma))
|
||||
|
||||
class pyDiffusion2Shader(StrokeShader):
|
||||
def __init__(self, lambda1, nbIter):
|
||||
StrokeShader.__init__(self)
|
||||
self._lambda = lambda1
|
||||
self._nbIter = nbIter
|
||||
def getName(self):
|
||||
return "pyDiffusionShader"
|
||||
def shade(self, stroke):
|
||||
for i in range (1, self._nbIter):
|
||||
it = stroke.strokeVerticesBegin()
|
||||
while it.isEnd() == 0:
|
||||
v=it.getObject()
|
||||
p1 = v.getPoint()
|
||||
p2 = normalInfo(it.castToInterface0DIterator())*self._lambda*curvatureInfo(it.castToInterface0DIterator())
|
||||
v.setPoint(p1+p2)
|
||||
it.increment()
|
||||
|
||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
|
||||
Operators.select( upred )
|
||||
bpred = TrueBP1D();
|
||||
Operators.bidirectionalChain(ChainPredicateIterator(upred, bpred), NotUP1D(upred) )
|
||||
shaders_list = [
|
||||
ConstantThicknessShader(4),
|
||||
StrokeTextureShader("smoothAlpha.bmp", Stroke.OPAQUE_MEDIUM, 0),
|
||||
SamplingShader(2),
|
||||
pyDiffusion2Shader(-0.03, 30),
|
||||
IncreasingColorShader(1.0,0.0,0.0,1, 0, 1, 0, 1)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
||||
|
||||
|
||||
|
@ -1,45 +0,0 @@
|
||||
#
|
||||
# Filename : apriori_and_causal_density.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Selects the lines with high a priori density and
|
||||
# subjects them to the causal density so as to avoid
|
||||
# cluttering
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from PredicatesU1D import *
|
||||
from shaders import *
|
||||
|
||||
Operators.select(AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.3,4) ) )
|
||||
bpred = TrueBP1D()
|
||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.3,4))
|
||||
Operators.bidirectionalChain(ChainPredicateIterator(upred, bpred), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||
shaders_list = [
|
||||
ConstantThicknessShader(2),
|
||||
ConstantColorShader(0.0, 0.0, 0.0,1)
|
||||
]
|
||||
Operators.create(pyDensityUP1D(1,0.1, IntegrationType.MEAN), shaders_list)
|
@ -1,43 +0,0 @@
|
||||
#
|
||||
# Filename : apriori_density.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws lines having a high a priori density
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from PredicatesU1D import *
|
||||
from shaders import *
|
||||
|
||||
Operators.select(AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.1,5)))
|
||||
bpred = TrueBP1D()
|
||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.0007,5))
|
||||
Operators.bidirectionalChain(ChainPredicateIterator(upred, bpred), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||
shaders_list = [
|
||||
ConstantThicknessShader(2),
|
||||
ConstantColorShader(0.0, 0.0, 0.0,1)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,36 +0,0 @@
|
||||
#
|
||||
# Filename : backbone_stretcher.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Stretches the geometry of visible lines
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from shaders import *
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||
shaders_list = [TextureAssignerShader(4), ConstantColorShader(0.5, 0.5, 0.5), BackboneStretcherShader(20)]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,46 +0,0 @@
|
||||
#
|
||||
# Filename : blueprint_circles.py
|
||||
# Author : Emmanuel Turquin
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Produces a blueprint using circular contour strokes
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from PredicatesU1D import *
|
||||
from shaders import *
|
||||
|
||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
|
||||
bpred = SameShapeIdBP1D()
|
||||
Operators.select(upred)
|
||||
Operators.bidirectionalChain(ChainPredicateIterator(upred,bpred), NotUP1D(upred))
|
||||
Operators.select(pyHigherLengthUP1D(200))
|
||||
shaders_list = [
|
||||
ConstantThicknessShader(5),
|
||||
pyBluePrintCirclesShader(3),
|
||||
pyPerlinNoise1DShader(0.1, 15, 8),
|
||||
TextureAssignerShader(4),
|
||||
IncreasingColorShader(0.8, 0.8, 0.3, 0.4, 0.3, 0.3, 0.3, 0.1)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,46 +0,0 @@
|
||||
#
|
||||
# Filename : blueprint_ellipses.py
|
||||
# Author : Emmanuel Turquin
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Produces a blueprint using elliptic contour strokes
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from PredicatesU1D import *
|
||||
from shaders import *
|
||||
|
||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
|
||||
bpred = SameShapeIdBP1D()
|
||||
Operators.select(upred)
|
||||
Operators.bidirectionalChain(ChainPredicateIterator(upred,bpred), NotUP1D(upred))
|
||||
Operators.select(pyHigherLengthUP1D(200))
|
||||
shaders_list = [
|
||||
ConstantThicknessShader(5),
|
||||
pyBluePrintEllipsesShader(3),
|
||||
pyPerlinNoise1DShader(0.1, 10, 8),
|
||||
TextureAssignerShader(4),
|
||||
IncreasingColorShader(0.6, 0.3, 0.3, 0.7, 0.3, 0.3, 0.3, 0.1)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,45 +0,0 @@
|
||||
# Filename : blueprint_squares.py
|
||||
# Author : Emmanuel Turquin
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Produces a blueprint using square contour strokes
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from PredicatesU1D import *
|
||||
from shaders import *
|
||||
|
||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
|
||||
bpred = SameShapeIdBP1D()
|
||||
Operators.select(upred)
|
||||
Operators.bidirectionalChain(ChainPredicateIterator(upred,bpred), NotUP1D(upred))
|
||||
Operators.select(pyHigherLengthUP1D(200))
|
||||
shaders_list = [
|
||||
ConstantThicknessShader(8),
|
||||
pyBluePrintSquaresShader(2, 20),
|
||||
pyPerlinNoise1DShader(0.07, 10, 8),
|
||||
TextureAssignerShader(4),
|
||||
IncreasingColorShader(0.6, 0.3, 0.3, 0.7, 0.6, 0.3, 0.3, 0.3),
|
||||
ConstantThicknessShader(4)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,42 +0,0 @@
|
||||
#
|
||||
# Filename : cartoon.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws colored lines. The color is automatically
|
||||
# infered from each object's material in a cartoon-like
|
||||
# fashion.
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from shaders import *
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||
shaders_list = [
|
||||
BezierCurveShader(3),
|
||||
ConstantThicknessShader(4),
|
||||
pyMaterialColorShader(0.8)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,42 +0,0 @@
|
||||
#
|
||||
# Filename : contour.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws each object's visible contour
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
import freestyle_init
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from PredicatesU1D import *
|
||||
from shaders import *
|
||||
|
||||
Operators.select(AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D() ) )
|
||||
bpred = SameShapeIdBP1D();
|
||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
|
||||
Operators.bidirectionalChain(ChainPredicateIterator(upred, bpred), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||
shaders_list = [
|
||||
ConstantThicknessShader(5.0),
|
||||
IncreasingColorShader(0.8,0,0,1,0.1,0,0,1)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,60 +0,0 @@
|
||||
#
|
||||
# Filename : curvature2d.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : The stroke points are colored in gray levels and depending
|
||||
# on the 2d curvature value
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from shaders import *
|
||||
|
||||
class py2DCurvatureColorShader(StrokeShader):
|
||||
def getName(self):
|
||||
return "py2DCurvatureColorShader"
|
||||
|
||||
def shade(self, stroke):
|
||||
it = stroke.strokeVerticesBegin()
|
||||
it_end = stroke.strokeVerticesEnd()
|
||||
func = Curvature2DAngleF0D()
|
||||
while it.isEnd() == 0:
|
||||
it0D = it.castToInterface0DIterator()
|
||||
sv = it.getObject()
|
||||
att = sv.attribute()
|
||||
c = func(it0D)
|
||||
if (c<0):
|
||||
print "negative 2D curvature"
|
||||
color = 10.0 * c/3.1415
|
||||
att.setColor(color,color,color);
|
||||
it.increment()
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||
shaders_list = [
|
||||
StrokeTextureShader("smoothAlpha.bmp", Stroke.OPAQUE_MEDIUM, 0),
|
||||
ConstantThicknessShader(5),
|
||||
py2DCurvatureColorShader()
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,43 +0,0 @@
|
||||
#
|
||||
# Filename : external_contour.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws the external contour of the scene
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from PredicatesU1D import *
|
||||
from ChainingIterators import *
|
||||
from shaders import *
|
||||
|
||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
|
||||
Operators.select(upred )
|
||||
bpred = TrueBP1D();
|
||||
Operators.bidirectionalChain(ChainPredicateIterator(upred, bpred), NotUP1D(upred))
|
||||
shaders_list = [
|
||||
ConstantThicknessShader(3),
|
||||
ConstantColorShader(0.0, 0.0, 0.0,1)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,48 +0,0 @@
|
||||
#
|
||||
# Filename : external_contour_sketchy.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws the external contour of the scene using a sketchy
|
||||
# chaining iterator (in particular each ViewEdge can be drawn
|
||||
# several times
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from ChainingIterators import *
|
||||
from shaders import *
|
||||
|
||||
|
||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
|
||||
Operators.select(upred)
|
||||
Operators.bidirectionalChain(pySketchyChainingIterator(), NotUP1D(upred))
|
||||
shaders_list = [
|
||||
SamplingShader(4),
|
||||
SpatialNoiseShader(10, 150, 2, 1, 1),
|
||||
IncreasingThicknessShader(4, 10),
|
||||
SmoothingShader(400, 0.1, 0, 0.2, 0, 0, 0, 1),
|
||||
IncreasingColorShader(1,0,0,1,0,1,0,1),
|
||||
TextureAssignerShader(4)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,44 +0,0 @@
|
||||
#
|
||||
# Filename : external_contour_smooth.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws a smooth external contour
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from PredicatesU1D import *
|
||||
from shaders import *
|
||||
from ChainingIterators import *
|
||||
|
||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
|
||||
Operators.select(upred)
|
||||
bpred = TrueBP1D();
|
||||
Operators.bidirectionalChain(ChainPredicateIterator(upred, bpred), NotUP1D(upred))
|
||||
shaders_list = [
|
||||
SamplingShader(2),
|
||||
IncreasingThicknessShader(4,20),
|
||||
IncreasingColorShader(1.0, 0.0, 0.5,1, 0.5,1, 0.3, 1),
|
||||
SmoothingShader(100, 0.05, 0, 0.2, 0, 0, 0, 1)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,3 +0,0 @@
|
||||
1suggestive.py
|
||||
1ridges.py
|
||||
1nor_suggestive_or_ridges.py
|
@ -1,459 +0,0 @@
|
||||
from Blender.Mathutils import Vector
|
||||
import Blender.Freestyle
|
||||
|
||||
class BBox(Blender.Freestyle.BBox):
|
||||
pass
|
||||
|
||||
class BinaryPredicate0D(Blender.Freestyle.BinaryPredicate0D):
|
||||
pass
|
||||
|
||||
class BinaryPredicate1D(Blender.Freestyle.BinaryPredicate1D):
|
||||
pass
|
||||
|
||||
class FrsMaterial(Blender.Freestyle.FrsMaterial):
|
||||
pass
|
||||
|
||||
class Id(Blender.Freestyle.Id):
|
||||
pass
|
||||
|
||||
class IntegrationType(Blender.Freestyle.IntegrationType):
|
||||
pass
|
||||
|
||||
class Interface0D(Blender.Freestyle.Interface0D):
|
||||
pass
|
||||
|
||||
class Interface1D(Blender.Freestyle.Interface1D):
|
||||
pass
|
||||
|
||||
class Iterator(Blender.Freestyle.Iterator):
|
||||
pass
|
||||
|
||||
class MediumType(Blender.Freestyle.MediumType):
|
||||
pass
|
||||
|
||||
class Nature(Blender.Freestyle.Nature):
|
||||
pass
|
||||
|
||||
class FrsNoise(Blender.Freestyle.FrsNoise):
|
||||
pass
|
||||
|
||||
class Operators(Blender.Freestyle.Operators):
|
||||
pass
|
||||
|
||||
class SShape(Blender.Freestyle.SShape):
|
||||
pass
|
||||
|
||||
class StrokeAttribute(Blender.Freestyle.StrokeAttribute):
|
||||
pass
|
||||
|
||||
class StrokeShader(Blender.Freestyle.StrokeShader):
|
||||
pass
|
||||
|
||||
class UnaryFunction0D(Blender.Freestyle.UnaryFunction0D):
|
||||
pass
|
||||
|
||||
class UnaryFunction1D(Blender.Freestyle.UnaryFunction1D):
|
||||
pass
|
||||
|
||||
class UnaryPredicate0D(Blender.Freestyle.UnaryPredicate0D):
|
||||
pass
|
||||
|
||||
class UnaryPredicate1D(Blender.Freestyle.UnaryPredicate1D):
|
||||
pass
|
||||
|
||||
class ViewMap(Blender.Freestyle.ViewMap):
|
||||
pass
|
||||
|
||||
class ViewShape(Blender.Freestyle.ViewShape):
|
||||
pass
|
||||
|
||||
class FalseBP1D(Blender.Freestyle.FalseBP1D):
|
||||
pass
|
||||
|
||||
class Length2DBP1D(Blender.Freestyle.Length2DBP1D):
|
||||
pass
|
||||
|
||||
class SameShapeIdBP1D(Blender.Freestyle.SameShapeIdBP1D):
|
||||
pass
|
||||
|
||||
class TrueBP1D(Blender.Freestyle.TrueBP1D):
|
||||
pass
|
||||
|
||||
class ViewMapGradientNormBP1D(Blender.Freestyle.ViewMapGradientNormBP1D):
|
||||
pass
|
||||
|
||||
class CurvePoint(Blender.Freestyle.CurvePoint):
|
||||
pass
|
||||
|
||||
class SVertex(Blender.Freestyle.SVertex):
|
||||
pass
|
||||
|
||||
class ViewVertex(Blender.Freestyle.ViewVertex):
|
||||
pass
|
||||
|
||||
class FrsCurve(Blender.Freestyle.FrsCurve):
|
||||
pass
|
||||
|
||||
class FEdge(Blender.Freestyle.FEdge):
|
||||
pass
|
||||
|
||||
class Stroke(Blender.Freestyle.Stroke):
|
||||
pass
|
||||
|
||||
class ViewEdge(Blender.Freestyle.ViewEdge):
|
||||
pass
|
||||
|
||||
class AdjacencyIterator(Blender.Freestyle.AdjacencyIterator):
|
||||
pass
|
||||
|
||||
class ChainingIterator(Blender.Freestyle.ChainingIterator):
|
||||
pass
|
||||
|
||||
class ChainPredicateIterator(Blender.Freestyle.ChainPredicateIterator):
|
||||
pass
|
||||
|
||||
class ChainSilhouetteIterator(Blender.Freestyle.ChainSilhouetteIterator):
|
||||
pass
|
||||
|
||||
class CurvePointIterator(Blender.Freestyle.CurvePointIterator):
|
||||
pass
|
||||
|
||||
class Interface0DIterator(Blender.Freestyle.Interface0DIterator):
|
||||
pass
|
||||
|
||||
class orientedViewEdgeIterator(Blender.Freestyle.orientedViewEdgeIterator):
|
||||
pass
|
||||
|
||||
class StrokeVertexIterator(Blender.Freestyle.StrokeVertexIterator):
|
||||
pass
|
||||
|
||||
class SVertexIterator(Blender.Freestyle.SVertexIterator):
|
||||
pass
|
||||
|
||||
class ViewEdgeIterator(Blender.Freestyle.ViewEdgeIterator):
|
||||
pass
|
||||
|
||||
class BackboneStretcherShader(Blender.Freestyle.BackboneStretcherShader):
|
||||
pass
|
||||
|
||||
class BezierCurveShader(Blender.Freestyle.BezierCurveShader):
|
||||
pass
|
||||
|
||||
class CalligraphicShader(Blender.Freestyle.CalligraphicShader):
|
||||
pass
|
||||
|
||||
class ColorNoiseShader(Blender.Freestyle.ColorNoiseShader):
|
||||
pass
|
||||
|
||||
class ColorVariationPatternShader(Blender.Freestyle.ColorVariationPatternShader):
|
||||
pass
|
||||
|
||||
class ConstantColorShader(Blender.Freestyle.ConstantColorShader):
|
||||
pass
|
||||
|
||||
class ConstantThicknessShader(Blender.Freestyle.ConstantThicknessShader):
|
||||
pass
|
||||
|
||||
class ConstrainedIncreasingThicknessShader(Blender.Freestyle.ConstrainedIncreasingThicknessShader):
|
||||
pass
|
||||
|
||||
class fstreamShader(Blender.Freestyle.fstreamShader):
|
||||
pass
|
||||
|
||||
class GuidingLinesShader(Blender.Freestyle.GuidingLinesShader):
|
||||
pass
|
||||
|
||||
class IncreasingColorShader(Blender.Freestyle.IncreasingColorShader):
|
||||
pass
|
||||
|
||||
class IncreasingThicknessShader(Blender.Freestyle.IncreasingThicknessShader):
|
||||
pass
|
||||
|
||||
class PolygonalizationShader(Blender.Freestyle.PolygonalizationShader):
|
||||
pass
|
||||
|
||||
class SamplingShader(Blender.Freestyle.SamplingShader):
|
||||
pass
|
||||
|
||||
class SmoothingShader(Blender.Freestyle.SmoothingShader):
|
||||
pass
|
||||
|
||||
class SpatialNoiseShader(Blender.Freestyle.SpatialNoiseShader):
|
||||
pass
|
||||
|
||||
class streamShader(Blender.Freestyle.streamShader):
|
||||
pass
|
||||
|
||||
class StrokeTextureShader(Blender.Freestyle.StrokeTextureShader):
|
||||
pass
|
||||
|
||||
class TextureAssignerShader(Blender.Freestyle.TextureAssignerShader):
|
||||
pass
|
||||
|
||||
class ThicknessNoiseShader(Blender.Freestyle.ThicknessNoiseShader):
|
||||
pass
|
||||
|
||||
class ThicknessVariationPatternShader(Blender.Freestyle.ThicknessVariationPatternShader):
|
||||
pass
|
||||
|
||||
class TipRemoverShader(Blender.Freestyle.TipRemoverShader):
|
||||
pass
|
||||
|
||||
class UnaryFunction0DDouble(Blender.Freestyle.UnaryFunction0DDouble):
|
||||
pass
|
||||
|
||||
class UnaryFunction0DEdgeNature(Blender.Freestyle.UnaryFunction0DEdgeNature):
|
||||
pass
|
||||
|
||||
class UnaryFunction0DFloat(Blender.Freestyle.UnaryFunction0DFloat):
|
||||
pass
|
||||
|
||||
class UnaryFunction0DId(Blender.Freestyle.UnaryFunction0DId):
|
||||
pass
|
||||
|
||||
class UnaryFunction0DMaterial(Blender.Freestyle.UnaryFunction0DMaterial):
|
||||
pass
|
||||
|
||||
class UnaryFunction0DUnsigned(Blender.Freestyle.UnaryFunction0DUnsigned):
|
||||
pass
|
||||
|
||||
class UnaryFunction0DVec2f(Blender.Freestyle.UnaryFunction0DVec2f):
|
||||
pass
|
||||
|
||||
class UnaryFunction0DVec3f(Blender.Freestyle.UnaryFunction0DVec3f):
|
||||
pass
|
||||
|
||||
class UnaryFunction0DVectorViewShape(Blender.Freestyle.UnaryFunction0DVectorViewShape):
|
||||
pass
|
||||
|
||||
class UnaryFunction0DViewShape(Blender.Freestyle.UnaryFunction0DViewShape):
|
||||
pass
|
||||
|
||||
class UnaryFunction1DDouble(Blender.Freestyle.UnaryFunction1DDouble):
|
||||
pass
|
||||
|
||||
class UnaryFunction1DEdgeNature(Blender.Freestyle.UnaryFunction1DEdgeNature):
|
||||
pass
|
||||
|
||||
class UnaryFunction1DFloat(Blender.Freestyle.UnaryFunction1DFloat):
|
||||
pass
|
||||
|
||||
class UnaryFunction1DUnsigned(Blender.Freestyle.UnaryFunction1DUnsigned):
|
||||
pass
|
||||
|
||||
class UnaryFunction1DVec2f(Blender.Freestyle.UnaryFunction1DVec2f):
|
||||
pass
|
||||
|
||||
class UnaryFunction1DVec3f(Blender.Freestyle.UnaryFunction1DVec3f):
|
||||
pass
|
||||
|
||||
class UnaryFunction1DVectorViewShape(Blender.Freestyle.UnaryFunction1DVectorViewShape):
|
||||
pass
|
||||
|
||||
class UnaryFunction1DVoid(Blender.Freestyle.UnaryFunction1DVoid):
|
||||
pass
|
||||
|
||||
class FalseUP0D(Blender.Freestyle.FalseUP0D):
|
||||
pass
|
||||
|
||||
class TrueUP0D(Blender.Freestyle.TrueUP0D):
|
||||
pass
|
||||
|
||||
class ContourUP1D(Blender.Freestyle.ContourUP1D):
|
||||
pass
|
||||
|
||||
class DensityLowerThanUP1D(Blender.Freestyle.DensityLowerThanUP1D):
|
||||
pass
|
||||
|
||||
class EqualToChainingTimeStampUP1D(Blender.Freestyle.EqualToChainingTimeStampUP1D):
|
||||
pass
|
||||
|
||||
class EqualToTimeStampUP1D(Blender.Freestyle.EqualToTimeStampUP1D):
|
||||
pass
|
||||
|
||||
class ExternalContourUP1D(Blender.Freestyle.ExternalContourUP1D):
|
||||
pass
|
||||
|
||||
class FalseUP1D(Blender.Freestyle.FalseUP1D):
|
||||
pass
|
||||
|
||||
class QuantitativeInvisibilityUP1D(Blender.Freestyle.QuantitativeInvisibilityUP1D):
|
||||
pass
|
||||
|
||||
class ShapeUP1D(Blender.Freestyle.ShapeUP1D):
|
||||
pass
|
||||
|
||||
class TrueUP1D(Blender.Freestyle.TrueUP1D):
|
||||
pass
|
||||
|
||||
class StrokeVertex(Blender.Freestyle.StrokeVertex):
|
||||
pass
|
||||
|
||||
class NonTVertex(Blender.Freestyle.NonTVertex):
|
||||
pass
|
||||
|
||||
class TVertex(Blender.Freestyle.TVertex):
|
||||
pass
|
||||
|
||||
class Chain(Blender.Freestyle.Chain):
|
||||
pass
|
||||
|
||||
class FEdgeSharp(Blender.Freestyle.FEdgeSharp):
|
||||
pass
|
||||
|
||||
class FEdgeSmooth(Blender.Freestyle.FEdgeSmooth):
|
||||
pass
|
||||
|
||||
class Curvature2DAngleF0D(Blender.Freestyle.Curvature2DAngleF0D):
|
||||
pass
|
||||
|
||||
class DensityF0D(Blender.Freestyle.DensityF0D):
|
||||
pass
|
||||
|
||||
class GetProjectedXF0D(Blender.Freestyle.GetProjectedXF0D):
|
||||
pass
|
||||
|
||||
class GetProjectedYF0D(Blender.Freestyle.GetProjectedYF0D):
|
||||
pass
|
||||
|
||||
class GetProjectedZF0D(Blender.Freestyle.GetProjectedZF0D):
|
||||
pass
|
||||
|
||||
class GetXF0D(Blender.Freestyle.GetXF0D):
|
||||
pass
|
||||
|
||||
class GetYF0D(Blender.Freestyle.GetYF0D):
|
||||
pass
|
||||
|
||||
class GetZF0D(Blender.Freestyle.GetZF0D):
|
||||
pass
|
||||
|
||||
class LocalAverageDepthF0D(Blender.Freestyle.LocalAverageDepthF0D):
|
||||
pass
|
||||
|
||||
class ZDiscontinuityF0D(Blender.Freestyle.ZDiscontinuityF0D):
|
||||
pass
|
||||
|
||||
class GetCurvilinearAbscissaF0D(Blender.Freestyle.GetCurvilinearAbscissaF0D):
|
||||
pass
|
||||
|
||||
class GetParameterF0D(Blender.Freestyle.GetParameterF0D):
|
||||
pass
|
||||
|
||||
class GetViewMapGradientNormF0D(Blender.Freestyle.GetViewMapGradientNormF0D):
|
||||
pass
|
||||
|
||||
class ReadCompleteViewMapPixelF0D(Blender.Freestyle.ReadCompleteViewMapPixelF0D):
|
||||
pass
|
||||
|
||||
class ReadMapPixelF0D(Blender.Freestyle.ReadMapPixelF0D):
|
||||
pass
|
||||
|
||||
class ReadSteerableViewMapPixelF0D(Blender.Freestyle.ReadSteerableViewMapPixelF0D):
|
||||
pass
|
||||
|
||||
class ShapeIdF0D(Blender.Freestyle.ShapeIdF0D):
|
||||
pass
|
||||
|
||||
class MaterialF0D(Blender.Freestyle.MaterialF0D):
|
||||
pass
|
||||
|
||||
class CurveNatureF0D(Blender.Freestyle.CurveNatureF0D):
|
||||
pass
|
||||
|
||||
class QuantitativeInvisibilityF0D(Blender.Freestyle.QuantitativeInvisibilityF0D):
|
||||
pass
|
||||
|
||||
class Normal2DF0D(Blender.Freestyle.Normal2DF0D):
|
||||
pass
|
||||
|
||||
class VertexOrientation2DF0D(Blender.Freestyle.VertexOrientation2DF0D):
|
||||
pass
|
||||
|
||||
class VertexOrientation3DF0D(Blender.Freestyle.VertexOrientation3DF0D):
|
||||
pass
|
||||
|
||||
class GetOccludersF0D(Blender.Freestyle.GetOccludersF0D):
|
||||
pass
|
||||
|
||||
class GetOccludeeF0D(Blender.Freestyle.GetOccludeeF0D):
|
||||
pass
|
||||
|
||||
class GetShapeF0D(Blender.Freestyle.GetShapeF0D):
|
||||
pass
|
||||
|
||||
class Curvature2DAngleF1D(Blender.Freestyle.Curvature2DAngleF1D):
|
||||
pass
|
||||
|
||||
class DensityF1D(Blender.Freestyle.DensityF1D):
|
||||
pass
|
||||
|
||||
class GetCompleteViewMapDensityF1D(Blender.Freestyle.GetCompleteViewMapDensityF1D):
|
||||
pass
|
||||
|
||||
class GetDirectionalViewMapDensityF1D(Blender.Freestyle.GetDirectionalViewMapDensityF1D):
|
||||
pass
|
||||
|
||||
class GetProjectedXF1D(Blender.Freestyle.GetProjectedXF1D):
|
||||
pass
|
||||
|
||||
class GetProjectedYF1D(Blender.Freestyle.GetProjectedYF1D):
|
||||
pass
|
||||
|
||||
class GetProjectedZF1D(Blender.Freestyle.GetProjectedZF1D):
|
||||
pass
|
||||
|
||||
class GetSteerableViewMapDensityF1D(Blender.Freestyle.GetSteerableViewMapDensityF1D):
|
||||
pass
|
||||
|
||||
class GetViewMapGradientNormF1D(Blender.Freestyle.GetViewMapGradientNormF1D):
|
||||
pass
|
||||
|
||||
class GetXF1D(Blender.Freestyle.GetXF1D):
|
||||
pass
|
||||
|
||||
class GetYF1D(Blender.Freestyle.GetYF1D):
|
||||
pass
|
||||
|
||||
class GetZF1D(Blender.Freestyle.GetZF1D):
|
||||
pass
|
||||
|
||||
class LocalAverageDepthF1D(Blender.Freestyle.LocalAverageDepthF1D):
|
||||
pass
|
||||
|
||||
class ZDiscontinuityF1D(Blender.Freestyle.ZDiscontinuityF1D):
|
||||
pass
|
||||
|
||||
class CurveNatureF1D(Blender.Freestyle.CurveNatureF1D):
|
||||
pass
|
||||
|
||||
class QuantitativeInvisibilityF1D(Blender.Freestyle.QuantitativeInvisibilityF1D):
|
||||
pass
|
||||
|
||||
class Normal2DF1D(Blender.Freestyle.Normal2DF1D):
|
||||
pass
|
||||
|
||||
class Orientation2DF1D(Blender.Freestyle.Orientation2DF1D):
|
||||
pass
|
||||
|
||||
class Orientation3DF1D(Blender.Freestyle.Orientation3DF1D):
|
||||
pass
|
||||
|
||||
class GetOccludeeF1D(Blender.Freestyle.GetOccludeeF1D):
|
||||
pass
|
||||
|
||||
class GetOccludersF1D(Blender.Freestyle.GetOccludersF1D):
|
||||
pass
|
||||
|
||||
class GetShapeF1D(Blender.Freestyle.GetShapeF1D):
|
||||
pass
|
||||
|
||||
class ChainingTimeStampF1D(Blender.Freestyle.ChainingTimeStampF1D):
|
||||
pass
|
||||
|
||||
class IncrementChainingTimeStampF1D(Blender.Freestyle.IncrementChainingTimeStampF1D):
|
||||
pass
|
||||
|
||||
class TimeStampF1D(Blender.Freestyle.TimeStampF1D):
|
||||
pass
|
||||
|
@ -1,50 +0,0 @@
|
||||
#
|
||||
# Filename : haloing.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : This style module selects the lines that
|
||||
# are connected (in the image) to a specific
|
||||
# object and trims them in order to produce
|
||||
# a haloing effect around the target shape
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesU1D import *
|
||||
from PredicatesB1D import *
|
||||
from shaders import *
|
||||
|
||||
# id corresponds to the id of the target object
|
||||
# (accessed by SHIFT+click)
|
||||
id = Id(3,0)
|
||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0) , pyIsOccludedByUP1D(id))
|
||||
Operators.select(upred)
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(upred))
|
||||
shaders_list = [
|
||||
IncreasingThicknessShader(3, 5),
|
||||
IncreasingColorShader(1,0,0, 1,0,1,0,1),
|
||||
SamplingShader(1.0),
|
||||
pyTVertexRemoverShader(),
|
||||
TipRemoverShader(3.0)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,41 +0,0 @@
|
||||
#
|
||||
# Filename : ignore_small_oclusions.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : The strokes are drawn through small occlusions
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from ChainingIterators import *
|
||||
from shaders import *
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
#Operators.bidirectionalChain(pyFillOcclusionsChainingIterator(0.1))
|
||||
Operators.bidirectionalChain(pyFillOcclusionsAbsoluteChainingIterator(12))
|
||||
shaders_list = [
|
||||
SamplingShader(5.0),
|
||||
ConstantThicknessShader(3),
|
||||
ConstantColorShader(0.0,0.0,0.0),
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,42 +0,0 @@
|
||||
#
|
||||
# Filename : invisible_lines.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws all lines whose Quantitative Invisibility
|
||||
# is different from 0
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from ChainingIterators import *
|
||||
from shaders import *
|
||||
|
||||
upred = NotUP1D(QuantitativeInvisibilityUP1D(0))
|
||||
Operators.select(upred)
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(upred))
|
||||
shaders_list = [
|
||||
SamplingShader(5.0),
|
||||
ConstantThicknessShader(3.0),
|
||||
ConstantColorShader(0.7,0.7,0.7)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,60 +0,0 @@
|
||||
#
|
||||
# Filename : japanese_bigbrush.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Simulates a big brush fr oriental painting
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesU1D import *
|
||||
from PredicatesB1D import *
|
||||
from Functions0D import *
|
||||
from shaders import *
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(),NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||
## Splits strokes at points of highest 2D curavture
|
||||
## when there are too many abrupt turns in it
|
||||
func = pyInverseCurvature2DAngleF0D()
|
||||
Operators.recursiveSplit(func, pyParameterUP0D(0.2,0.8), NotUP1D(pyHigherNumberOfTurnsUP1D(3, 0.5)), 2)
|
||||
## Keeps only long enough strokes
|
||||
Operators.select(pyHigherLengthUP1D(100))
|
||||
## Sorts so as to draw the longest strokes first
|
||||
## (this will be done using the causal density)
|
||||
Operators.sort(pyLengthBP1D())
|
||||
shaders_list = [
|
||||
pySamplingShader(10),
|
||||
BezierCurveShader(30),
|
||||
SamplingShader(50),
|
||||
ConstantThicknessShader(10),
|
||||
pyNonLinearVaryingThicknessShader(4,25, 0.6),
|
||||
TextureAssignerShader(6),
|
||||
ConstantColorShader(0.2, 0.2, 0.2,1.0),
|
||||
TipRemoverShader(10)
|
||||
]
|
||||
|
||||
## Use the causal density to avoid cluttering
|
||||
Operators.create(pyDensityUP1D(8,0.4, IntegrationType.MEAN), shaders_list)
|
||||
|
||||
|
@ -1,36 +0,0 @@
|
||||
from freestyle_init import *
|
||||
|
||||
class AndUP1D(UnaryPredicate1D):
|
||||
def __init__(self, pred1, pred2):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self.__pred1 = pred1
|
||||
self.__pred2 = pred2
|
||||
|
||||
def getName(self):
|
||||
return "AndUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
return self.__pred1(inter) and self.__pred2(inter)
|
||||
|
||||
class OrUP1D(UnaryPredicate1D):
|
||||
def __init__(self, pred1, pred2):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self.__pred1 = pred1
|
||||
self.__pred2 = pred2
|
||||
|
||||
def getName(self):
|
||||
return "OrUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
return self.__pred1(inter) or self.__pred2(inter)
|
||||
|
||||
class NotUP1D(UnaryPredicate1D):
|
||||
def __init__(self, pred):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self.__pred = pred
|
||||
|
||||
def getName(self):
|
||||
return "NotUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
return self.__pred(inter) == 0
|
@ -1,81 +0,0 @@
|
||||
#
|
||||
# Filename : long_anisotropically_dense.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Selects the lines that are long and have a high anisotropic
|
||||
# a priori density and uses causal density
|
||||
# to draw without cluttering. Ideally, half of the
|
||||
# selected lines are culled using the causal density.
|
||||
#
|
||||
# ********************* WARNING *************************************
|
||||
# ******** The Directional a priori density maps must ******
|
||||
# ******** have been computed prior to using this style module ******
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesU1D import *
|
||||
from PredicatesU0D import *
|
||||
from PredicatesB1D import *
|
||||
from Functions0D import *
|
||||
from Functions1D import *
|
||||
from shaders import *
|
||||
|
||||
## custom density predicate
|
||||
class pyDensityUP1D(UnaryPredicate1D):
|
||||
def __init__(self,wsize,threshold, integration = IntegrationType.MEAN, sampling=2.0):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._wsize = wsize
|
||||
self._threshold = threshold
|
||||
self._integration = integration
|
||||
self._func = DensityF1D(self._wsize, self._integration, sampling)
|
||||
self._func2 = DensityF1D(self._wsize, IntegrationType.MAX, sampling)
|
||||
|
||||
def getName(self):
|
||||
return "pyDensityUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
c = self._func(inter)
|
||||
m = self._func2(inter)
|
||||
if(c < self._threshold):
|
||||
return 1
|
||||
if( m > 4* c ):
|
||||
if ( c < 1.5*self._threshold ):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(),NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||
Operators.select(pyHigherLengthUP1D(40))
|
||||
## selects lines having a high anisotropic a priori density
|
||||
Operators.select(pyHighDensityAnisotropyUP1D(0.3,4))
|
||||
Operators.sort(pyLengthBP1D())
|
||||
shaders_list = [
|
||||
SamplingShader(2.0),
|
||||
ConstantThicknessShader(2),
|
||||
ConstantColorShader(0.2,0.2,0.25,1),
|
||||
]
|
||||
## uniform culling
|
||||
Operators.create(pyDensityUP1D(3.0,2.0e-2, IntegrationType.MEAN, 0.1), shaders_list)
|
||||
|
||||
|
@ -1,51 +0,0 @@
|
||||
#
|
||||
# Filename : multiple_parameterization.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : The thickness and the color of the strokes vary continuously
|
||||
# independently from occlusions although only
|
||||
# visible lines are actually drawn. This is equivalent
|
||||
# to assigning the thickness using a parameterization covering
|
||||
# the complete silhouette (visible+invisible) and drawing
|
||||
# the strokes using a second parameterization that only
|
||||
# covers the visible portions.
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from ChainingIterators import *
|
||||
from shaders import *
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
## Chain following the same nature, but without the restriction
|
||||
## of staying inside the selection (0).
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(0))
|
||||
shaders_list = [
|
||||
SamplingShader(20),
|
||||
IncreasingThicknessShader(1.5, 30),
|
||||
ConstantColorShader(0.0,0.0,0.0),
|
||||
IncreasingColorShader(1,0,0,1,0,1,0,1),
|
||||
TextureAssignerShader(-1),
|
||||
pyHLRShader() ## this shader draws only visible portions
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,43 +0,0 @@
|
||||
#
|
||||
# Filename : nature.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Uses the NatureUP1D predicate to select the lines
|
||||
# of a given type (among Nature.SILHOUETTE, Nature.CREASE, Nature.SUGGESTIVE_CONTOURS,
|
||||
# Nature.BORDERS).
|
||||
# The suggestive contours must have been enabled in the
|
||||
# options dialog to appear in the View Map.
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from shaders import *
|
||||
|
||||
Operators.select(pyNatureUP1D(Nature.SILHOUETTE))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(),NotUP1D( pyNatureUP1D( Nature.SILHOUETTE) ) )
|
||||
shaders_list = [
|
||||
IncreasingThicknessShader(3, 10),
|
||||
IncreasingColorShader(0.0,0.0,0.0, 1, 0.8,0,0,1)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,44 +0,0 @@
|
||||
#
|
||||
# Filename : near_lines.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws the lines that are "closer" than a threshold
|
||||
# (between 0 and 1)
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from PredicatesU1D import *
|
||||
from shaders import *
|
||||
|
||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyZSmallerUP1D(0.5, IntegrationType.MEAN))
|
||||
Operators.select(upred)
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(upred))
|
||||
shaders_list = [
|
||||
TextureAssignerShader(-1),
|
||||
ConstantThicknessShader(5),
|
||||
ConstantColorShader(0.0, 0.0, 0.0)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,45 +0,0 @@
|
||||
#
|
||||
# Filename : occluded_by_specific_object.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws only the lines that are occluded by a given object
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesU1D import *
|
||||
from shaders import *
|
||||
|
||||
## the id of the occluder (use SHIFT+click on the ViewMap to
|
||||
## retrieve ids)
|
||||
id = Id(3,0)
|
||||
upred = AndUP1D(NotUP1D(QuantitativeInvisibilityUP1D(0)),
|
||||
pyIsInOccludersListUP1D(id))
|
||||
Operators.select(upred)
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(upred))
|
||||
shaders_list = [
|
||||
SamplingShader(5),
|
||||
ConstantThicknessShader(3),
|
||||
ConstantColorShader(0.3,0.3,0.3,1)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,40 +0,0 @@
|
||||
#
|
||||
# Filename : polygonalize.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Make the strokes more "polygonal"
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from ChainingIterators import *
|
||||
from shaders import *
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(),NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||
shaders_list = [
|
||||
SamplingShader(2.0),
|
||||
ConstantThicknessShader(3),
|
||||
ConstantColorShader(0.0,0.0,0.0),
|
||||
PolygonalizationShader(8)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,41 +0,0 @@
|
||||
#
|
||||
# Filename : qi0.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws the visible lines (chaining follows same nature lines)
|
||||
# (most basic style module)
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from ChainingIterators import *
|
||||
from shaders import *
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||
shaders_list = [
|
||||
SamplingShader(5.0),
|
||||
ConstantThicknessShader(4.0),
|
||||
ConstantColorShader(0.0,0.0,0.0)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,43 +0,0 @@
|
||||
#
|
||||
# Filename : qi0_not_external_contour.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws the visible lines (chaining follows same nature lines)
|
||||
# that do not belong to the external contour of the scene
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
|
||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
|
||||
Operators.select(upred)
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(upred))
|
||||
shaders_list = [
|
||||
SamplingShader(4),
|
||||
SpatialNoiseShader(4, 150, 2, True, True),
|
||||
IncreasingThicknessShader(2, 5),
|
||||
BackboneStretcherShader(20),
|
||||
IncreasingColorShader(1,0,0,1,0,1,0,1),
|
||||
TextureAssignerShader(4)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,42 +0,0 @@
|
||||
#
|
||||
# Filename : qi1.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws lines hidden by one surface.
|
||||
# *** Quantitative Invisibility must have been
|
||||
# enabled in the options dialog to use this style module ****
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from shaders import *
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(1))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(1)))
|
||||
shaders_list = [
|
||||
SamplingShader(5.0),
|
||||
ConstantThicknessShader(3),
|
||||
ConstantColorShader(0.5,0.5,0.5, 1)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,42 +0,0 @@
|
||||
#
|
||||
# Filename : qi2.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws lines hidden by two surfaces.
|
||||
# *** Quantitative Invisibility must have been
|
||||
# enabled in the options dialog to use this style module ****
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from shaders import *
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(2))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(2)))
|
||||
shaders_list = [
|
||||
SamplingShader(10),
|
||||
ConstantThicknessShader(1.5),
|
||||
ConstantColorShader(0.7,0.7,0.7, 1)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,68 +0,0 @@
|
||||
#
|
||||
# Filename : sequentialsplit_sketchy.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Use the sequential split with two different
|
||||
# predicates to specify respectively the starting and
|
||||
# the stopping extremities for strokes
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesU1D import *
|
||||
from PredicatesU0D import *
|
||||
from Functions0D import *
|
||||
|
||||
## Predicate to tell whether a TVertex
|
||||
## corresponds to a change from 0 to 1 or not.
|
||||
class pyBackTVertexUP0D(UnaryPredicate0D):
|
||||
def __init__(self):
|
||||
UnaryPredicate0D.__init__(self)
|
||||
self._getQI = QuantitativeInvisibilityF0D()
|
||||
def getName(self):
|
||||
return "pyBackTVertexUP0D"
|
||||
def __call__(self, iter):
|
||||
v = iter.getObject()
|
||||
nat = v.getNature()
|
||||
if(nat & Nature.T_VERTEX == 0):
|
||||
return 0
|
||||
if(self._getQI(iter) != 0):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
upred = QuantitativeInvisibilityUP1D(0)
|
||||
Operators.select(upred)
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(upred))
|
||||
## starting and stopping predicates:
|
||||
start = pyVertexNatureUP0D(Nature.NON_T_VERTEX)
|
||||
stop = pyBackTVertexUP0D()
|
||||
Operators.sequentialSplit(start, stop, 10)
|
||||
shaders_list = [
|
||||
SpatialNoiseShader(7, 120, 2, True, True),
|
||||
IncreasingThicknessShader(5, 8),
|
||||
ConstantColorShader(0.2, 0.2, 0.2, 1),
|
||||
TextureAssignerShader(4)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,48 +0,0 @@
|
||||
#
|
||||
# Filename : sketchy_multiple_parameterization.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Builds sketchy strokes whose topology relies on a
|
||||
# parameterization that covers the complete lines (visible+invisible)
|
||||
# whereas only the visible portions are actually drawn
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from ChainingIterators import *
|
||||
from shaders import *
|
||||
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
## 0: don't restrict to selection
|
||||
Operators.bidirectionalChain(pySketchyChainSilhouetteIterator(3,0))
|
||||
shaders_list = [
|
||||
SamplingShader(2),
|
||||
SpatialNoiseShader(15, 120, 2, 1, 1),
|
||||
IncreasingThicknessShader(5, 30),
|
||||
SmoothingShader(100, 0.05, 0, 0.2, 0, 0, 0, 1),
|
||||
IncreasingColorShader(0,0.2,0,1,0.2,0.7,0.2,1),
|
||||
TextureAssignerShader(6),
|
||||
pyHLRShader()
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,89 +0,0 @@
|
||||
#
|
||||
# Filename : sketchy_topology_broken.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : The topology of the strokes is, first, built
|
||||
# independantly from the 3D topology of objects,
|
||||
# and, second, so as to chain several times the same ViewEdge.
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from ChainingIterators import *
|
||||
from shaders import *
|
||||
|
||||
## Backbone stretcher that leaves cusps intact to avoid cracks
|
||||
class pyBackboneStretcherNoCuspShader(StrokeShader):
|
||||
def __init__(self, l):
|
||||
StrokeShader.__init__(self)
|
||||
self._l = l
|
||||
def getName(self):
|
||||
return "pyBackboneStretcherNoCuspShader"
|
||||
def shade(self, stroke):
|
||||
it0 = stroke.strokeVerticesBegin()
|
||||
it1 = StrokeVertexIterator(it0)
|
||||
it1.increment()
|
||||
itn = stroke.strokeVerticesEnd()
|
||||
itn.decrement()
|
||||
itn_1 = StrokeVertexIterator(itn)
|
||||
itn_1.decrement()
|
||||
v0 = it0.getObject()
|
||||
v1 = it1.getObject()
|
||||
if((v0.getNature() & Nature.CUSP == 0) and (v1.getNature() & Nature.CUSP == 0)):
|
||||
p0 = v0.getPoint()
|
||||
p1 = v1.getPoint()
|
||||
d1 = p0-p1
|
||||
d1 = d1/d1.norm()
|
||||
newFirst = p0+d1*float(self._l)
|
||||
v0.setPoint(newFirst)
|
||||
else:
|
||||
print "got a v0 cusp"
|
||||
vn_1 = itn_1.getObject()
|
||||
vn = itn.getObject()
|
||||
if((vn.getNature() & Nature.CUSP == 0) and (vn_1.getNature() & Nature.CUSP == 0)):
|
||||
pn = vn.getPoint()
|
||||
pn_1 = vn_1.getPoint()
|
||||
dn = pn-pn_1
|
||||
dn = dn/dn.norm()
|
||||
newLast = pn+dn*float(self._l)
|
||||
vn.setPoint(newLast)
|
||||
else:
|
||||
print "got a vn cusp"
|
||||
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
## Chain 3 times each ViewEdge indpendantly from the
|
||||
## initial objects topology
|
||||
Operators.bidirectionalChain(pySketchyChainingIterator(3))
|
||||
shaders_list = [
|
||||
SamplingShader(4),
|
||||
SpatialNoiseShader(6, 120, 2, 1, 1),
|
||||
IncreasingThicknessShader(4, 10),
|
||||
SmoothingShader(100, 0.1, 0, 0.2, 0, 0, 0, 1),
|
||||
pyBackboneStretcherNoCuspShader(20),
|
||||
#ConstantColorShader(0.0,0.0,0.0)
|
||||
IncreasingColorShader(0.2,0.2,0.2,1,0.5,0.5,0.5,1),
|
||||
#IncreasingColorShader(1,0,0,1,0,1,0,1),
|
||||
TextureAssignerShader(4)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,49 +0,0 @@
|
||||
#
|
||||
# Filename : sketchy_topology_preserved.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : The topology of the strokes is built
|
||||
# so as to chain several times the same ViewEdge.
|
||||
# The topology of the objects is preserved
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from ChainingIterators import *
|
||||
from PredicatesU1D import *
|
||||
from shaders import *
|
||||
|
||||
upred = QuantitativeInvisibilityUP1D(0)
|
||||
Operators.select(upred)
|
||||
Operators.bidirectionalChain(pySketchyChainSilhouetteIterator(3,1))
|
||||
shaders_list = [
|
||||
SamplingShader(4),
|
||||
SpatialNoiseShader(20, 220, 2, 1, 1),
|
||||
IncreasingThicknessShader(4, 8),
|
||||
SmoothingShader(300, 0.05, 0, 0.2, 0, 0, 0, 0.5),
|
||||
ConstantColorShader(0.6,0.2,0.0),
|
||||
TextureAssignerShader(4),
|
||||
]
|
||||
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
||||
|
@ -1,41 +0,0 @@
|
||||
#
|
||||
# Filename : split_at_highest_2d_curvature.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws the visible lines (chaining follows same nature lines)
|
||||
# (most basic style module)
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesU0D import *
|
||||
from PredicatesU1D import *
|
||||
from Functions0D import *
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||
func = pyInverseCurvature2DAngleF0D()
|
||||
Operators.recursiveSplit(func, pyParameterUP0D(0.4,0.6), NotUP1D(pyHigherLengthUP1D(100)), 2)
|
||||
shaders_list = [ConstantThicknessShader(10), IncreasingColorShader(1,0,0,1,0,1,0,1), TextureAssignerShader(3)]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
||||
|
@ -1,42 +0,0 @@
|
||||
#
|
||||
# Filename : split_at_tvertices.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws strokes that starts and stops at Tvertices (visible or not)
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesU1D import *
|
||||
from PredicatesU0D import *
|
||||
from Functions0D import *
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||
start = pyVertexNatureUP0D(Nature.T_VERTEX)
|
||||
## use the same predicate to decide where to start and where to stop
|
||||
## the strokes:
|
||||
Operators.sequentialSplit(start, start, 10)
|
||||
shaders_list = [ConstantThicknessShader(5), IncreasingColorShader(1,0,0,1,0,1,0,1), TextureAssignerShader(3)]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
||||
|
@ -1,43 +0,0 @@
|
||||
#
|
||||
# Filename : stroke_texture.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws textured strokes (illustrate the StrokeTextureShader shader)
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from shaders import *
|
||||
from ChainingIterators import *
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||
shaders_list = [
|
||||
SamplingShader(3),
|
||||
BezierCurveShader(4),
|
||||
StrokeTextureShader("washbrushAlpha.bmp", Stroke.DRY_MEDIUM, 1),
|
||||
ConstantThicknessShader(40),
|
||||
ConstantColorShader(0,0,0,1),
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,43 +0,0 @@
|
||||
#
|
||||
# Filename : suggestive.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws the suggestive contours.
|
||||
# ***** The suggestive contours must be enabled
|
||||
# in the options dialog *****
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from PredicatesU1D import *
|
||||
from shaders import *
|
||||
|
||||
upred = AndUP1D(pyNatureUP1D(Nature.SUGGESTIVE_CONTOUR), QuantitativeInvisibilityUP1D(0))
|
||||
Operators.select(upred)
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(upred))
|
||||
shaders_list = [
|
||||
IncreasingThicknessShader(1, 3),
|
||||
ConstantColorShader(0.2,0.2,0.2, 1)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,62 +0,0 @@
|
||||
#
|
||||
# Filename : thickness_fof_depth_discontinuity.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Assigns to strokes a thickness that depends on the depth discontinuity
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from ChainingIterators import *
|
||||
from shaders import *
|
||||
|
||||
class pyDepthDiscontinuityThicknessShader(StrokeShader):
|
||||
def __init__(self, min, max):
|
||||
StrokeShader.__init__(self)
|
||||
self.__min = float(min)
|
||||
self.__max = float(max)
|
||||
self.__func = ZDiscontinuityF0D()
|
||||
def getName(self):
|
||||
return "pyDepthDiscontinuityThicknessShader"
|
||||
def shade(self, stroke):
|
||||
it = stroke.strokeVerticesBegin()
|
||||
z_min=0.0
|
||||
z_max=1.0
|
||||
a = (self.__max - self.__min)/(z_max-z_min)
|
||||
b = (self.__min*z_max-self.__max*z_min)/(z_max-z_min)
|
||||
it = stroke.strokeVerticesBegin()
|
||||
while it.isEnd() == 0:
|
||||
z = self.__func(it.castToInterface0DIterator())
|
||||
thickness = a*z+b
|
||||
it.getObject().attribute().setThickness(thickness, thickness)
|
||||
it.increment()
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||
shaders_list = [
|
||||
SamplingShader(1),
|
||||
ConstantThicknessShader(3),
|
||||
ConstantColorShader(0.0,0.0,0.0),
|
||||
pyDepthDiscontinuityThicknessShader(0.8, 6)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,42 +0,0 @@
|
||||
#
|
||||
# Filename : tipremover.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Removes strokes extremities
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from ChainingIterators import *
|
||||
from shaders import *
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||
shaders_list = [
|
||||
SamplingShader(5),
|
||||
ConstantThicknessShader(3),
|
||||
ConstantColorShader(0,0,0),
|
||||
TipRemoverShader(20)
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,42 +0,0 @@
|
||||
#
|
||||
# Filename : tvertex_remover.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Removes TVertices
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
||||
# with this source distribution.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesB1D import *
|
||||
from shaders import *
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||
shaders_list = [
|
||||
IncreasingThicknessShader(3, 5),
|
||||
ConstantColorShader(0.2,0.2,0.2, 1),
|
||||
SamplingShader(10.0),
|
||||
pyTVertexRemoverShader()
|
||||
]
|
||||
Operators.create(TrueUP1D(), shaders_list)
|
@ -1,40 +0,0 @@
|
||||
from freestyle_init import *
|
||||
from logical_operators import *
|
||||
from PredicatesU1D import *
|
||||
from PredicatesU0D import *
|
||||
from PredicatesB1D import *
|
||||
from Functions0D import *
|
||||
from Functions1D import *
|
||||
from shaders import *
|
||||
|
||||
class pyDensityUP1D(UnaryPredicate1D):
|
||||
def __init__(self,wsize,threshold, integration = IntegrationType.MEAN, sampling=2.0):
|
||||
UnaryPredicate1D.__init__(self)
|
||||
self._wsize = wsize
|
||||
self._threshold = threshold
|
||||
self._integration = integration
|
||||
self._func = DensityF1D(self._wsize, self._integration, sampling)
|
||||
|
||||
def getName(self):
|
||||
return "pyDensityUP1D"
|
||||
|
||||
def __call__(self, inter):
|
||||
d = self._func(inter)
|
||||
print "For Chain ", inter.getId().getFirst(), inter.getId().getSecond(), "density is ", d
|
||||
if(d < self._threshold):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||
Operators.bidirectionalChain(ChainSilhouetteIterator())
|
||||
#Operators.sequentialSplit(pyVertexNatureUP0D(Nature.VIEW_VERTEX), 2)
|
||||
Operators.sort(pyZBP1D())
|
||||
shaders_list = [
|
||||
StrokeTextureShader("smoothAlpha.bmp", Stroke.OPAQUE_MEDIUM, 0),
|
||||
ConstantThicknessShader(3),
|
||||
SamplingShader(5.0),
|
||||
ConstantColorShader(0,0,0,1)
|
||||
]
|
||||
Operators.create(pyDensityUP1D(2,0.05, IntegrationType.MEAN,4), shaders_list)
|
||||
#Operators.create(pyDensityFunctorUP1D(8,0.03, pyGetInverseProjectedZF1D(), 0,1, IntegrationType.MEAN), shaders_list)
|
||||
|
@ -1,241 +0,0 @@
|
||||
# This module defines 3d geometrical vectors with the standard
|
||||
# operations on them.
|
||||
#
|
||||
# Written by: Konrad Hinsen
|
||||
# Last revision: 1996-1-26
|
||||
#
|
||||
|
||||
"""This module defines three-dimensional geometrical vectors. Vectors support
|
||||
the usual mathematical operations (v1, v2: vectors, s: scalar):
|
||||
v1+v2 addition
|
||||
v1-v2 subtraction
|
||||
v1*v2 scalar product
|
||||
s*v1 multiplication with a scalar
|
||||
v1/s division by a scalar
|
||||
v1.cross(v2) cross product
|
||||
v1.length() length
|
||||
v1.normal() normal vector in direction of v1
|
||||
v1.angle(v2) angle between two vectors
|
||||
v1.x(), v1[0] first element
|
||||
v1.y(), v1[1] second element
|
||||
v1.z(), v1[2] third element
|
||||
|
||||
The module offers the following items for export:
|
||||
Vec3D(x,y,z) the constructor for vectors
|
||||
isVector(x) a type check function
|
||||
ex, ey, ez unit vectors along the x-, y-, and z-axes (predefined constants)
|
||||
|
||||
Note: vector elements can be any kind of numbers on which the operations
|
||||
addition, subtraction, multiplication, division, comparison, sqrt, and acos
|
||||
are defined. Integer elements are treated as floating point elements.
|
||||
"""
|
||||
|
||||
import math, types
|
||||
|
||||
class Vec3:
|
||||
|
||||
isVec3 = 1
|
||||
|
||||
def __init__(self, x=0., y=0., z=0.):
|
||||
self.data = [x,y,z]
|
||||
|
||||
def __repr__(self):
|
||||
return 'Vec3(%s,%s,%s)' % (`self.data[0]`,\
|
||||
`self.data[1]`,`self.data[2]`)
|
||||
|
||||
def __str__(self):
|
||||
return `self.data`
|
||||
|
||||
def __add__(self, other):
|
||||
return Vec3(self.data[0]+other.data[0],\
|
||||
self.data[1]+other.data[1],self.data[2]+other.data[2])
|
||||
__radd__ = __add__
|
||||
|
||||
def __neg__(self):
|
||||
return Vec3(-self.data[0], -self.data[1], -self.data[2])
|
||||
|
||||
def __sub__(self, other):
|
||||
return Vec3(self.data[0]-other.data[0],\
|
||||
self.data[1]-other.data[1],self.data[2]-other.data[2])
|
||||
|
||||
def __rsub__(self, other):
|
||||
return Vec3(other.data[0]-self.data[0],\
|
||||
other.data[1]-self.data[1],other.data[2]-self.data[2])
|
||||
|
||||
def __mul__(self, other):
|
||||
if isVec3(other):
|
||||
return reduce(lambda a,b: a+b,
|
||||
map(lambda a,b: a*b, self.data, other.data))
|
||||
else:
|
||||
return Vec3(self.data[0]*other, self.data[1]*other,
|
||||
self.data[2]*other)
|
||||
|
||||
def __rmul__(self, other):
|
||||
if isVec3(other):
|
||||
return reduce(lambda a,b: a+b,
|
||||
map(lambda a,b: a*b, self.data, other.data))
|
||||
else:
|
||||
return Vec3(other*self.data[0], other*self.data[1],
|
||||
other*self.data[2])
|
||||
|
||||
def __div__(self, other):
|
||||
if isVec3(other):
|
||||
raise TypeError, "Can't divide by a vector"
|
||||
else:
|
||||
return Vec3(_div(self.data[0],other), _div(self.data[1],other),
|
||||
_div(self.data[2],other))
|
||||
|
||||
def __rdiv__(self, other):
|
||||
raise TypeError, "Can't divide by a vector"
|
||||
|
||||
def __cmp__(self, other):
|
||||
return cmp(self.data[0],other.data[0]) \
|
||||
or cmp(self.data[1],other.data[1]) \
|
||||
or cmp(self.data[2],other.data[2])
|
||||
|
||||
def __getitem__(self, index):
|
||||
return self.data[index]
|
||||
|
||||
def x(self):
|
||||
return self.data[0]
|
||||
def y(self):
|
||||
return self.data[1]
|
||||
def z(self):
|
||||
return self.data[2]
|
||||
|
||||
def length(self):
|
||||
return math.sqrt(self*self)
|
||||
|
||||
def normal(self):
|
||||
len = self.length()
|
||||
if len == 0:
|
||||
raise ZeroDivisionError, "Can't normalize a zero-length vector"
|
||||
return self/len
|
||||
|
||||
def cross(self, other):
|
||||
if not isVec3(other):
|
||||
raise TypeError, "Cross product with non-vector"
|
||||
return Vec3(self.data[1]*other.data[2]-self.data[2]*other.data[1],
|
||||
self.data[2]*other.data[0]-self.data[0]*other.data[2],
|
||||
self.data[0]*other.data[1]-self.data[1]*other.data[0])
|
||||
|
||||
def angle(self, other):
|
||||
if not isVec3(other):
|
||||
raise TypeError, "Angle between vector and non-vector"
|
||||
cosa = (self*other)/(self.length()*other.length())
|
||||
cosa = max(-1.,min(1.,cosa))
|
||||
return math.acos(cosa)
|
||||
|
||||
|
||||
class Vec2:
|
||||
|
||||
isVec2 = 1
|
||||
|
||||
def __init__(self, x=0., y=0.):
|
||||
self.data = [x,y]
|
||||
|
||||
def __repr__(self):
|
||||
return 'Vec2(%s,%s,%s)' % (`self.data[0]`,\
|
||||
`self.data[1]`)
|
||||
|
||||
def __str__(self):
|
||||
return `self.data`
|
||||
|
||||
def __add__(self, other):
|
||||
return Vec2(self.data[0]+other.data[0],\
|
||||
self.data[1]+other.data[1])
|
||||
__radd__ = __add__
|
||||
|
||||
def __neg__(self):
|
||||
return Vec2(-self.data[0], -self.data[1])
|
||||
|
||||
def __sub__(self, other):
|
||||
return Vec2(self.data[0]-other.data[0],\
|
||||
self.data[1]-other.data[1])
|
||||
|
||||
def __rsub__(self, other):
|
||||
return Vec2(other.data[0]-self.data[0],\
|
||||
other.data[1]-self.data[1])
|
||||
|
||||
def __mul__(self, other):
|
||||
if isVec2(other):
|
||||
return reduce(lambda a,b: a+b,
|
||||
map(lambda a,b: a*b, self.data, other.data))
|
||||
else:
|
||||
return Vec2(self.data[0]*other, self.data[1]*other)
|
||||
|
||||
def __rmul__(self, other):
|
||||
if isVec2(other):
|
||||
return reduce(lambda a,b: a+b,
|
||||
map(lambda a,b: a*b, self.data, other.data))
|
||||
else:
|
||||
return Vec2(other*self.data[0], other*self.data[1])
|
||||
|
||||
def __div__(self, other):
|
||||
if isVec2(other):
|
||||
raise TypeError, "Can't divide by a vector"
|
||||
else:
|
||||
return Vec2(_div(self.data[0],other), _div(self.data[1],other))
|
||||
|
||||
def __rdiv__(self, other):
|
||||
raise TypeError, "Can't divide by a vector"
|
||||
|
||||
def __cmp__(self, other):
|
||||
return cmp(self.data[0],other.data[0]) \
|
||||
or cmp(self.data[1],other.data[1])
|
||||
|
||||
def __getitem__(self, index):
|
||||
return self.data[index]
|
||||
|
||||
def x(self):
|
||||
return self.data[0]
|
||||
def y(self):
|
||||
return self.data[1]
|
||||
|
||||
def length(self):
|
||||
return math.sqrt(self*self)
|
||||
|
||||
def normal(self):
|
||||
len = self.length()
|
||||
if len == 0:
|
||||
raise ZeroDivisionError, "Can't normalize a zero-length vector"
|
||||
return self/len
|
||||
|
||||
#def cross(self, other):
|
||||
# if not isVec2(other):
|
||||
# raise TypeError, "Cross product with non-vector"
|
||||
# return Vec2(self.data[1]*other.data[2]-self.data[2]*other.data[1],
|
||||
# self.data[2]*other.data[0]-self.data[0]*other.data[2],
|
||||
# self.data[0]*other.data[1]-self.data[1]*other.data[0])
|
||||
|
||||
def angle(self, other):
|
||||
if not isVec2(other):
|
||||
raise TypeError, "Angle between vector and non-vector"
|
||||
cosa = (self*other)/(self.length()*other.length())
|
||||
cosa = max(-1.,min(1.,cosa))
|
||||
return math.acos(cosa)
|
||||
|
||||
|
||||
|
||||
# Type check
|
||||
|
||||
def isVec3(x):
|
||||
return hasattr(x,'isVec3')
|
||||
|
||||
def isVec2(x):
|
||||
return hasattr(x,'isVec2')
|
||||
|
||||
# "Correct" division for arbitrary number types
|
||||
|
||||
def _div(a,b):
|
||||
if type(a) == types.IntType and type(b) == types.IntType:
|
||||
return float(a)/float(b)
|
||||
else:
|
||||
return a/b
|
||||
|
||||
|
||||
# Some useful constants
|
||||
|
||||
ex = Vec3(1.,0.,0.)
|
||||
ey = Vec3(0.,1.,0.)
|
||||
ez = Vec3(0.,0.,1.)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user