diff --git a/.gitignore b/.gitignore index 6403da1..deea509 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ Release*/ *.app/ *.pyc .svn/ +*.xscheme #XCode diff --git a/example/meshExample/Project.xcconfig b/example/meshExample/Project.xcconfig deleted file mode 100644 index 72633e9..0000000 --- a/example/meshExample/Project.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -//THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. -//THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED -OF_PATH = ../../../.. - -//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE -#include "../../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" - -OTHER_LDFLAGS = $(OF_CORE_LIBS) -HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) diff --git a/example/meshExample/src/main.cpp b/example/meshExample/src/main.cpp deleted file mode 100644 index 6a32c6a..0000000 --- a/example/meshExample/src/main.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "ofMain.h" -#include "testApp.h" -#include "ofAppGlutWindow.h" - -//======================================================================== -int main( ){ - - ofAppGlutWindow window; - ofSetupOpenGL(&window, 1024,768, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new testApp()); - -} diff --git a/mesh-example/Makefile b/mesh-example/Makefile new file mode 100644 index 0000000..177e172 --- /dev/null +++ b/mesh-example/Makefile @@ -0,0 +1,13 @@ +# Attempt to load a config.make file. +# If none is found, project defaults in config.project.make will be used. +ifneq ($(wildcard config.make),) + include config.make +endif + +# make sure the the OF_ROOT location is defined +ifndef OF_ROOT + OF_ROOT=$(realpath ../../..) +endif + +# call the project makefile! +include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk diff --git a/mesh-example/Project.xcconfig b/mesh-example/Project.xcconfig new file mode 100644 index 0000000..40adc89 --- /dev/null +++ b/mesh-example/Project.xcconfig @@ -0,0 +1,18 @@ +//THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. +//THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED +OF_PATH = ../../.. + +//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE +#include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" + +//ICONS - NEW IN 0072 +ICON_NAME_DEBUG = icon-debug.icns +ICON_NAME_RELEASE = icon.icns +ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ + +//IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: +//ICON_FILE_PATH = bin/data/ + +OTHER_CFLAGS = $(OF_CORE_CFLAGS) +OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) +HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) diff --git a/example/meshExample/addons.make b/mesh-example/addons.make similarity index 100% rename from example/meshExample/addons.make rename to mesh-example/addons.make diff --git a/example/meshExample/bin/data/.gitkeep b/mesh-example/bin/data/.gitkeep similarity index 100% rename from example/meshExample/bin/data/.gitkeep rename to mesh-example/bin/data/.gitkeep diff --git a/mesh-example/config.make b/mesh-example/config.make new file mode 100644 index 0000000..df10f64 --- /dev/null +++ b/mesh-example/config.make @@ -0,0 +1,142 @@ +################################################################################ +# CONFIGURE PROJECT MAKEFILE (optional) +# This file is where we make project specific configurations. +################################################################################ + +################################################################################ +# OF ROOT +# The location of your root openFrameworks installation +# (default) OF_ROOT = ../../.. +################################################################################ +# OF_ROOT = ../../.. + +################################################################################ +# PROJECT ROOT +# The location of the project - a starting place for searching for files +# (default) PROJECT_ROOT = . (this directory) +# +################################################################################ +# PROJECT_ROOT = . + +################################################################################ +# PROJECT SPECIFIC CHECKS +# This is a project defined section to create internal makefile flags to +# conditionally enable or disable the addition of various features within +# this makefile. For instance, if you want to make changes based on whether +# GTK is installed, one might test that here and create a variable to check. +################################################################################ +# None + +################################################################################ +# PROJECT EXTERNAL SOURCE PATHS +# These are fully qualified paths that are not within the PROJECT_ROOT folder. +# Like source folders in the PROJECT_ROOT, these paths are subject to +# exlclusion via the PROJECT_EXLCUSIONS list. +# +# (default) PROJECT_EXTERNAL_SOURCE_PATHS = (blank) +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_EXTERNAL_SOURCE_PATHS = + +################################################################################ +# PROJECT EXCLUSIONS +# These makefiles assume that all folders in your current project directory +# and any listed in the PROJECT_EXTERNAL_SOURCH_PATHS are are valid locations +# to look for source code. The any folders or files that match any of the +# items in the PROJECT_EXCLUSIONS list below will be ignored. +# +# Each item in the PROJECT_EXCLUSIONS list will be treated as a complete +# string unless teh user adds a wildcard (%) operator to match subdirectories. +# GNU make only allows one wildcard for matching. The second wildcard (%) is +# treated literally. +# +# (default) PROJECT_EXCLUSIONS = (blank) +# +# Will automatically exclude the following: +# +# $(PROJECT_ROOT)/bin% +# $(PROJECT_ROOT)/obj% +# $(PROJECT_ROOT)/%.xcodeproj +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_EXCLUSIONS = + +################################################################################ +# PROJECT LINKER FLAGS +# These flags will be sent to the linker when compiling the executable. +# +# (default) PROJECT_LDFLAGS = -Wl,-rpath=./libs +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ + +# Currently, shared libraries that are needed are copied to the +# $(PROJECT_ROOT)/bin/libs directory. The following LDFLAGS tell the linker to +# add a runtime path to search for those shared libraries, since they aren't +# incorporated directly into the final executable application binary. +# TODO: should this be a default setting? +# PROJECT_LDFLAGS=-Wl,-rpath=./libs + +################################################################################ +# PROJECT DEFINES +# Create a space-delimited list of DEFINES. The list will be converted into +# CFLAGS with the "-D" flag later in the makefile. +# +# (default) PROJECT_DEFINES = (blank) +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_DEFINES = + +################################################################################ +# PROJECT CFLAGS +# This is a list of fully qualified CFLAGS required when compiling for this +# project. These CFLAGS will be used IN ADDITION TO the PLATFORM_CFLAGS +# defined in your platform specific core configuration files. These flags are +# presented to the compiler BEFORE the PROJECT_OPTIMIZATION_CFLAGS below. +# +# (default) PROJECT_CFLAGS = (blank) +# +# Note: Before adding PROJECT_CFLAGS, note that the PLATFORM_CFLAGS defined in +# your platform specific configuration file will be applied by default and +# further flags here may not be needed. +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_CFLAGS = + +################################################################################ +# PROJECT OPTIMIZATION CFLAGS +# These are lists of CFLAGS that are target-specific. While any flags could +# be conditionally added, they are usually limited to optimization flags. +# These flags are added BEFORE the PROJECT_CFLAGS. +# +# PROJECT_OPTIMIZATION_CFLAGS_RELEASE flags are only applied to RELEASE targets. +# +# (default) PROJECT_OPTIMIZATION_CFLAGS_RELEASE = (blank) +# +# PROJECT_OPTIMIZATION_CFLAGS_DEBUG flags are only applied to DEBUG targets. +# +# (default) PROJECT_OPTIMIZATION_CFLAGS_DEBUG = (blank) +# +# Note: Before adding PROJECT_OPTIMIZATION_CFLAGS, please note that the +# PLATFORM_OPTIMIZATION_CFLAGS defined in your platform specific configuration +# file will be applied by default and further optimization flags here may not +# be needed. +# +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_OPTIMIZATION_CFLAGS_RELEASE = +# PROJECT_OPTIMIZATION_CFLAGS_DEBUG = + +################################################################################ +# PROJECT COMPILERS +# Custom compilers can be set for CC and CXX +# (default) PROJECT_CXX = (blank) +# (default) PROJECT_CC = (blank) +# Note: Leave a leading space when adding list items with the += operator +################################################################################ +# PROJECT_CXX = +# PROJECT_CC = diff --git a/mesh-example/mesh-example.xcodeproj/project.pbxproj b/mesh-example/mesh-example.xcodeproj/project.pbxproj new file mode 100644 index 0000000..2eb9936 --- /dev/null +++ b/mesh-example/mesh-example.xcodeproj/project.pbxproj @@ -0,0 +1,1026 @@ + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + FA6C0DF4233B43736D02B9DF + + explicitFileType + sourcecode.c.h + fileEncoding + 4 + isa + PBXFileReference + name + triangle.h + path + ../../../addons/ofxTriangleMesh/libs/Triangle/triangle.h + sourceTree + SOURCE_ROOT + + 7E04D4FAB9708987A9D19718 + + children + + ABF28C7157E1DADBE1455653 + FA6C0DF4233B43736D02B9DF + + isa + PBXGroup + name + Triangle + sourceTree + <group> + + FCAA0CCA876CD31F282D632F + + children + + 7E04D4FAB9708987A9D19718 + + isa + PBXGroup + name + libs + sourceTree + <group> + + B785CDB78D2067AB031E24C6 + + fileRef + ABF28C7157E1DADBE1455653 + isa + PBXBuildFile + + ABF28C7157E1DADBE1455653 + + explicitFileType + sourcecode.cpp.cpp + fileEncoding + 4 + isa + PBXFileReference + name + triangle.cpp + path + ../../../addons/ofxTriangleMesh/libs/Triangle/triangle.cpp + sourceTree + SOURCE_ROOT + + A48C2EE79755E01993783646 + + explicitFileType + sourcecode.c.h + fileEncoding + 4 + isa + PBXFileReference + name + ofxTriangleMesh.h + path + ../../../addons/ofxTriangleMesh/src/ofxTriangleMesh.h + sourceTree + SOURCE_ROOT + + 374C131120F53C04B100FE90 + + children + + 1D97F80E506113C713ABE73A + A48C2EE79755E01993783646 + + isa + PBXGroup + name + src + sourceTree + <group> + + 53BEBF43328554CDA832CC05 + + children + + 374C131120F53C04B100FE90 + FCAA0CCA876CD31F282D632F + + isa + PBXGroup + name + ofxTriangleMesh + sourceTree + <group> + + C923580B2C35039D972BA5F5 + + fileRef + 1D97F80E506113C713ABE73A + isa + PBXBuildFile + + 1D97F80E506113C713ABE73A + + explicitFileType + sourcecode.cpp.cpp + fileEncoding + 4 + isa + PBXFileReference + name + ofxTriangleMesh.cpp + path + ../../../addons/ofxTriangleMesh/src/ofxTriangleMesh.cpp + sourceTree + SOURCE_ROOT + + 6948EE371B920CB800B5AC1A + + children + + isa + PBXGroup + name + local_addons + sourceTree + <group> + + 8466F1851C04CA0E00918B1C + + buildActionMask + 12 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + echo "$GCC_PREPROCESSOR_DEFINITIONS"; +APPSTORE=`expr "$GCC_PREPROCESSOR_DEFINITIONS" : ".*APPSTORE=\([0-9]*\)"` +if [ -z "$APPSTORE" ] ; then +echo "Note: Not copying bin/data to App Package or doing App Code signing. Use AppStore target for AppStore distribution"; +else +# Copy bin/data into App/Resources +rsync -avz --exclude='.DS_Store' "${SRCROOT}/bin/data/" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/data/" + +# ---- Code Sign App Package ---- + +# WARNING: You may have to run Clean in Xcode after changing CODE_SIGN_IDENTITY! + +# Verify that $CODE_SIGN_IDENTITY is set +if [ -z "${CODE_SIGN_IDENTITY}" ] ; then +echo "CODE_SIGN_IDENTITY needs to be set for framework code-signing" +exit 0 +fi + +if [ -z "${CODE_SIGN_ENTITLEMENTS}" ] ; then +echo "CODE_SIGN_ENTITLEMENTS needs to be set for framework code-signing!" + +if [ "${CONFIGURATION}" = "Release" ] ; then +exit 1 +else +# Code-signing is optional for non-release builds. +exit 0 +fi +fi + +ITEMS="" + +FRAMEWORKS_DIR="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +echo "$FRAMEWORKS_DIR" +if [ -d "$FRAMEWORKS_DIR" ] ; then +FRAMEWORKS=$(find "${FRAMEWORKS_DIR}" -depth -type d -name "*.framework" -or -name "*.dylib" -or -name "*.bundle" | sed -e "s/\(.*framework\)/\1\/Versions\/A\//") +RESULT=$? +if [[ $RESULT != 0 ]] ; then +exit 1 +fi + +ITEMS="${FRAMEWORKS}" +fi + +LOGINITEMS_DIR="${TARGET_BUILD_DIR}/${CONTENTS_FOLDER_PATH}/Library/LoginItems/" +if [ -d "$LOGINITEMS_DIR" ] ; then +LOGINITEMS=$(find "${LOGINITEMS_DIR}" -depth -type d -name "*.app") +RESULT=$? +if [[ $RESULT != 0 ]] ; then +exit 1 +fi + +ITEMS="${ITEMS}"$'\n'"${LOGINITEMS}" +fi + +# Prefer the expanded name, if available. +CODE_SIGN_IDENTITY_FOR_ITEMS="${EXPANDED_CODE_SIGN_IDENTITY_NAME}" +if [ "${CODE_SIGN_IDENTITY_FOR_ITEMS}" = "" ] ; then +# Fall back to old behavior. +CODE_SIGN_IDENTITY_FOR_ITEMS="${CODE_SIGN_IDENTITY}" +fi + +echo "Identity:" +echo "${CODE_SIGN_IDENTITY_FOR_ITEMS}" + +echo "Entitlements:" +echo "${CODE_SIGN_ENTITLEMENTS}" + +echo "Found:" +echo "${ITEMS}" + +# Change the Internal Field Separator (IFS) so that spaces in paths will not cause problems below. +SAVED_IFS=$IFS +IFS=$(echo -en "\n\b") + +# Loop through all items. +for ITEM in $ITEMS; +do +echo "Signing '${ITEM}'" +codesign --force --verbose --sign "${CODE_SIGN_IDENTITY_FOR_ITEMS}" --entitlements "${CODE_SIGN_ENTITLEMENTS}" "${ITEM}" +RESULT=$? +if [[ $RESULT != 0 ]] ; then +echo "Failed to sign '${ITEM}'." +IFS=$SAVED_IFS +exit 1 +fi +done + +# Restore $IFS. +IFS=$SAVED_IFS + +fi + + + 99FA3DBB1C7456C400CFA0EE + + baseConfigurationReference + E4EB6923138AFD0F00A09F29 + buildSettings + + HEADER_SEARCH_PATHS + + $(OF_CORE_HEADERS) + src + ../../../addons/ofxTriangleMesh/libs + ../../../addons/ofxTriangleMesh/libs/Triangle + ../../../addons/ofxTriangleMesh/src + + CONFIGURATION_BUILD_DIR + $(SRCROOT)/bin/ + COPY_PHASE_STRIP + YES + DEAD_CODE_STRIPPING + YES + GCC_AUTO_VECTORIZATION + YES + GCC_ENABLE_SSE3_EXTENSIONS + YES + GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS + YES + GCC_INLINES_ARE_PRIVATE_EXTERN + NO + GCC_OPTIMIZATION_LEVEL + 3 + GCC_PREPROCESSOR_DEFINITIONS[arch=*] + DISTRIBUTION=1 + GCC_SYMBOLS_PRIVATE_EXTERN + NO + GCC_UNROLL_LOOPS + YES + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS + YES + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO + NO + GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL + NO + GCC_WARN_UNINITIALIZED_AUTOS + NO + GCC_WARN_UNUSED_VALUE + NO + GCC_WARN_UNUSED_VARIABLE + NO + MACOSX_DEPLOYMENT_TARGET + 10.9 + OTHER_CPLUSPLUSFLAGS + + -D__MACOSX_CORE__ + -mtune=native + + SDKROOT + macosx + + isa + XCBuildConfiguration + name + AppStore + + 99FA3DBC1C7456C400CFA0EE + + baseConfigurationReference + E4EB6923138AFD0F00A09F29 + buildSettings + + HEADER_SEARCH_PATHS + + $(OF_CORE_HEADERS) + src + ../../../addons/ofxTriangleMesh/libs + ../../../addons/ofxTriangleMesh/libs/Triangle + ../../../addons/ofxTriangleMesh/src + + COMBINE_HIDPI_IMAGES + YES + COPY_PHASE_STRIP + YES + FRAMEWORK_SEARCH_PATHS + + $(inherited) + + GCC_GENERATE_DEBUGGING_SYMBOLS + YES + GCC_MODEL_TUNING + NONE + GCC_PREPROCESSOR_DEFINITIONS[arch=*] + APPSTORE=1 + ICON + $(ICON_NAME_RELEASE) + ICON_FILE + $(ICON_FILE_PATH)$(ICON) + INFOPLIST_FILE + openFrameworks-Info.plist + INSTALL_PATH + /Applications + LIBRARY_SEARCH_PATHS + $(inherited) + PRODUCT_NAME + $(TARGET_NAME) + WRAPPER_EXTENSION + app + baseConfigurationReference + E4EB6923138AFD0F00A09F29 + + isa + XCBuildConfiguration + name + AppStore + + BB4B014C10F69532006C3DED + + children + + 53BEBF43328554CDA832CC05 + + isa + PBXGroup + name + addons + sourceTree + <group> + + E4328143138ABC890047C5CB + + isa + PBXFileReference + lastKnownFileType + wrapper.pb-project + name + openFrameworksLib.xcodeproj + path + ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj + sourceTree + SOURCE_ROOT + + E4328144138ABC890047C5CB + + children + + E4328148138ABC890047C5CB + + isa + PBXGroup + name + Products + sourceTree + <group> + + E4328147138ABC890047C5CB + + containerPortal + E4328143138ABC890047C5CB + isa + PBXContainerItemProxy + proxyType + 2 + remoteGlobalIDString + E4B27C1510CBEB8E00536013 + remoteInfo + openFrameworks + + E4328148138ABC890047C5CB + + fileType + archive.ar + isa + PBXReferenceProxy + path + openFrameworksDebug.a + remoteRef + E4328147138ABC890047C5CB + sourceTree + BUILT_PRODUCTS_DIR + + E4328149138ABC9F0047C5CB + + fileRef + E4328148138ABC890047C5CB + isa + PBXBuildFile + + E4B69B4A0A3A1720003C02F2 + + children + + E4B6FCAD0C3E899E008CF71C + E4EB6923138AFD0F00A09F29 + E4B69E1C0A3A1BDC003C02F2 + E4EEC9E9138DF44700A80321 + BB4B014C10F69532006C3DED + 6948EE371B920CB800B5AC1A + E4B69B5B0A3A1756003C02F2 + + isa + PBXGroup + sourceTree + <group> + + E4B69B4C0A3A1720003C02F2 + + attributes + + LastUpgradeCheck + 0600 + + buildConfigurationList + E4B69B4D0A3A1720003C02F2 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + English + Japanese + French + German + + mainGroup + E4B69B4A0A3A1720003C02F2 + productRefGroup + E4B69B4A0A3A1720003C02F2 + projectDirPath + + projectReferences + + + ProductGroup + E4328144138ABC890047C5CB + ProjectRef + E4328143138ABC890047C5CB + + + projectRoot + + targets + + E4B69B5A0A3A1756003C02F2 + + + E4B69B4D0A3A1720003C02F2 + + buildConfigurations + + E4B69B4E0A3A1720003C02F2 + E4B69B4F0A3A1720003C02F2 + 99FA3DBB1C7456C400CFA0EE + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + E4B69B4E0A3A1720003C02F2 + + baseConfigurationReference + E4EB6923138AFD0F00A09F29 + buildSettings + + HEADER_SEARCH_PATHS + + $(OF_CORE_HEADERS) + src + ../../../addons/ofxTriangleMesh/libs + ../../../addons/ofxTriangleMesh/libs/Triangle + ../../../addons/ofxTriangleMesh/src + + CONFIGURATION_BUILD_DIR + $(SRCROOT)/bin/ + COPY_PHASE_STRIP + NO + DEAD_CODE_STRIPPING + YES + GCC_AUTO_VECTORIZATION + YES + GCC_ENABLE_SSE3_EXTENSIONS + YES + GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS + YES + GCC_INLINES_ARE_PRIVATE_EXTERN + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_SYMBOLS_PRIVATE_EXTERN + NO + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS + YES + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO + NO + GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL + NO + GCC_WARN_UNINITIALIZED_AUTOS + NO + GCC_WARN_UNUSED_VALUE + NO + GCC_WARN_UNUSED_VARIABLE + NO + MACOSX_DEPLOYMENT_TARGET + 10.9 + ONLY_ACTIVE_ARCH + YES + OTHER_CPLUSPLUSFLAGS + + -D__MACOSX_CORE__ + -mtune=native + + SDKROOT + macosx + + isa + XCBuildConfiguration + name + Debug + + E4B69B4F0A3A1720003C02F2 + + baseConfigurationReference + E4EB6923138AFD0F00A09F29 + buildSettings + + HEADER_SEARCH_PATHS + + $(OF_CORE_HEADERS) + src + ../../../addons/ofxTriangleMesh/libs + ../../../addons/ofxTriangleMesh/libs/Triangle + ../../../addons/ofxTriangleMesh/src + + CONFIGURATION_BUILD_DIR + $(SRCROOT)/bin/ + COPY_PHASE_STRIP + YES + DEAD_CODE_STRIPPING + YES + GCC_AUTO_VECTORIZATION + YES + GCC_ENABLE_SSE3_EXTENSIONS + YES + GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS + YES + GCC_INLINES_ARE_PRIVATE_EXTERN + NO + GCC_OPTIMIZATION_LEVEL + 3 + GCC_SYMBOLS_PRIVATE_EXTERN + NO + GCC_UNROLL_LOOPS + YES + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS + YES + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO + NO + GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL + NO + GCC_WARN_UNINITIALIZED_AUTOS + NO + GCC_WARN_UNUSED_VALUE + NO + GCC_WARN_UNUSED_VARIABLE + NO + MACOSX_DEPLOYMENT_TARGET + 10.9 + OTHER_CPLUSPLUSFLAGS + + -D__MACOSX_CORE__ + -mtune=native + + SDKROOT + macosx + + isa + XCBuildConfiguration + name + Release + + E4B69B580A3A1756003C02F2 + + buildActionMask + 2147483647 + files + + E4B69E200A3A1BDC003C02F2 + E4B69E210A3A1BDC003C02F2 + C923580B2C35039D972BA5F5 + B785CDB78D2067AB031E24C6 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + E4B69B590A3A1756003C02F2 + + buildActionMask + 2147483647 + files + + E4328149138ABC9F0047C5CB + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + E4B69B5A0A3A1756003C02F2 + + buildConfigurationList + E4B69B5F0A3A1757003C02F2 + buildPhases + + E4B69B580A3A1756003C02F2 + E4B69B590A3A1756003C02F2 + E4B6FFFD0C3F9AB9008CF71C + E4C2427710CC5ABF004149E2 + 8466F1851C04CA0E00918B1C + + buildRules + + dependencies + + E4EEB9AC138B136A00A80321 + + isa + PBXNativeTarget + name + mesh-example + productName + myOFApp + productReference + E4B69B5B0A3A1756003C02F2 + productType + com.apple.product-type.application + + E4B69B5B0A3A1756003C02F2 + + explicitFileType + wrapper.application + includeInIndex + 0 + isa + PBXFileReference + path + mesh-exampleDebug.app + sourceTree + BUILT_PRODUCTS_DIR + + E4B69B5F0A3A1757003C02F2 + + buildConfigurations + + E4B69B600A3A1757003C02F2 + E4B69B610A3A1757003C02F2 + 99FA3DBC1C7456C400CFA0EE + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + E4B69B600A3A1757003C02F2 + + baseConfigurationReference + E4EB6923138AFD0F00A09F29 + buildSettings + + HEADER_SEARCH_PATHS + + $(OF_CORE_HEADERS) + src + ../../../addons/ofxTriangleMesh/libs + ../../../addons/ofxTriangleMesh/libs/Triangle + ../../../addons/ofxTriangleMesh/src + + COMBINE_HIDPI_IMAGES + YES + COPY_PHASE_STRIP + NO + FRAMEWORK_SEARCH_PATHS + + $(inherited) + + GCC_DYNAMIC_NO_PIC + NO + GCC_GENERATE_DEBUGGING_SYMBOLS + YES + GCC_MODEL_TUNING + NONE + ICON + $(ICON_NAME_DEBUG) + ICON_FILE + $(ICON_FILE_PATH)$(ICON) + INFOPLIST_FILE + openFrameworks-Info.plist + INSTALL_PATH + /Applications + LIBRARY_SEARCH_PATHS + $(inherited) + PRODUCT_NAME + $(TARGET_NAME)Debug + WRAPPER_EXTENSION + app + + isa + XCBuildConfiguration + name + Debug + + E4B69B610A3A1757003C02F2 + + baseConfigurationReference + E4EB6923138AFD0F00A09F29 + buildSettings + + HEADER_SEARCH_PATHS + + $(OF_CORE_HEADERS) + src + ../../../addons/ofxTriangleMesh/libs + ../../../addons/ofxTriangleMesh/libs/Triangle + ../../../addons/ofxTriangleMesh/src + + COMBINE_HIDPI_IMAGES + YES + COPY_PHASE_STRIP + YES + FRAMEWORK_SEARCH_PATHS + + $(inherited) + + GCC_GENERATE_DEBUGGING_SYMBOLS + YES + GCC_MODEL_TUNING + NONE + ICON + $(ICON_NAME_RELEASE) + ICON_FILE + $(ICON_FILE_PATH)$(ICON) + INFOPLIST_FILE + openFrameworks-Info.plist + INSTALL_PATH + /Applications + LIBRARY_SEARCH_PATHS + $(inherited) + PRODUCT_NAME + $(TARGET_NAME) + WRAPPER_EXTENSION + app + baseConfigurationReference + E4EB6923138AFD0F00A09F29 + + isa + XCBuildConfiguration + name + Release + + E4B69E1C0A3A1BDC003C02F2 + + children + + E4B69E1D0A3A1BDC003C02F2 + E4B69E1E0A3A1BDC003C02F2 + E4B69E1F0A3A1BDC003C02F2 + + isa + PBXGroup + path + src + sourceTree + SOURCE_ROOT + + E4B69E1D0A3A1BDC003C02F2 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.cpp.cpp + name + main.cpp + path + src/main.cpp + sourceTree + SOURCE_ROOT + + E4B69E1E0A3A1BDC003C02F2 + + explicitFileType + sourcecode.cpp.cpp + fileEncoding + 4 + isa + PBXFileReference + name + ofApp.cpp + path + src/ofApp.cpp + sourceTree + SOURCE_ROOT + + E4B69E1F0A3A1BDC003C02F2 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + ofApp.h + path + src/ofApp.h + sourceTree + SOURCE_ROOT + + E4B69E200A3A1BDC003C02F2 + + fileRef + E4B69E1D0A3A1BDC003C02F2 + isa + PBXBuildFile + + E4B69E210A3A1BDC003C02F2 + + fileRef + E4B69E1E0A3A1BDC003C02F2 + isa + PBXBuildFile + + E4B6FCAD0C3E899E008CF71C + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + openFrameworks-Info.plist + sourceTree + <group> + + E4B6FFFD0C3F9AB9008CF71C + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + mkdir -p "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/" +# Copy default icon file into App/Resources +rsync -aved "$ICON_FILE" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/" +# Copy libfmod and change install directory for fmod to run +rsync -aved "$OF_PATH/libs/fmodex/lib/osx/libfmodex.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/"; +install_name_tool -change @executable_path/libfmodex.dylib @executable_path/../Frameworks/libfmodex.dylib "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME"; + +echo "$GCC_PREPROCESSOR_DEFINITIONS"; + + + E4C2427710CC5ABF004149E2 + + buildActionMask + 2147483647 + dstPath + + dstSubfolderSpec + 10 + files + + isa + PBXCopyFilesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + E4EB691F138AFCF100A09F29 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + CoreOF.xcconfig + path + ../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig + sourceTree + SOURCE_ROOT + + E4EB6923138AFD0F00A09F29 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Project.xcconfig + sourceTree + <group> + + E4EEB9AB138B136A00A80321 + + containerPortal + E4328143138ABC890047C5CB + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + E4B27C1410CBEB8E00536013 + remoteInfo + openFrameworks + + E4EEB9AC138B136A00A80321 + + isa + PBXTargetDependency + name + openFrameworks + targetProxy + E4EEB9AB138B136A00A80321 + + E4EEC9E9138DF44700A80321 + + children + + E4EB691F138AFCF100A09F29 + E4328143138ABC890047C5CB + + isa + PBXGroup + name + openFrameworks + sourceTree + <group> + + + rootObject + E4B69B4C0A3A1720003C02F2 + + diff --git a/mesh-example/mesh-example.xcodeproj/xcshareddata/xcschemes/mesh-example Debug.xcscheme b/mesh-example/mesh-example.xcodeproj/xcshareddata/xcschemes/mesh-example Debug.xcscheme new file mode 100644 index 0000000..d26d0c9 --- /dev/null +++ b/mesh-example/mesh-example.xcodeproj/xcshareddata/xcschemes/mesh-example Debug.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mesh-example/mesh-example.xcodeproj/xcshareddata/xcschemes/mesh-example Release.xcscheme b/mesh-example/mesh-example.xcodeproj/xcshareddata/xcschemes/mesh-example Release.xcscheme new file mode 100644 index 0000000..98c4c02 --- /dev/null +++ b/mesh-example/mesh-example.xcodeproj/xcshareddata/xcschemes/mesh-example Release.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/meshExample/meshExample.xcodeproj/project.pbxproj b/mesh-example/meshExample.xcodeproj/project.pbxproj similarity index 100% rename from example/meshExample/meshExample.xcodeproj/project.pbxproj rename to mesh-example/meshExample.xcodeproj/project.pbxproj diff --git a/example/meshExample/meshExample.xcodeproj/xcshareddata/xcschemes/meshExample Debug.xcscheme b/mesh-example/meshExample.xcodeproj/xcshareddata/xcschemes/meshExample Debug.xcscheme similarity index 100% rename from example/meshExample/meshExample.xcodeproj/xcshareddata/xcschemes/meshExample Debug.xcscheme rename to mesh-example/meshExample.xcodeproj/xcshareddata/xcschemes/meshExample Debug.xcscheme diff --git a/example/meshExample/meshExample.xcodeproj/xcshareddata/xcschemes/meshExample Release.xcscheme b/mesh-example/meshExample.xcodeproj/xcshareddata/xcschemes/meshExample Release.xcscheme similarity index 100% rename from example/meshExample/meshExample.xcodeproj/xcshareddata/xcschemes/meshExample Release.xcscheme rename to mesh-example/meshExample.xcodeproj/xcshareddata/xcschemes/meshExample Release.xcscheme diff --git a/example/meshExample/openFrameworks-Info.plist b/mesh-example/openFrameworks-Info.plist similarity index 70% rename from example/meshExample/openFrameworks-Info.plist rename to mesh-example/openFrameworks-Info.plist index e5db555..8d64d2b 100644 --- a/example/meshExample/openFrameworks-Info.plist +++ b/mesh-example/openFrameworks-Info.plist @@ -1,5 +1,5 @@ - + CFBundleDevelopmentRegion @@ -7,7 +7,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.yourcompany.openFrameworks + cc.openFrameworks.ofapp CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType @@ -16,5 +16,7 @@ ???? CFBundleVersion 1.0 + CFBundleIconFile + ${ICON} diff --git a/mesh-example/src/main.cpp b/mesh-example/src/main.cpp new file mode 100644 index 0000000..16f13dd --- /dev/null +++ b/mesh-example/src/main.cpp @@ -0,0 +1,14 @@ +#include "ofMain.h" +#include "ofApp.h" + +//======================================================================== +int main( ){ + + ofSetupOpenGL(1024,768,OF_WINDOW); + + // this kicks off the running of my app + // can be OF_WINDOW or OF_FULLSCREEN + // pass in width and height too: + ofRunApp( new ofApp()); + +} diff --git a/example/meshExample/src/testApp.cpp b/mesh-example/src/ofApp.cpp similarity index 80% rename from example/meshExample/src/testApp.cpp rename to mesh-example/src/ofApp.cpp index 8143a8f..9f79589 100644 --- a/example/meshExample/src/testApp.cpp +++ b/mesh-example/src/ofApp.cpp @@ -1,18 +1,18 @@ -#include "testApp.h" +#include "ofApp.h" //-------------------------------------------------------------- -void testApp::setup(){ +void ofApp::setup(){ } //-------------------------------------------------------------- -void testApp::update(){ +void ofApp::update(){ } //-------------------------------------------------------------- -void testApp::draw(){ +void ofApp::draw(){ ofBackgroundGradient(ofColor::white, ofColor(200,200,200), OF_GRADIENT_LINEAR); @@ -24,36 +24,36 @@ void testApp::draw(){ } //-------------------------------------------------------------- -void testApp::keyPressed(int key){ +void ofApp::keyPressed(int key){ } //-------------------------------------------------------------- -void testApp::keyReleased(int key){ +void ofApp::keyReleased(int key){ } //-------------------------------------------------------------- -void testApp::mouseMoved(int x, int y ){ +void ofApp::mouseMoved(int x, int y ){ } //-------------------------------------------------------------- -void testApp::mouseDragged(int x, int y, int button){ +void ofApp::mouseDragged(int x, int y, int button){ line.addVertex(ofPoint(x, y)); } //-------------------------------------------------------------- -void testApp::mousePressed(int x, int y, int button){ +void ofApp::mousePressed(int x, int y, int button){ line.clear(); line.addVertex(ofPoint(x, y)); } //-------------------------------------------------------------- -void testApp::mouseReleased(int x, int y, int button){ +void ofApp::mouseReleased(int x, int y, int button){ if (line.size() > 2){ @@ -84,16 +84,16 @@ void testApp::mouseReleased(int x, int y, int button){ } //-------------------------------------------------------------- -void testApp::windowResized(int w, int h){ +void ofApp::windowResized(int w, int h){ } //-------------------------------------------------------------- -void testApp::gotMessage(ofMessage msg){ +void ofApp::gotMessage(ofMessage msg){ } //-------------------------------------------------------------- -void testApp::dragEvent(ofDragInfo dragInfo){ +void ofApp::dragEvent(ofDragInfo dragInfo){ -} \ No newline at end of file +} diff --git a/example/meshExample/src/testApp.h b/mesh-example/src/ofApp.h similarity index 94% rename from example/meshExample/src/testApp.h rename to mesh-example/src/ofApp.h index 24c3541..b16a686 100644 --- a/example/meshExample/src/testApp.h +++ b/mesh-example/src/ofApp.h @@ -4,8 +4,7 @@ #include "ofxTriangleMesh.h" - -class testApp : public ofBaseApp{ +class ofApp : public ofBaseApp{ public: void setup(); diff --git a/src/ofxTriangleMesh.cpp b/src/ofxTriangleMesh.cpp index f33de83..37eda50 100755 --- a/src/ofxTriangleMesh.cpp +++ b/src/ofxTriangleMesh.cpp @@ -1,12 +1,6 @@ #include "ofxTriangleMesh.h" #include "triangle.h" - - - - - - void triangulatePoints(char * flags, triangulateio * in, triangulateio * mid, triangulateio * out){ @@ -95,7 +89,7 @@ void ofxTriangleMesh::triangulate(ofPolyline contour, float angleConstraint, flo std::map < int , ofPoint > goodPts; - + ofPoint cachedVertex; for (int i = 0; i < out.numberoftriangles; i++) { meshTriangle triangle; @@ -117,8 +111,12 @@ void ofxTriangleMesh::triangulate(ofPolyline contour, float angleConstraint, flo // here we check if a triangle is "inside" a contour to drop non inner triangles - - if( isPointInsidePolygon(&contour[0], contour.size(), getTriangleCenter(tr) ) ) { + cachedVertex.x =contour[0].x; + cachedVertex.y =contour[0].y; + cachedVertex.z =contour[0].z; + if( isPointInsidePolygon(&cachedVertex, + contour.size(), + getTriangleCenter(tr) ) ) { triangle.randomColor = ofColor(ofRandom(0,255), ofRandom(0,255), ofRandom(0,255)); triangles.push_back(triangle); @@ -192,7 +190,7 @@ ofPoint ofxTriangleMesh::getTriangleCenter(ofPoint *tr){ return ofPoint(c_x, c_y); } -bool ofxTriangleMesh::isPointInsidePolygon(ofPoint *polygon,int N, ofPoint p) +bool ofxTriangleMesh::isPointInsidePolygon(const ofPoint *polygon,int N, ofPoint p) { int counter = 0; int i; diff --git a/src/ofxTriangleMesh.h b/src/ofxTriangleMesh.h index 06d8944..d46944f 100755 --- a/src/ofxTriangleMesh.h +++ b/src/ofxTriangleMesh.h @@ -65,7 +65,7 @@ class ofxTriangleMesh { ofPoint getTriangleCenter(ofPoint *tr); - bool isPointInsidePolygon(ofPoint *polygon,int N, ofPoint p); + bool isPointInsidePolygon(const ofPoint *polygon,int N, ofPoint p); void draw(); void clear(); @@ -79,4 +79,4 @@ class ofxTriangleMesh { -}; \ No newline at end of file +};