Showing preview only (936K chars total). Download the full file or copy to clipboard to get everything.
Repository: abau/dilay
Branch: master
Commit: 50038bf3431f
Files: 232
Total size: 874.3 KB
Directory structure:
gitextract_luuhfc7x/
├── .clang-format
├── .gitignore
├── LICENSE.txt
├── README.md
├── app/
│ ├── app.pro
│ └── src/
│ └── main.cpp
├── common.pri
├── dilay.pro
├── icon.tex
├── lib/
│ ├── lib.pro
│ └── src/
│ ├── IsosurfaceExtractionConfigurations.hs
│ ├── bitset.hpp
│ ├── cache.hpp
│ ├── camera.cpp
│ ├── camera.hpp
│ ├── color.cpp
│ ├── color.hpp
│ ├── config.cpp
│ ├── config.hpp
│ ├── configurable.cpp
│ ├── configurable.hpp
│ ├── dimension.cpp
│ ├── dimension.hpp
│ ├── distance.cpp
│ ├── distance.hpp
│ ├── dynamic/
│ │ ├── faces.cpp
│ │ ├── faces.hpp
│ │ ├── mesh-intersection.cpp
│ │ ├── mesh-intersection.hpp
│ │ ├── mesh.cpp
│ │ ├── mesh.hpp
│ │ ├── octree.cpp
│ │ └── octree.hpp
│ ├── hash.hpp
│ ├── history.cpp
│ ├── history.hpp
│ ├── import-export.cpp
│ ├── import-export.hpp
│ ├── intersection.cpp
│ ├── intersection.hpp
│ ├── isosurface-extraction/
│ │ ├── IsosurfaceExtractionConfigurations.hs
│ │ ├── grid.cpp
│ │ └── grid.hpp
│ ├── isosurface-extraction.cpp
│ ├── isosurface-extraction.hpp
│ ├── kvstore.cpp
│ ├── kvstore.hpp
│ ├── log.cpp
│ ├── log.hpp
│ ├── macro.hpp
│ ├── maybe.hpp
│ ├── mesh-util.cpp
│ ├── mesh-util.hpp
│ ├── mesh.cpp
│ ├── mesh.hpp
│ ├── mirror.cpp
│ ├── mirror.hpp
│ ├── opengl-buffer-id.cpp
│ ├── opengl-buffer-id.hpp
│ ├── opengl.cpp
│ ├── opengl.hpp
│ ├── primitive/
│ │ ├── aabox.cpp
│ │ ├── aabox.hpp
│ │ ├── cone-sphere.cpp
│ │ ├── cone-sphere.hpp
│ │ ├── cone.cpp
│ │ ├── cone.hpp
│ │ ├── cylinder.cpp
│ │ ├── cylinder.hpp
│ │ ├── plane.cpp
│ │ ├── plane.hpp
│ │ ├── ray.cpp
│ │ ├── ray.hpp
│ │ ├── sphere.cpp
│ │ ├── sphere.hpp
│ │ ├── triangle.cpp
│ │ └── triangle.hpp
│ ├── render-mode.cpp
│ ├── render-mode.hpp
│ ├── renderer.cpp
│ ├── renderer.hpp
│ ├── scene.cpp
│ ├── scene.hpp
│ ├── shader.cpp
│ ├── shader.hpp
│ ├── sketch/
│ │ ├── bone-intersection.cpp
│ │ ├── bone-intersection.hpp
│ │ ├── fwd.hpp
│ │ ├── mesh-intersection.cpp
│ │ ├── mesh-intersection.hpp
│ │ ├── mesh.cpp
│ │ ├── mesh.hpp
│ │ ├── node-intersection.cpp
│ │ ├── node-intersection.hpp
│ │ ├── path-intersection.cpp
│ │ ├── path-intersection.hpp
│ │ ├── path.cpp
│ │ └── path.hpp
│ ├── state.cpp
│ ├── state.hpp
│ ├── time-delta.cpp
│ ├── time-delta.hpp
│ ├── tool/
│ │ ├── convert-sketch.cpp
│ │ ├── delete-mesh.cpp
│ │ ├── delete-sketch.cpp
│ │ ├── edit-sketch.cpp
│ │ ├── key.hpp
│ │ ├── move-camera.cpp
│ │ ├── move-camera.hpp
│ │ ├── new-mesh.cpp
│ │ ├── remesh.cpp
│ │ ├── sculpt/
│ │ │ ├── crease.cpp
│ │ │ ├── draw.cpp
│ │ │ ├── flatten.cpp
│ │ │ ├── grab.cpp
│ │ │ ├── pinch.cpp
│ │ │ ├── reduce.cpp
│ │ │ ├── smooth.cpp
│ │ │ └── util/
│ │ │ ├── action.cpp
│ │ │ ├── action.hpp
│ │ │ ├── brush.cpp
│ │ │ ├── brush.hpp
│ │ │ ├── edge-collection.cpp
│ │ │ └── edge-collection.hpp
│ │ ├── sculpt.cpp
│ │ ├── sculpt.hpp
│ │ ├── sketch-spheres.cpp
│ │ ├── transform-mesh.cpp
│ │ ├── trim-mesh/
│ │ │ ├── action.cpp
│ │ │ ├── action.hpp
│ │ │ ├── border.cpp
│ │ │ ├── border.hpp
│ │ │ ├── split-mesh.cpp
│ │ │ └── split-mesh.hpp
│ │ ├── trim-mesh.cpp
│ │ └── util/
│ │ ├── movement.cpp
│ │ ├── movement.hpp
│ │ ├── rotation.cpp
│ │ ├── rotation.hpp
│ │ ├── scaling.cpp
│ │ ├── scaling.hpp
│ │ ├── step.cpp
│ │ └── step.hpp
│ ├── tool.cpp
│ ├── tool.hpp
│ ├── tools.hpp
│ ├── tree.hpp
│ ├── util.cpp
│ ├── util.hpp
│ ├── variant.hpp
│ ├── view/
│ │ ├── axis.cpp
│ │ ├── axis.hpp
│ │ ├── color-button.cpp
│ │ ├── color-button.hpp
│ │ ├── configuration.cpp
│ │ ├── configuration.hpp
│ │ ├── context-menu.cpp
│ │ ├── context-menu.hpp
│ │ ├── cursor.cpp
│ │ ├── cursor.hpp
│ │ ├── double-slider.cpp
│ │ ├── double-slider.hpp
│ │ ├── floor-plane.cpp
│ │ ├── floor-plane.hpp
│ │ ├── gl-widget.cpp
│ │ ├── gl-widget.hpp
│ │ ├── info-pane/
│ │ │ ├── scene.cpp
│ │ │ └── scene.hpp
│ │ ├── info-pane.cpp
│ │ ├── info-pane.hpp
│ │ ├── input.cpp
│ │ ├── input.hpp
│ │ ├── key-event.cpp
│ │ ├── key-event.hpp
│ │ ├── light.cpp
│ │ ├── light.hpp
│ │ ├── log.cpp
│ │ ├── log.hpp
│ │ ├── main-window.cpp
│ │ ├── main-window.hpp
│ │ ├── menu-bar.cpp
│ │ ├── menu-bar.hpp
│ │ ├── pointing-event.cpp
│ │ ├── pointing-event.hpp
│ │ ├── resolution-slider.cpp
│ │ ├── resolution-slider.hpp
│ │ ├── shortcut.cpp
│ │ ├── shortcut.hpp
│ │ ├── tool-pane.cpp
│ │ ├── tool-pane.hpp
│ │ ├── tool-tip.cpp
│ │ ├── tool-tip.hpp
│ │ ├── two-column-grid.cpp
│ │ ├── two-column-grid.hpp
│ │ ├── util.cpp
│ │ ├── util.hpp
│ │ ├── vector-edit.cpp
│ │ └── vector-edit.hpp
│ ├── xml-conversion.cpp
│ └── xml-conversion.hpp
├── test/
│ ├── src/
│ │ ├── main.cpp
│ │ ├── test-bitset.cpp
│ │ ├── test-bitset.hpp
│ │ ├── test-distance.cpp
│ │ ├── test-distance.hpp
│ │ ├── test-intersection.cpp
│ │ ├── test-intersection.hpp
│ │ ├── test-maybe.cpp
│ │ ├── test-maybe.hpp
│ │ ├── test-misc.cpp
│ │ ├── test-misc.hpp
│ │ ├── test-octree.cpp
│ │ ├── test-octree.hpp
│ │ ├── test-prune.cpp
│ │ ├── test-prune.hpp
│ │ ├── test-tree.cpp
│ │ └── test-tree.hpp
│ └── test.pro
├── unix/
│ ├── dilay.desktop
│ └── docker/
│ ├── appimage/
│ │ ├── Dockerfile
│ │ └── entrypoint.sh
│ ├── debian-sid/
│ │ ├── Dockerfile
│ │ └── entrypoint.sh
│ ├── ubuntu-bionic/
│ │ ├── Dockerfile
│ │ └── entrypoint.sh
│ ├── ubuntu-trusty/
│ │ ├── Dockerfile
│ │ └── entrypoint.sh
│ └── ubuntu-xenial/
│ ├── Dockerfile
│ └── entrypoint.sh
└── win32/
├── LICENSE.rtf
├── deploy.bat
└── installer.wix
================================================
FILE CONTENTS
================================================
================================================
FILE: .clang-format
================================================
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: true
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BreakStringLiterals: false
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^"'
Priority: 0
- Regex: '^<'
Priority: -1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Always
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
UseTab: Never
================================================
FILE: .gitignore
================================================
obj/
moc/
dilay
dilay_debug
Makefile
archive/
i18n/*.qm
run-tests
lib/Makefile
lib/Makefile.Release
lib/Makefile.Debug
lib/libdilay.a
app/Makefile
app/Makefile.Release
app/Makefile.Debug
app/translations
test/Makefile
test/Makefile.Release
test/Makefile.Debug
valgrind.log
.qmake.stash
icon.pdf
icon.png
================================================
FILE: LICENSE.txt
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 3 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, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
================================================
FILE: README.md
================================================
# Dilay - a 3D sculpting application
**Project website:** https://abau.org/dilay
**Building instructions:** https://abau.org/dilay/manual.html#installing
================================================
FILE: app/app.pro
================================================
include (../common.pri)
TEMPLATE = app
DESTDIR = $$OUT_PWD/..
DEPENDPATH += src
INCLUDEPATH += src $$PWD/../lib/src
SOURCES += src/main.cpp
CONFIG(release, debug|release): TARGET = dilay
CONFIG(debug , debug|release): TARGET = dilay_debug
win32 {
CONFIG(release, debug|release) {
LIBS += -L$$OUT_PWD/../lib/release/ -ldilay
win32-g++ {
PRE_TARGETDEPS += $$OUT_PWD/../lib/release/libdilay.a
}
else {
PRE_TARGETDEPS += $$OUT_PWD/../lib/release/dilay.lib
}
}
CONFIG(debug, debug|release) {
LIBS += -L$$OUT_PWD/../lib/debug/ -ldilay
win32-g++ {
PRE_TARGETDEPS += $$OUT_PWD/../lib/debug/libdilay.a
}
else {
PRE_TARGETDEPS += $$OUT_PWD/../lib/debug/dilay.lib
}
}
RC_ICONS = $$PWD/../win32/icon.ico
QMAKE_POST_LINK += $$PWD/../win32/deploy.bat $$shell_path($$[QT_INSTALL_PREFIX]) \
$$shell_path($$DESTDIR) \
$$shell_path($$PWD/../) \
$$VERSION
}
unix {
LIBS += -L$$OUT_PWD/../lib/ -ldilay
PRE_TARGETDEPS += $$OUT_PWD/../lib/libdilay.a
target.path = $$PREFIX/bin/
INSTALLS += target
desktop.path = $$PREFIX/share/applications/
desktop.files = ../unix/dilay.desktop
INSTALLS += desktop
icon16.path = $$PREFIX/share/icons/hicolor/16x16/apps/
icon16.files = ../unix/icon/16x16/dilay.png
INSTALLS += icon16
icon32.path = $$PREFIX/share/icons/hicolor/32x32/apps/
icon32.files = ../unix/icon/32x32/dilay.png
INSTALLS += icon32
icon48.path = $$PREFIX/share/icons/hicolor/48x48/apps/
icon48.files = ../unix/icon/48x48/dilay.png
INSTALLS += icon48
icon256.path = $$PREFIX/share/icons/hicolor/256x256/apps/
icon256.files = ../unix/icon/256x256/dilay.png
INSTALLS += icon256
format.commands = clang-format -style=file -i $$SOURCES $$HEADERS
QMAKE_EXTRA_TARGETS += format
}
================================================
FILE: app/src/main.cpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#include <QApplication>
#include <QDir>
#include <QLibraryInfo>
#include <QStandardPaths>
#include "cache.hpp"
#include "config.hpp"
#include "opengl.hpp"
#include "time-delta.hpp"
#include "util.hpp"
#include "view/log.hpp"
#include "view/main-window.hpp"
namespace
{
QString configPath ()
{
return QStandardPaths::locate (QStandardPaths::ConfigLocation, "dilay.config");
}
void backupCrashLog ()
{
QFile log (ViewLog::logPath ());
QFile crashLog (ViewLog::crashLogPath ());
if (log.exists ())
{
if (crashLog.exists ())
{
crashLog.remove ();
}
log.rename (ViewLog::crashLogPath ());
}
}
}
int main (int argv, char** args)
{
backupCrashLog ();
Log::initialize (ViewLog::logPath ().toStdString ());
DILAY_INFO ("Version: %s", DILAY_VERSION);
DILAY_INFO ("Architecture: %s", QSysInfo::buildCpuArchitecture ().toStdString ().c_str ());
DILAY_INFO ("OS: %s", QSysInfo::prettyProductName ().toStdString ().c_str ());
DILAY_INFO ("Qt: %s", QLibraryInfo::version ().toString ().toStdString ().c_str ());
QCoreApplication::setApplicationName ("Dilay");
QCoreApplication::setAttribute (Qt::AA_UseDesktopOpenGL);
OpenGL::setDefaultFormat ();
QApplication app (argv, args);
Config config;
Cache cache;
if (configPath ().isEmpty () == false)
{
config.fromFile (configPath ().toStdString ());
}
ViewMainWindow mainWindow (config, cache);
mainWindow.resize (config.get<int> ("window/initial-width"),
config.get<int> ("window/initial-height"));
mainWindow.show ();
QObject::connect (&app, &QApplication::aboutToQuit, [&config]() {
const QString configDirName (QStandardPaths::writableLocation (QStandardPaths::ConfigLocation));
const QDir configDir (configDirName);
if (configDirName.isEmpty () == false)
{
if (configDir.exists () == false)
{
configDir.mkpath (".");
}
config.toFile (configDir.filePath ("dilay.config").toStdString ());
}
});
TimeDelta::initialize ();
return app.exec ();
}
================================================
FILE: common.pri
================================================
VERSION = 1.9.0
CONFIG += debug_and_release warn_on object_parallel_to_source ordered c++14
QT += widgets opengl openglextensions xml
MOC_DIR = moc
OBJECTS_DIR = obj
QMAKE_CXXFLAGS += -DDILAY_VERSION=\\\"$$VERSION\\\" -DGLM_FORCE_RADIANS -DGLM_ENABLE_EXPERIMENTAL
QMAKE_CXXFLAGS_RELEASE += -DNDEBUG
QMAKE_CXXFLAGS_DEBUG += -Wall # -pg # -DDILAY_RENDER_OCTREE
QMAKE_LFLAGS_DEBUG += # -pg
win32:INCLUDEPATH += $$PWD/glm/
unix {
isEmpty (PREFIX) {
PREFIX = /usr/local
}
}
================================================
FILE: dilay.pro
================================================
CONFIG += debug_and_release
TEMPLATE = subdirs
SUBDIRS = lib app test
app.depends = lib
test.depends = lib
disable-test {
SUBDIRS -= test
}
disable-app {
SUBDIRS -= app
}
unix {
gdb.commands = gdb -ex run ./dilay_debug
valgrind.commands = valgrind ./dilay_debug &> valgrind.log
leak.commands = valgrind --leak-check=yes ./dilay_debug &> valgrind.log
format.CONFIG = recursive
copyright.commands = find $$SUBDIRS \\( -name "*.cpp" -o -name "*.hpp" -o -name "*.hs" \\) -print0 | \
xargs -0 sed -i 's/Copyright\ ©\ 2015-2017/Copyright\ ©\ 2015-2018/'
docker.commands = docker build -t dilay-$(IMAGE) unix/docker/$(IMAGE) && \
docker run --rm --mount type=bind,src=$$(PWD),dst=/dilay dilay-$(IMAGE)
QMAKE_EXTRA_TARGETS += gdb valgrind leak format copyright icon docker
}
================================================
FILE: icon.tex
================================================
\documentclass[crop,tikz,convert={size=512x512,outext=.png}]{standalone}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}
[linestyle/.style={draw=black!80,line width=5pt,transform shape},
emptylinestyle/.style={transform shape},
circlestyle/.style={fill=black!80,circle,minimum size=10pt}]
\begin{scope}[rotate=-10]
\shadedraw [shading=ball, ball color=black!10] (0,0) circle (101pt);
\node[linestyle,circle,minimum size=201pt] {};
\node[emptylinestyle,regular polygon, regular polygon sides=9,rotate=20, minimum size=200pt] (p) {};
\node[emptylinestyle, regular polygon, regular polygon sides=3,minimum size=120pt] (t) {};
\node[linestyle, regular polygon, regular polygon sides=3,minimum size=120pt] {};
\draw [linestyle] (t.corner 1) -- (p.corner 1);
\draw [linestyle] (t.corner 1) -- (p.corner 2);
\draw [linestyle] (t.corner 1) -- (p.corner 8);
\draw [linestyle] (t.corner 1) -- (p.corner 9);
\draw [linestyle] (t.corner 2) -- (p.corner 2);
\draw [linestyle] (t.corner 2) -- (p.corner 3);
\draw [linestyle] (t.corner 2) -- (p.corner 4);
\draw [linestyle] (t.corner 2) -- (p.corner 5);
\draw [linestyle] (t.corner 3) -- (p.corner 5);
\draw [linestyle] (t.corner 3) -- (p.corner 6);
\draw [linestyle] (t.corner 3) -- (p.corner 7);
\draw [linestyle] (t.corner 3) -- (p.corner 8);
\node [circlestyle] at (t.corner 1) {};
\node [circlestyle] at (t.corner 2) {};
\node [circlestyle] at (t.corner 3) {};
\node [circlestyle] at (p.corner 1) {};
\node [circlestyle] at (p.corner 2) {};
\node [circlestyle] at (p.corner 3) {};
\node [circlestyle] at (p.corner 4) {};
\node [circlestyle] at (p.corner 5) {};
\node [circlestyle] at (p.corner 6) {};
\node [circlestyle] at (p.corner 7) {};
\node [circlestyle] at (p.corner 8) {};
\node [circlestyle] at (p.corner 9) {};
\end{scope}
\end{tikzpicture}
\end{document}
================================================
FILE: lib/lib.pro
================================================
include (../common.pri)
TEMPLATE = lib
TARGET = dilay
DEPENDPATH += src
INCLUDEPATH += src
CONFIG += staticlib
SOURCES += \
src/camera.cpp \
src/color.cpp \
src/config.cpp \
src/configurable.cpp \
src/dimension.cpp \
src/distance.cpp \
src/dynamic/faces.cpp \
src/dynamic/mesh.cpp \
src/dynamic/mesh-intersection.cpp \
src/dynamic/octree.cpp \
src/history.cpp \
src/import-export.cpp \
src/intersection.cpp \
src/isosurface-extraction.cpp \
src/isosurface-extraction/grid.cpp \
src/kvstore.cpp \
src/log.cpp \
src/mesh.cpp \
src/mesh-util.cpp \
src/mirror.cpp \
src/opengl.cpp \
src/opengl-buffer-id.cpp \
src/primitive/aabox.cpp \
src/primitive/cone.cpp \
src/primitive/cone-sphere.cpp \
src/primitive/cylinder.cpp \
src/primitive/plane.cpp \
src/primitive/ray.cpp \
src/primitive/sphere.cpp \
src/primitive/triangle.cpp \
src/render-mode.cpp \
src/renderer.cpp \
src/scene.cpp \
src/shader.cpp \
src/sketch/bone-intersection.cpp \
src/sketch/mesh.cpp \
src/sketch/mesh-intersection.cpp \
src/sketch/node-intersection.cpp \
src/sketch/path.cpp \
src/sketch/path-intersection.cpp \
src/state.cpp \
src/time-delta.cpp \
src/tool.cpp \
src/tool/convert-sketch.cpp \
src/tool/delete-mesh.cpp \
src/tool/delete-sketch.cpp \
src/tool/edit-sketch.cpp \
src/tool/move-camera.cpp \
src/tool/new-mesh.cpp \
src/tool/remesh.cpp \
src/tool/sculpt.cpp \
src/tool/sculpt/draw.cpp \
src/tool/sculpt/crease.cpp \
src/tool/sculpt/flatten.cpp \
src/tool/sculpt/grab.cpp \
src/tool/sculpt/pinch.cpp \
src/tool/sculpt/reduce.cpp \
src/tool/sculpt/smooth.cpp \
src/tool/sculpt/util/action.cpp \
src/tool/sculpt/util/brush.cpp \
src/tool/sculpt/util/edge-collection.cpp \
src/tool/sketch-spheres.cpp \
src/tool/transform-mesh.cpp \
src/tool/trim-mesh.cpp \
src/tool/trim-mesh/action.cpp \
src/tool/trim-mesh/border.cpp \
src/tool/trim-mesh/split-mesh.cpp \
src/tool/util/movement.cpp \
src/tool/util/rotation.cpp \
src/tool/util/scaling.cpp \
src/tool/util/step.cpp \
src/util.cpp \
src/view/axis.cpp \
src/view/color-button.cpp \
src/view/configuration.cpp \
src/view/context-menu.cpp \
src/view/cursor.cpp \
src/view/double-slider.cpp \
src/view/floor-plane.cpp \
src/view/gl-widget.cpp \
src/view/info-pane.cpp \
src/view/info-pane/scene.cpp \
src/view/input.cpp \
src/view/key-event.cpp \
src/view/light.cpp \
src/view/log.cpp \
src/view/main-window.cpp \
src/view/menu-bar.cpp \
src/view/pointing-event.cpp \
src/view/resolution-slider.cpp \
src/view/shortcut.cpp \
src/view/tool-pane.cpp \
src/view/tool-tip.cpp \
src/view/two-column-grid.cpp \
src/view/util.cpp \
src/view/vector-edit.cpp \
src/xml-conversion.cpp \
HEADERS += \
src/bitset.hpp \
src/cache.hpp \
src/camera.hpp \
src/color.hpp \
src/config.hpp \
src/configurable.hpp \
src/dimension.hpp \
src/distance.hpp \
src/dynamic/faces.hpp \
src/dynamic/mesh.hpp \
src/dynamic/mesh-intersection.hpp \
src/dynamic/octree.hpp \
src/hash.hpp \
src/history.hpp \
src/import-export.hpp \
src/intersection.hpp \
src/isosurface-extraction.hpp \
src/isosurface-extraction/grid.hpp \
src/kvstore.hpp \
src/log.hpp \
src/macro.hpp \
src/maybe.hpp \
src/mesh.hpp \
src/mesh-util.hpp \
src/mirror.hpp \
src/opengl.hpp \
src/opengl-buffer-id.hpp \
src/primitive/aabox.hpp \
src/primitive/cone.hpp \
src/primitive/cone-sphere.hpp \
src/primitive/cylinder.hpp \
src/primitive/plane.hpp \
src/primitive/ray.hpp \
src/primitive/sphere.hpp \
src/primitive/triangle.hpp \
src/render-mode.hpp \
src/renderer.hpp \
src/scene.hpp \
src/shader.hpp \
src/sketch/bone-intersection.hpp \
src/sketch/fwd.hpp \
src/sketch/mesh.hpp \
src/sketch/mesh-intersection.hpp \
src/sketch/node-intersection.hpp \
src/sketch/path.hpp \
src/sketch/path-intersection.hpp \
src/state.hpp \
src/time-delta.hpp \
src/tool.hpp \
src/tool/key.hpp \
src/tool/move-camera.hpp \
src/tool/sculpt.hpp \
src/tool/sculpt/util/action.hpp \
src/tool/sculpt/util/brush.hpp \
src/tool/sculpt/util/edge-collection.hpp \
src/tool/trim-mesh/action.hpp \
src/tool/trim-mesh/border.hpp \
src/tool/trim-mesh/split-mesh.hpp \
src/tool/util/movement.hpp \
src/tool/util/rotation.hpp \
src/tool/util/scaling.hpp \
src/tool/util/step.hpp \
src/tools.hpp \
src/tree.hpp \
src/util.hpp \
src/variant.hpp \
src/view/axis.hpp \
src/view/color-button.hpp \
src/view/configuration.hpp \
src/view/context-menu.hpp \
src/view/cursor.hpp \
src/view/double-slider.hpp \
src/view/floor-plane.cpp \
src/view/gl-widget.hpp \
src/view/info-pane.hpp \
src/view/info-pane/scene.hpp \
src/view/input.hpp \
src/view/key-event.hpp \
src/view/light.hpp \
src/view/log.hpp \
src/view/main-window.hpp \
src/view/menu-bar.hpp \
src/view/pointing-event.hpp \
src/view/resolution-slider.hpp \
src/view/shortcut.hpp \
src/view/tool-pane.hpp \
src/view/tool-tip.hpp \
src/view/two-column-grid.hpp \
src/view/util.hpp \
src/view/vector-edit.hpp \
src/xml-conversion.hpp \
unix {
format.commands = clang-format -style=file -i $$SOURCES $$HEADERS
QMAKE_EXTRA_TARGETS += format
}
================================================
FILE: lib/src/IsosurfaceExtractionConfigurations.hs
================================================
{- This file is part of Dilay
- Copyright © 2015-2018 Alexander Bau
- Use and redistribute under the terms of the GNU General Public License
-}
import Control.Exception (assert)
import Control.Monad (forM_)
import Data.Char (toLower)
import Data.Function (on)
import Data.List (intercalate,nubBy,sortBy)
data Configuration = Configuration
{ base :: Int
, vertices :: [Bool]
, vertexIndices :: [Int]
, nonManifoldConfig :: Bool
}
deriving Show
set :: Int -> a -> [a] -> [a]
set 0 x (y:ys) = x:ys
set i x (y:ys) = y:(set (i - 1) x ys)
setList :: [Int] -> a -> [a] -> [a]
setList is value xs = foldl (\xs i -> set i value xs) xs is
baseConfigurations :: [Configuration]
baseConfigurations =
[ go 0 [] [] False
, go 1 [4] [[2, 6, 7]] False
, go 2 [4, 5] [[2, 5, 7, 10]] False
, go 3 [4, 7] [[2, 6, 7], [9, 10, 11]] False
, go 4 [3, 4] [[2, 6, 7], [3, 4, 11]] False
, go 5 [0, 1, 5] [[1, 2, 4, 6, 10]] False
, go 6 [3, 4, 5] [[2, 5, 7, 10], [3, 4, 11]] False
, go 7 [3, 5, 6] [[7, 8, 9], [3, 4, 11], [5, 6, 10]] False
, go 8 [0, 1, 4, 5] [[1, 4, 7, 10]] False
, go 9 [0, 1, 2, 4] [[3, 4, 5, 6, 7, 8]] False
, go 10 [1, 3, 4, 6] [[2, 6, 8, 9], [0, 3, 5, 11]] False
, go 11 [0, 1, 3, 4] [[1, 3, 5, 6, 7, 11]] False
, go 12 [0, 1, 5, 6] [[7, 8, 9], [1, 2, 4, 6, 10]] False
, go 13 [1, 2, 4, 7] [[2, 6, 7], [9, 10, 11], [1, 3, 8], [0, 4, 5]] False
, go 14 [0, 1, 2, 5] [[2, 3, 4, 6, 8, 10]] False
, go 15 [0, 1, 2, 4, 7] [[3, 4, 5, 6, 7, 8], [9, 10, 11]] False
, go 16 [0, 1, 2, 6, 7] [[2, 5, 7, 10], [3, 4, 11]] True
, go 17 [2, 3, 4, 6, 7] [[1, 2, 4, 6, 10]] False
, go 18 [0, 1, 2, 5, 6, 7] [[2, 6, 7], [3, 4, 11]] False
, go 19 [0, 1, 2, 3, 5, 6] [[2, 6, 7], [9, 10, 11]] True
, go 20 [0, 1, 2, 3, 6, 7] [[2, 5, 7, 10]] False
, go 21 [0, 1, 2, 3, 5, 6, 7] [[2, 6, 7]] False
, go 22 [0, 1, 2, 3, 4, 5, 6, 7] [] False
]
where
go base vertices vertexIndices nonManifold =
Configuration base (setList vertices True $ replicate 8 False)
(mkVertexIndices 0 vertexIndices) nonManifold
mkVertexIndices :: Int -> [[Int]] -> [Int]
mkVertexIndices vertexIndex [] = replicate 12 (-1)
mkVertexIndices vertexIndex (edgeGroup:edgeGroups) = setList edgeGroup vertexIndex rest
where
rest = mkVertexIndices (vertexIndex + 1) edgeGroups
allConfigurations :: [Configuration]
allConfigurations = sortBy (sort `on` vertices)
$ nubBy ((==) `on` vertices)
$ concat
$ do
x <- [id, rotateX, rotateX . rotateX, rotateX . rotateX . rotateX]
y <- [id, rotateY, rotateY . rotateY, rotateY . rotateY . rotateY]
z <- [id, rotateZ, rotateZ . rotateZ, rotateZ . rotateZ . rotateZ]
return $ map (($) (x . y . z)) baseConfigurations
where
rotateX (Configuration base [v0, v1, v2, v3, v4, v5, v6, v7]
[e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11] nonManifold)
= Configuration base [v4, v5, v0, v1, v6, v7, v2, v3]
[e6, e2, e7, e0, e5, e10, e9, e8, e1, e3, e11, e4] nonManifold
rotateY (Configuration base [v0, v1, v2, v3, v4, v5, v6, v7]
[e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11] nonManifold)
= Configuration base [v1, v5, v3, v7, v0, v4, v2, v6]
[e5, e4, e0, e11, e10, e6, e2, e1, e3, e8, e7, e9] nonManifold
rotateZ (Configuration base [v0, v1, v2, v3, v4, v5, v6, v7]
[e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11] nonManifold)
= Configuration base [v2, v0, v3, v1, v6, v4, v7, v5]
[e1, e3, e8, e4, e0, e2, e7, e9, e11, e10, e6, e5] nonManifold
sort xs ys = go (reverse xs) (reverse ys)
where
go (False:xs) (True:ys) = LT
go (True:xs) (False:ys) = GT
go (_:xs) (_:ys) = go xs ys
main :: IO ()
main = assert (length allConfigurations == 256)
$ printBases >> printNonManifold >> printVertexIndices
where
printBases = putStrLn $ toList (show . base) allConfigurations
printNonManifold = putStrLn $ toList (map toLower . show . nonManifoldConfig) allConfigurations
printVertexIndices =
putStrLn $ toList (\c -> toList show (vertexIndices c) ++ "\n") allConfigurations
toList xToString xs = unwords $ "{" :
[ intercalate ", " $ map xToString xs ]
++ ["}"]
================================================
FILE: lib/src/bitset.hpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#ifndef DILAY_BITSET
#define DILAY_BITSET
#include <cmath>
template <typename T> class Bitset
{
public:
Bitset ()
: _data (0)
{
}
Bitset (const Bitset& other)
: _data (other._data)
{
}
template <unsigned short N> bool get () const
{
static_assert (N < sizeof (T) * 8, "invalid bitset index");
return this->_data & 1 << N;
}
template <unsigned short N> void set (bool value = true)
{
static_assert (N < sizeof (T) * 8, "invalid bitset index");
if (value)
{
this->_data = this->_data | 1 << N;
}
else
{
this->_data = this->_data & ~(1 << N);
}
}
template <unsigned short N> void toggle () { this->set<N> (!this->get<N> ()); }
template <unsigned short N> void reset () { this->set<N> (false); }
void reset () { this->_data = 0; }
bool none () const { return this->_data == 0; }
template <unsigned short N> bool all () const
{
static_assert (N < sizeof (T) * 8, "invalid bitset index");
const T allBits = std::pow (2, N) - 1;
return (this->_data & allBits) == allBits;
}
T value () const { return this->_data; }
private:
T _data;
};
#endif
================================================
FILE: lib/src/cache.hpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#ifndef DILAY_CACHE
#define DILAY_CACHE
#include "kvstore.hpp"
class Cache
{
public:
Cache ()
: store ("cache")
{
}
template <class T> const T& get (const std::string& path, const T& value) const
{
return this->store.get<T> (path, value);
}
template <class T> void set (const std::string& path, const T& value)
{
this->store.set<T> (path, value);
}
private:
KVStore store;
};
class CacheProxy
{
public:
CacheProxy (Cache& c, const std::string& p)
: _cache (c)
, prefix (p)
{
assert (p.back () == '/');
}
CacheProxy (CacheProxy& o, const std::string& path)
: CacheProxy (o._cache, o.prefix + path)
{
}
Cache& cache () const { return this->_cache; }
std::string key (const std::string& path) const { return this->prefix + path; }
template <class T> const T& get (const std::string& path, const T& v) const
{
return this->_cache.get<T> (this->key (path), v);
}
template <class T> void set (const std::string& path, const T& v) const
{
return this->_cache.set<T> (this->key (path), v);
}
private:
Cache& _cache;
const std::string prefix;
};
#endif
================================================
FILE: lib/src/camera.cpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/matrix_major_storage.hpp>
#include <glm/gtx/quaternion.hpp>
#include "camera.hpp"
#include "config.hpp"
#include "dimension.hpp"
#include "intersection.hpp"
#include "opengl.hpp"
#include "primitive/plane.hpp"
#include "primitive/ray.hpp"
#include "renderer.hpp"
#include "util.hpp"
struct Camera::Impl
{
Camera* self;
Renderer renderer;
glm::vec3 gazePoint;
glm::vec3 toEyePoint;
glm::vec3 right;
glm::mat4x4 projection;
glm::mat4x4 view;
glm::mat4x4 viewRotation;
glm::uvec2 resolution;
float nearClipping;
float farClipping;
float fieldOfView;
Impl (Camera* s, const Config& config)
: self (s)
, renderer (config)
, resolution (config.get<int> ("window/initial-width"),
config.get<int> ("window/initial-height"))
{
this->set (glm::vec3 (0.0f, 0.0f, 0.0f), glm::vec3 (0.0f, 0.0f, 6.0f));
this->runFromConfig (config);
}
const glm::vec3& up () const
{
static const glm::vec3 up (0.0f, 1.0f, 0.0f);
return up;
}
glm::vec3 realUp () const { return glm::normalize (glm::cross (this->toEyePoint, this->right)); }
glm::vec3 position () const { return this->gazePoint + this->toEyePoint; }
glm::mat4x4 world () const
{
const glm::vec3 x = this->right;
const glm::vec3 z = glm::normalize (this->toEyePoint);
const glm::vec3 y = glm::cross (z, x);
const glm::vec3 p = this->position ();
return glm::colMajor4 (glm::vec4 (x, 0.0f), glm::vec4 (y, 0.0f), glm::vec4 (z, 0.0f),
glm::vec4 (p, 1.0f));
}
void updateResolution (const glm::uvec2& dimension)
{
this->resolution = dimension;
this->updateProjection ();
}
void setModelViewProjection (const glm::mat4x4& model, const glm::mat3x3& modelNormal,
bool onlyRotation)
{
this->renderer.setModel (&model[0][0], &modelNormal[0][0]);
this->renderer.setProjection (&this->projection[0][0]);
if (onlyRotation)
{
this->renderer.setView (&this->viewRotation[0][0]);
}
else
{
this->renderer.setView (&this->view[0][0]);
}
}
void set (const glm::vec3& g, const glm::vec3& e)
{
this->gazePoint = g;
this->toEyePoint = e;
if (Util::colinear (e, this->up ()))
{
this->right = glm::vec3 (1.0f, 0.0f, 0.0f);
}
else
{
this->right = glm::normalize (glm::cross (this->up (), this->toEyePoint));
}
this->updateView ();
}
void setGaze (const glm::vec3& g)
{
this->gazePoint = g;
this->updateView ();
}
void stepAlongGaze (float factor)
{
constexpr float minD = 0.01f;
constexpr float maxD = 1000.0f;
const float d = glm::length (this->toEyePoint);
const float newD = d * factor;
if (minD <= newD && newD <= maxD)
{
this->toEyePoint *= glm::vec3 (factor);
}
this->updateView ();
}
void verticalRotation (float angle)
{
const glm::quat q = glm::angleAxis (angle, this->up ());
this->right = glm::rotate (q, this->right);
this->toEyePoint = glm::rotate (q, this->toEyePoint);
this->updateView ();
}
void horizontalRotation (float angle)
{
const glm::quat q = glm::angleAxis (angle, this->right);
this->toEyePoint = glm::rotate (q, this->toEyePoint);
this->updateView ();
}
glm::vec4 viewport () const { return glm::vec4 (0, 0, this->resolution.x, this->resolution.y); }
glm::vec2 fromWorld (const glm::vec3& p, const glm::mat4x4& model, bool onlyRotation) const
{
const glm::mat4x4 mv = onlyRotation ? this->viewRotation * model : this->view * model;
const glm::vec3 w = glm::project (p, mv, this->projection, this->viewport ());
return glm::vec2 (w.x, float(resolution.y) - w.y);
}
glm::vec3 toWorld (const glm::ivec2& p, float z = 0.0f) const
{
const float invY = this->resolution.y - float(p.y);
const float normZ = z / this->farClipping;
return glm::unProject (glm::vec3 (float(p.x), invY, normZ), this->view, this->projection,
this->viewport ());
}
float toWorld (float length, float z)
{
const float onNearPlane = 2.0f * this->nearClipping * glm::tan (this->fieldOfView * 0.5f) *
length / float(this->resolution.x);
return onNearPlane * (this->nearClipping + z) / this->nearClipping;
}
PrimRay ray (const glm::ivec2& p) const
{
const glm::vec3 w = this->toWorld (p);
const glm::vec3 eye = this->position ();
return PrimRay (eye, w - eye);
}
void updateProjection ()
{
OpenGL::glViewport (0, 0, this->resolution.x, this->resolution.y);
this->projection =
glm::perspective (this->fieldOfView, float(this->resolution.x) / float(this->resolution.y),
this->nearClipping, this->farClipping);
}
void updateView ()
{
const glm::vec3 up = this->realUp ();
this->view = glm::lookAt (this->position (), this->gazePoint, up);
this->viewRotation = glm::lookAt (glm::normalize (this->toEyePoint), glm::vec3 (0.0f), up);
this->renderer.setEyePoint (this->position ());
}
Dimension primaryDimension () const
{
const glm::vec3 t = glm::abs (this->toEyePoint);
if (t.x > t.y && t.x > t.z)
{
return Dimension::X;
}
else if (t.y > t.z)
{
return Dimension::Y;
}
return Dimension::Z;
}
glm::vec3 planeIntersection (const glm::ivec2& p, const PrimPlane& plane) const
{
const PrimRay ray = this->ray (p);
float t;
if (IntersectionUtil::intersects (ray, plane, &t))
{
return ray.pointAt (t);
}
else
{
DILAY_WARN ("No view-plane intersection");
return plane.point ();
}
}
glm::vec3 viewPlaneIntersection (const glm::ivec2& p) const
{
const PrimPlane plane (this->gazePoint, this->toEyePoint);
return this->planeIntersection (p, plane);
}
glm::vec3 primaryPlaneIntersection (const glm::ivec2& p) const
{
const PrimPlane plane (this->gazePoint, DimensionUtil::vector (this->primaryDimension ()));
return this->planeIntersection (p, plane);
}
void runFromConfig (const Config& config)
{
this->renderer.fromConfig (config);
this->nearClipping = config.get<float> ("editor/camera/near-clipping");
this->farClipping = config.get<float> ("editor/camera/far-clipping");
this->fieldOfView = glm::radians (config.get<float> ("editor/camera/field-of-view"));
this->updateProjection ();
}
};
DELEGATE1_BIG3_SELF (Camera, const Config&)
GETTER_CONST (Renderer&, Camera, renderer)
GETTER_CONST (const glm::uvec2&, Camera, resolution)
GETTER_CONST (const glm::vec3&, Camera, gazePoint)
GETTER_CONST (const glm::vec3&, Camera, toEyePoint)
DELEGATE_CONST (glm::vec3, Camera, realUp)
GETTER_CONST (const glm::vec3&, Camera, right)
GETTER_CONST (const glm::mat4x4&, Camera, view)
GETTER_CONST (const glm::mat4x4&, Camera, viewRotation)
DELEGATE_CONST (glm::vec3, Camera, position)
DELEGATE_CONST (glm::mat4x4, Camera, world)
DELEGATE1 (void, Camera, updateResolution, const glm::uvec2&)
DELEGATE3 (void, Camera, setModelViewProjection, const glm::mat4x4&, const glm::mat3x3&, bool)
DELEGATE2 (void, Camera, set, const glm::vec3&, const glm::vec3&)
DELEGATE1 (void, Camera, setGaze, const glm::vec3&)
DELEGATE1 (void, Camera, stepAlongGaze, float)
DELEGATE1 (void, Camera, verticalRotation, float)
DELEGATE1 (void, Camera, horizontalRotation, float)
DELEGATE3_CONST (glm::vec2, Camera, fromWorld, const glm::vec3&, const glm::mat4x4&, bool)
DELEGATE2_CONST (glm::vec3, Camera, toWorld, const glm::ivec2&, float)
DELEGATE2_CONST (float, Camera, toWorld, float, float)
DELEGATE1_CONST (PrimRay, Camera, ray, const glm::ivec2&)
DELEGATE_CONST (Dimension, Camera, primaryDimension)
DELEGATE1_CONST (glm::vec3, Camera, viewPlaneIntersection, const glm::ivec2&)
DELEGATE1_CONST (glm::vec3, Camera, primaryPlaneIntersection, const glm::ivec2&)
DELEGATE1 (void, Camera, runFromConfig, const Config&)
================================================
FILE: lib/src/camera.hpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#ifndef DILAY_CAMERA
#define DILAY_CAMERA
#include <glm/fwd.hpp>
#include "configurable.hpp"
#include "macro.hpp"
enum class Dimension;
class PrimRay;
class Renderer;
class Camera : public Configurable
{
public:
DECLARE_BIG3 (Camera, const Config&)
Renderer& renderer () const;
const glm::uvec2& resolution () const;
const glm::vec3& gazePoint () const;
const glm::vec3& toEyePoint () const;
glm::vec3 realUp () const;
const glm::vec3& right () const;
const glm::mat4x4& view () const;
const glm::mat4x4& viewRotation () const;
glm::vec3 position () const;
glm::mat4x4 world () const;
void updateResolution (const glm::uvec2&);
void setModelViewProjection (const glm::mat4x4&, const glm::mat3x3&, bool);
void set (const glm::vec3&, const glm::vec3&);
void setGaze (const glm::vec3&);
void stepAlongGaze (float);
void verticalRotation (float);
void horizontalRotation (float);
glm::vec2 fromWorld (const glm::vec3&, const glm::mat4x4&, bool) const;
glm::vec3 toWorld (const glm::ivec2&, float = 0.0f) const;
float toWorld (float, float = 0.0f) const;
PrimRay ray (const glm::ivec2&) const;
Dimension primaryDimension () const;
glm::vec3 viewPlaneIntersection (const glm::ivec2&) const;
glm::vec3 primaryPlaneIntersection (const glm::ivec2&) const;
private:
IMPLEMENTATION
void runFromConfig (const Config&);
};
#endif
================================================
FILE: lib/src/color.cpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#include <QColor>
#include <glm/glm.hpp>
#include "color.hpp"
#include "util.hpp"
Color::Color (float r, float g, float b, float o)
: _r (r)
, _g (g)
, _b (b)
, _opacity (o)
{
}
Color::Color ()
: Color (0.0f, 0.0f, 0.0f, 1.0f)
{
}
Color::Color (float v)
: Color (v, v, v, 1.0f)
{
}
Color::Color (float r, float g, float b)
: Color (r, g, b, 1.0f)
{
}
Color::Color (const glm::vec3& v)
: Color (v.x, v.y, v.z)
{
}
Color::Color (const glm::vec4& v)
: Color (v.x, v.y, v.z, v.w)
{
}
Color::Color (const QColor& c)
: Color (c.redF (), c.greenF (), c.blueF (), c.alphaF ())
{
}
Color::Color (const Color& c, float f)
: Color (c)
{
this->scale (f);
}
Color Color::Black () { return Color (0.0f, 0.0f, 0.0f); }
Color Color::White () { return Color (1.0f, 1.0f, 1.0f); }
Color Color::Red () { return Color (1.0f, 0.0f, 0.0f); }
Color Color::Green () { return Color (0.0f, 1.0f, 0.0f); }
Color Color::Blue () { return Color (0.0f, 0.0f, 1.0f); }
float Color::r () const { return this->_r; }
float Color::g () const { return this->_g; }
float Color::b () const { return this->_b; }
float Color::opacity () const { return this->_opacity; }
void Color::r (float v) { this->_r = v; }
void Color::g (float v) { this->_g = v; }
void Color::b (float v) { this->_b = v; }
void Color::opacity (float v) { this->_opacity = v; }
void Color::scale (float f)
{
this->_r = f * this->_r;
this->_g = f * this->_g;
this->_b = f * this->_b;
}
glm::vec3 Color::vec3 () const { return glm::vec3 (this->_r, this->_g, this->_b); }
glm::vec4 Color::vec4 () const { return glm::vec4 (this->_r, this->_g, this->_b, this->_opacity); }
QColor Color::qColor () const
{
return QColor (glm::min (255, int(255.0f * this->_r)), glm::min (255, int(255.0f * this->_g)),
glm::min (255, int(255.0f * this->_b)),
glm::min (255, int(255.0f * this->_opacity)));
}
bool Color::isOpaque () const { return Util::almostEqual (this->_opacity, 1.0f); }
================================================
FILE: lib/src/color.hpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#ifndef DILAY_COLOR
#define DILAY_COLOR
#include <glm/fwd.hpp>
class QColor;
class Color
{
public:
Color ();
Color (float);
Color (float, float, float);
Color (float, float, float, float);
explicit Color (const glm::vec3&);
explicit Color (const glm::vec4&);
explicit Color (const QColor&);
// copies and scales a color using `scale`
Color (const Color&, float);
static Color Black ();
static Color White ();
static Color Red ();
static Color Green ();
static Color Blue ();
float r () const;
float g () const;
float b () const;
float opacity () const;
void r (float);
void g (float);
void b (float);
void opacity (float);
// `scale` does not scale opacity
void scale (float);
glm::vec3 vec3 () const;
glm::vec4 vec4 () const;
QColor qColor () const;
bool isOpaque () const;
private:
float _r;
float _g;
float _b;
float _opacity;
};
#endif
================================================
FILE: lib/src/config.cpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#include <functional>
#include <glm/glm.hpp>
#include "color.hpp"
#include "config.hpp"
namespace
{
static constexpr int latestVersion = 10;
template <typename T>
void updateValue (Config& config, const std::string& path, const T& oldValue, const T& newValue)
{
if (config.get<T> (path) == oldValue)
{
config.set (path, newValue);
}
}
template <typename T>
void forceUpdateValue (Config& config, const std::string& path, const T& newValue)
{
config.set (path, newValue);
}
template <typename T>
void mapValue (Config& config, const std::string& path, const std::function<T (const T&)>& f)
{
config.set (path, f (config.get<T> (path)));
}
}
Config::Config ()
: store ("config")
{
this->restoreDefaults ();
}
void Config::restoreDefaults ()
{
this->store.reset ();
this->set ("version", latestVersion);
this->set ("editor/axis/color/normal", Color (0.3f, 0.3f, 0.4f));
this->set ("editor/axis/color/label", Color (1.0f, 1.0f, 1.0f));
this->set ("editor/axis/scaling", glm::vec3 (0.01f, 0.3f, 0.01f));
this->set ("editor/axis/arrow-scaling", glm::vec3 (0.03f, 0.1f, 0.03f));
this->set ("editor/floor-plane/color", Color (0.3f, 0.3f, 0.4f));
this->set ("editor/floor-plane/tile-width", 1.0f);
this->set ("editor/background", Color (0.1f, 0.1f, 0.2f));
this->set ("editor/on-screen-color", Color (0.4f, 0.4f, 0.9f, 0.6f));
this->set ("editor/camera/near-clipping", 0.01f);
this->set ("editor/camera/far-clipping", 1000.0f);
this->set ("editor/camera/rotation-factor", 1.0f);
this->set ("editor/camera/movement-factor", 0.01f);
this->set ("editor/camera/zoom-in-mouse-wheel-factor", 0.9f);
this->set ("editor/camera/field-of-view", 45.0f);
this->set ("editor/light/light1/direction", glm::vec3 (0.2f, -1.0f, -0.2f));
this->set ("editor/light/light1/color", Color (1.0f, 1.0f, 1.0f));
this->set ("editor/light/light1/irradiance", 0.7f);
this->set ("editor/light/light2/direction", glm::vec3 (0.0f, 0.0f, -1.0f));
this->set ("editor/light/light2/color", Color (1.0f, 1.0f, 1.0f));
this->set ("editor/light/light2/irradiance", 0.8f);
this->set ("editor/mesh/color/normal", Color (0.8f, 0.8f, 0.8f));
this->set ("editor/mesh/color/wireframe", Color (0.3f, 0.3f, 0.3f));
this->set ("editor/sketch/node/color", Color (0.5f, 0.5f, 0.9f));
this->set ("editor/sketch/bubble/color", Color (0.5f, 0.5f, 0.7f));
this->set ("editor/sketch/sphere/color", Color (0.7f, 0.7f, 0.9f));
this->set ("editor/tool/cursor-color", Color (1.0f, 0.9f, 0.9f));
this->set ("editor/tool/sculpt/detail-factor", 0.75f);
this->set ("editor/tool/sculpt/step-width-factor", 0.3f);
this->set ("editor/tool/sculpt/max-absolute-radius", 2.0f);
this->set ("editor/tool/sculpt/mirror/render", false);
this->set ("editor/tool/sculpt/mirror/width", 0.02f);
this->set ("editor/tool/sculpt/mirror/color", Color (0.8f, 0.8f, 0.8f));
this->set ("editor/tool/sketch-spheres/step-width-factor", 0.3f);
this->set ("editor/undo-depth", 15);
this->set ("editor/tablet-pressure-intensity", 1.0f);
this->set ("editor/use-geometry-shader", true);
this->set ("window/initial-width", 1024);
this->set ("window/initial-height", 768);
}
void Config::update ()
{
const int version = this->get<int> ("version");
switch (version)
{
case 1:
break;
case 2:
break;
case 3:
updateValue<int> (*this, "editor/undo-depth", 5, 15);
break;
case 4:
this->remove ("editor/camera/gaze-point");
this->remove ("editor/camera/eye-point");
this->remove ("editor/camera/up");
break;
case 5:
mapValue<glm::vec3> (*this, "editor/light/light1/direction",
[](const glm::vec3& v) { return -v; });
mapValue<glm::vec3> (*this, "editor/light/light2/direction",
[](const glm::vec3& v) { return -v; });
break;
case 6:
forceUpdateValue<float> (*this, "editor/tool/sculpt/step-width-factor", 0.3f);
forceUpdateValue<float> (*this, "editor/tool/sketch-spheres/step-width-factor", 0.3f);
break;
case 7:
forceUpdateValue<float> (*this, "editor/camera/zoom-in-factor", 0.95f);
break;
case 8:
this->remove ("editor/tool/sculpt/cursor-color");
this->remove ("editor/tool/sketch-spheres/cursor-color");
break;
case 9:
this->remove ("editor/camera/zoom-in-factor");
break;
case latestVersion:
return;
default:
this->restoreDefaults ();
return;
}
this->set ("version", version + 1);
this->update ();
}
================================================
FILE: lib/src/config.hpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#ifndef DILAY_CONFIG
#define DILAY_CONFIG
#include "kvstore.hpp"
class Config
{
public:
Config ();
template <class T> const T& get (const std::string& path) const
{
return this->store.get<T> (path);
}
template <class T> void set (const std::string& path, const T& value)
{
this->store.set<T> (path, value);
}
void fromFile (const std::string& fileName)
{
this->store.fromFile (fileName);
this->update ();
}
void toFile (const std::string& fileName) const { this->store.toFile (fileName); }
void remove (const std::string& path) { this->store.remove (path); }
void restoreDefaults ();
private:
void update ();
KVStore store;
};
class ConfigProxy
{
public:
ConfigProxy (const Config& c, const std::string& p)
: _config (c)
, prefix (p)
{
assert (p.back () == '/');
}
ConfigProxy (const ConfigProxy& o, const std::string& path)
: ConfigProxy (o._config, o.prefix + path)
{
}
const Config& config () const { return this->_config; }
std::string key (const std::string& path) const { return this->prefix + path; }
template <class T> const T& get (const std::string& path) const
{
return this->_config.get<T> (this->key (path));
}
private:
const Config& _config;
const std::string prefix;
};
#endif
================================================
FILE: lib/src/configurable.cpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#include "configurable.hpp"
void Configurable::fromConfig (const Config& c) { this->runFromConfig (c); }
void ProxyConfigurable::fromConfig (const ConfigProxy& c) { this->runFromConfig (c); }
================================================
FILE: lib/src/configurable.hpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#ifndef DILAY_CONFIGURABLE
#define DILAY_CONFIGURABLE
class Config;
class ConfigProxy;
class Configurable
{
public:
void fromConfig (const Config&);
private:
virtual void runFromConfig (const Config&) = 0;
};
class ProxyConfigurable
{
public:
void fromConfig (const ConfigProxy&);
private:
virtual void runFromConfig (const ConfigProxy&) = 0;
};
#endif
================================================
FILE: lib/src/dimension.cpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#include <cstdlib>
#include <glm/glm.hpp>
#include "dimension.hpp"
#include "util.hpp"
unsigned int DimensionUtil::index (Dimension d)
{
switch (d)
{
case Dimension::X:
return 0;
case Dimension::Y:
return 1;
case Dimension::Z:
return 2;
}
DILAY_IMPOSSIBLE
}
glm::vec3 DimensionUtil::vector (Dimension d)
{
switch (d)
{
case Dimension::X:
return glm::vec3 (1.0f, 0.0f, 0.0f);
case Dimension::Y:
return glm::vec3 (0.0f, 1.0f, 0.0f);
case Dimension::Z:
return glm::vec3 (0.0f, 0.0f, 1.0f);
}
DILAY_IMPOSSIBLE
}
================================================
FILE: lib/src/dimension.hpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#ifndef DILAY_DIMENSION
#define DILAY_DIMENSION
#include <glm/fwd.hpp>
enum class Dimension
{
X,
Y,
Z
};
namespace DimensionUtil
{
unsigned int index (Dimension);
glm::vec3 vector (Dimension);
}
#endif
================================================
FILE: lib/src/distance.cpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#include <glm/glm.hpp>
#include "distance.hpp"
#include "primitive/cone-sphere.hpp"
#include "primitive/cone.hpp"
#include "primitive/cylinder.hpp"
#include "primitive/sphere.hpp"
#include "primitive/triangle.hpp"
#include "util.hpp"
namespace
{
float distanceToCylinder (const glm::vec3& center1, float radius, float length,
const glm::vec3& direction, const glm::vec3& point)
{
const glm::vec3 toP = point - center1;
const float x = glm::dot (toP, direction);
const float ySqr = glm::dot (toP, toP) - (x * x);
const float y = Util::almostEqual (0.0f, ySqr) ? 0.0f : glm::sqrt (ySqr);
const float yr = y - radius;
const float xl = x - length;
const bool insideR = yr <= 0.0f;
if (x <= 0.0f)
{
return insideR ? glm::abs (x) : glm::sqrt ((x * x) + (yr * yr));
}
else if (x >= length)
{
return insideR ? xl : glm::sqrt ((xl * xl) + (yr * yr));
}
else
{
return insideR ? glm::max (-x, glm::max (yr, xl)) : yr;
}
}
}
float Distance::distance (const PrimSphere& sphere, const glm::vec3& point)
{
return glm::distance (sphere.center (), point) - sphere.radius ();
}
float Distance::distance (const PrimCylinder& cylinder, const glm::vec3& point)
{
return distanceToCylinder (cylinder.center1 (), cylinder.radius (), cylinder.length (),
cylinder.direction (), point);
}
float Distance::distance (const PrimCone& cone, const glm::vec3& point)
{
if (cone.isCylinder ())
{
return distanceToCylinder (cone.center1 (), cone.radius1 (), cone.length (), cone.direction (),
point);
}
else
{
const glm::vec3 toP = point - cone.center1 ();
const float x = glm::dot (toP, cone.direction ());
const float ySqr = glm::dot (toP, toP) - (x * x);
const float y = Util::almostEqual (0.0f, ySqr) ? 0.0f : glm::sqrt (ySqr);
const float r1 = cone.radius1 ();
const float r2 = cone.radius2 ();
const float l = cone.length ();
if (x <= 0.0f)
{
return y <= r1 ? -x : glm::sqrt ((x * x) + ((y - r1) * (y - r1)));
}
else if (x >= l && y <= r2)
{
return x - l;
}
else
{
const float xn = (x * cone.cosAlpha ()) - ((y - r1) * cone.sinAlpha ());
const float yn = (x * cone.sinAlpha ()) + ((y - r1) * cone.cosAlpha ());
const float delta = r1 - r2;
const float s = glm::sqrt ((l * l) + (delta * delta));
if (xn <= 0.0f)
{
return glm::sqrt ((x * x) + ((y - r1) * (y - r1)));
}
else if (xn >= s)
{
if (x <= l)
{
assert (yn <= 0.0f);
return x - l;
}
else
{
return glm::sqrt ((yn * yn) + ((xn - s) * (xn - s)));
}
}
else if (yn >= 0.0f)
{
return yn;
}
else
{
return glm::max (-x, glm::max (yn, x - l));
}
}
}
}
float Distance::distance (const PrimConeSphere& coneSphere, const glm::vec3& point)
{
const glm::vec3 toP = point - coneSphere.sphere1 ().center ();
const float x = glm::dot (toP, coneSphere.direction ());
const float ySqr = glm::dot (toP, toP) - (x * x);
const float y = Util::almostEqual (0.0f, ySqr) ? 0.0f : glm::sqrt (ySqr);
const float r1 = coneSphere.sphere1 ().radius ();
const float r2 = coneSphere.sphere2 ().radius ();
const float l = coneSphere.length ();
if (coneSphere.sameRadii ())
{
if (x <= 0.0f)
{
return glm::sqrt ((x * x) + (y * y)) - r1;
}
else if (x >= l)
{
return glm::sqrt (((x - l) * (x - l)) + (y * y)) - r1;
}
else
{
return y - r1;
}
}
else if (coneSphere.hasCone ())
{
const float s = coneSphere.coneSideLength ();
const float h1 = r1 * coneSphere.delta () / l;
const float h2 = r2 * coneSphere.delta () / l;
const float r1c = r1 * s / l;
const float r2c = r2 * s / l;
if (x <= 0.0f)
{
return glm::sqrt ((x * x) + (y * y)) - r1;
}
else if (x >= l + h2 && y <= r2c)
{
return glm::sqrt (((x - l) * (x - l)) + (y * y)) - r2;
}
else
{
const float xn = ((x - h1) * coneSphere.cosAlpha ()) - ((y - r1c) * coneSphere.sinAlpha ());
const float yn = ((x - h1) * coneSphere.sinAlpha ()) + ((y - r1c) * coneSphere.cosAlpha ());
if (xn <= 0.0f)
{
return glm::sqrt ((x * x) + (y * y)) - r1;
}
else if (xn >= s)
{
return glm::sqrt (((x - l) * (x - l)) + (y * y)) - r2;
}
else
{
return yn;
}
}
}
else
{
return glm::sqrt ((x * x) + (y * y)) - r1;
}
}
// cf. https://www.geometrictools.com/Documentation/DistancePoint3Triangle3.pdf
float Distance::distance (const PrimTriangle& tri, const glm::vec3& point)
{
const glm::vec3& P = point;
const glm::vec3& B = tri.vertex1 ();
const glm::vec3 E0 = tri.vertex2 () - tri.vertex1 ();
const glm::vec3 E1 = tri.vertex3 () - tri.vertex1 ();
const glm::vec3 D = B - P;
const float a = glm::dot (E0, E0);
const float b = glm::dot (E0, E1);
const float c = glm::dot (E1, E1);
const float d = glm::dot (E0, D);
const float e = glm::dot (E1, D);
float s = (b * e) - (c * d);
float t = (b * d) - (a * e);
const float det = (a * c) - (b * b);
if (s + t <= det)
{
if (s < 0.0f)
{
if (t < 0.0f)
{
// region 4
if (d < 0.0f)
{
t = 0.0f;
s = -d > a ? 1.0f : -d / a;
}
else
{
s = 0.0f;
if (e >= 0.0f)
{
t = 0.0f;
}
else if (-e >= c)
{
t = 1.0f;
}
else
{
t = -e / c;
}
}
}
else
{
// region 3
s = 0.0f;
if (e >= 0.0f)
{
t = 0.0f;
}
else if (-e >= c)
{
t = 1.0f;
}
else
{
t = -e / c;
}
}
}
else if (t < 0.0f)
{
// region 5
t = 0.0f;
if (d >= 0.0f)
{
s = 0.0f;
}
else if (-d >= a)
{
s = 1.0f;
}
else
{
s = -d / a;
}
}
else
{
// region 0
s /= det;
t /= det;
}
}
else
{
if (s < 0.0f)
{
// region 2
const float tmp0 = b + d;
const float tmp1 = c + e;
if (tmp1 > tmp0)
{
const float numer = tmp1 - tmp0;
const float denom = a - (2.0f * b) + c;
s = numer >= denom ? 1.0f : numer / denom;
t = 1.0f - s;
}
else
{
s = 0.0f;
if (tmp1 <= 0.0f)
{
t = 1.0f;
}
else if (e >= 0.0f)
{
t = 0.0f;
}
else
{
t = -e / c;
}
}
}
else if (t < 0.0f)
{
// region 6
const float tmp0 = b + e;
const float tmp1 = a + d;
if (tmp1 > tmp0)
{
const float numer = tmp1 - tmp0;
const float denom = a - (2.0f * b) + c;
t = numer >= denom ? 1.0f : numer / denom;
s = 1.0f - t;
}
else
{
t = 0.0f;
if (tmp1 <= 0.0f)
{
s = 1.0f;
}
else if (d >= 0.0f)
{
s = 0.0f;
}
else
{
s = -d / a;
}
}
}
else
{
// region 1
const float numer = (c + e) - (b + d);
if (numer <= 0.0f)
{
s = 0.0f;
}
else
{
const float denom = a - (2.0f * b) + c;
s = numer >= denom ? 1.0f : numer / denom;
}
t = 1.0f - s;
}
}
return glm::distance (point, B + (s * E0) + (t * E1));
}
================================================
FILE: lib/src/distance.hpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#ifndef DILAY_DISTANCE
#define DILAY_DISTANCE
#include <glm/fwd.hpp>
class PrimCone;
class PrimConeSphere;
class PrimCylinder;
class PrimSphere;
class PrimTriangle;
namespace Distance
{
float distance (const PrimSphere&, const glm::vec3&);
float distance (const PrimCylinder&, const glm::vec3&);
float distance (const PrimCone&, const glm::vec3&);
float distance (const PrimConeSphere&, const glm::vec3&);
float distance (const PrimTriangle&, const glm::vec3&);
}
#endif
================================================
FILE: lib/src/dynamic/faces.cpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#include "dynamic/faces.hpp"
void DynamicFaces::insert (unsigned int i) { this->_uncommitted.insert (i); }
void DynamicFaces::insert (const DynamicFaces::Container& v)
{
this->_uncommitted.insert (v.begin (), v.end ());
}
void DynamicFaces::reset ()
{
this->resetCommitted ();
this->_uncommitted.clear ();
}
void DynamicFaces::resetCommitted () { this->_indices.clear (); }
void DynamicFaces::commit ()
{
if (this->_indices.empty ())
{
this->_indices.swap (this->_uncommitted);
}
else
{
this->_indices.insert (this->_uncommitted.begin (), this->_uncommitted.end ());
this->_uncommitted.clear ();
}
}
bool DynamicFaces::contains (unsigned int i) const
{
return this->_indices.find (i) != this->_indices.end ();
}
bool DynamicFaces::isEmpty () const
{
return this->_indices.empty () && this->_uncommitted.empty ();
}
bool DynamicFaces::hasUncomitted () const { return this->_uncommitted.empty () == false; }
void DynamicFaces::filter (const std::function<bool(unsigned int)>& f)
{
for (auto it = this->_indices.begin (); it != this->_indices.end ();)
{
if (f (*it) == false)
{
it = this->_indices.erase (it);
}
else
{
++it;
}
}
for (auto it = this->_uncommitted.begin (); it != this->_uncommitted.end ();)
{
if (f (*it) == false)
{
it = this->_uncommitted.erase (it);
}
else
{
++it;
}
}
}
================================================
FILE: lib/src/dynamic/faces.hpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#ifndef DILAY_DYNAMIC_FACES
#define DILAY_DYNAMIC_FACES
#include <functional>
#include <unordered_set>
class DynamicFaces
{
public:
typedef std::unordered_set<unsigned int> Container;
const Container& indices () const { return this->_indices; }
const Container& uncommitted () const { return this->_uncommitted; }
unsigned int numElements () const { return this->_indices.size (); }
Container::iterator begin () { return this->_indices.begin (); }
Container::iterator end () { return this->_indices.end (); }
Container::const_iterator begin () const { return this->_indices.begin (); }
Container::const_iterator end () const { return this->_indices.end (); }
void insert (unsigned int);
void insert (const Container&);
void reset ();
void resetCommitted ();
void commit ();
bool contains (unsigned int) const;
bool isEmpty () const;
bool hasUncomitted () const;
void filter (const std::function<bool(unsigned int)>&);
private:
Container _indices;
Container _uncommitted;
};
#endif
================================================
FILE: lib/src/dynamic/mesh-intersection.cpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#include "dynamic/mesh-intersection.hpp"
#include "dynamic/mesh.hpp"
#include "util.hpp"
DynamicMeshIntersection::DynamicMeshIntersection ()
: _faceIndex (Util::invalidIndex ())
, _mesh (nullptr)
{
}
bool DynamicMeshIntersection::update (float d, const glm::vec3& p, const glm::vec3& n,
unsigned int i, DynamicMesh& mesh)
{
if (this->Intersection::update (d, p, n))
{
this->_mesh = &mesh;
this->_faceIndex = i;
return true;
}
else
{
return false;
}
}
unsigned int DynamicMeshIntersection::faceIndex () const
{
assert (this->isIntersection ());
return this->_faceIndex;
}
DynamicMesh& DynamicMeshIntersection::mesh () const
{
assert (this->isIntersection ());
assert (this->_mesh);
return *this->_mesh;
}
================================================
FILE: lib/src/dynamic/mesh-intersection.hpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#ifndef DILAY_DYNAMIC_MESH_INTERSECTION
#define DILAY_DYNAMIC_MESH_INTERSECTION
#include "intersection.hpp"
class DynamicMesh;
class DynamicMeshIntersection : public Intersection
{
public:
DynamicMeshIntersection ();
DynamicMesh& mesh () const;
unsigned int faceIndex () const;
bool update (float, const glm::vec3&, const glm::vec3&, unsigned int, DynamicMesh&);
private:
unsigned int _faceIndex;
DynamicMesh* _mesh;
};
#endif
================================================
FILE: lib/src/dynamic/mesh.cpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#include <cstring>
#include <glm/glm.hpp>
#include <glm/gtx/norm.hpp>
#include <vector>
#include "../mesh.hpp"
#include "config.hpp"
#include "distance.hpp"
#include "dynamic/faces.hpp"
#include "dynamic/mesh-intersection.hpp"
#include "dynamic/mesh.hpp"
#include "dynamic/octree.hpp"
#include "intersection.hpp"
#include "mesh-util.hpp"
#include "primitive/aabox.hpp"
#include "primitive/plane.hpp"
#include "primitive/ray.hpp"
#include "primitive/triangle.hpp"
#include "tool/sculpt/util/action.hpp"
#include "util.hpp"
namespace
{
struct VertexData
{
bool isFree;
std::vector<unsigned int> adjacentFaces;
VertexData () { this->reset (); }
void reset ()
{
this->isFree = true;
this->adjacentFaces.clear ();
}
void addAdjacentFace (unsigned int face) { this->adjacentFaces.push_back (face); }
void deleteAdjacentFace (unsigned int face)
{
for (auto it = this->adjacentFaces.begin (); it != this->adjacentFaces.end (); ++it)
{
if (*it == face)
{
this->adjacentFaces.erase (it);
return;
}
}
DILAY_IMPOSSIBLE
}
};
struct FaceData
{
bool isFree;
FaceData () { this->reset (); }
void reset () { this->isFree = true; }
};
}
struct DynamicMesh::Impl
{
DynamicMesh* self;
Mesh mesh;
std::vector<VertexData> vertexData;
std::vector<unsigned char> vertexVisited;
std::vector<unsigned int> freeVertexIndices;
std::vector<FaceData> faceData;
std::vector<unsigned char> faceVisited;
std::vector<unsigned int> freeFaceIndices;
DynamicOctree octree;
Impl (DynamicMesh* s)
: self (s)
{
}
Impl (DynamicMesh* s, const Mesh& m)
: self (s)
{
this->fromMesh (m);
}
unsigned int numVertices () const
{
assert (this->mesh.numVertices () >= this->freeVertexIndices.size ());
assert (this->mesh.numVertices () == this->vertexData.size ());
return this->mesh.numVertices () - this->freeVertexIndices.size ();
}
unsigned int numFaces () const
{
assert (this->faceData.size () >= this->freeFaceIndices.size ());
return this->faceData.size () - this->freeFaceIndices.size ();
}
bool isEmpty () const { return this->numFaces () == 0; }
bool isFreeVertex (unsigned int i) const
{
assert (i < this->vertexData.size ());
return this->vertexData[i].isFree;
}
bool isFreeFace (unsigned int i) const
{
assert (i < this->faceData.size ());
return this->faceData[i].isFree;
}
bool isPruned () const
{
return this->freeFaceIndices.empty () && this->freeVertexIndices.empty ();
}
unsigned int valence (unsigned int i) const
{
assert (this->isFreeVertex (i) == false);
return this->vertexData[i].adjacentFaces.size ();
}
void vertexIndices (unsigned int i, unsigned int& i1, unsigned int& i2, unsigned int& i3) const
{
assert (this->isFreeFace (i) == false);
i1 = this->mesh.index ((3 * i) + 0);
i2 = this->mesh.index ((3 * i) + 1);
i3 = this->mesh.index ((3 * i) + 2);
}
PrimTriangle face (unsigned int i) const
{
assert (this->isFreeFace (i) == false);
return PrimTriangle (this->mesh.vertex (this->mesh.index ((3 * i) + 0)),
this->mesh.vertex (this->mesh.index ((3 * i) + 1)),
this->mesh.vertex (this->mesh.index ((3 * i) + 2)));
}
const glm::vec3& vertexNormal (unsigned int i) const { return this->mesh.normal (i); }
glm::vec3 faceNormal (unsigned int i) const
{
assert (this->isFreeFace (i) == false);
unsigned int i1, i2, i3;
this->vertexIndices (i, i1, i2, i3);
return glm::normalize (glm::cross (this->mesh.vertex (i2) - this->mesh.vertex (i1),
this->mesh.vertex (i3) - this->mesh.vertex (i1)));
}
void findAdjacent (unsigned int e1, unsigned int e2, unsigned int& leftFace,
unsigned int& leftVertex, unsigned int& rightFace,
unsigned int& rightVertex) const
{
assert (this->isFreeVertex (e1) == false);
assert (this->isFreeVertex (e2) == false);
leftFace = Util::invalidIndex ();
leftVertex = Util::invalidIndex ();
rightFace = Util::invalidIndex ();
rightVertex = Util::invalidIndex ();
for (unsigned int a : this->vertexData[e1].adjacentFaces)
{
unsigned int i1, i2, i3;
this->vertexIndices (a, i1, i2, i3);
if (e1 == i1 && e2 == i2)
{
leftFace = a;
leftVertex = i3;
}
else if (e1 == i2 && e2 == i1)
{
rightFace = a;
rightVertex = i3;
}
else if (e1 == i2 && e2 == i3)
{
leftFace = a;
leftVertex = i1;
}
else if (e1 == i3 && e2 == i2)
{
rightFace = a;
rightVertex = i1;
}
else if (e1 == i3 && e2 == i1)
{
leftFace = a;
leftVertex = i2;
}
else if (e1 == i1 && e2 == i3)
{
rightFace = a;
rightVertex = i2;
}
}
assert (leftFace != Util::invalidIndex ());
assert (leftVertex != Util::invalidIndex ());
assert (rightFace != Util::invalidIndex ());
assert (rightVertex != Util::invalidIndex ());
}
const std::vector<unsigned int>& adjacentFaces (unsigned int i) const
{
assert (this->isFreeVertex (i) == false);
return this->vertexData[i].adjacentFaces;
}
void forEachVertex (const std::function<void(unsigned int)>& f) const
{
for (unsigned int i = 0; i < this->vertexData.size (); i++)
{
if (this->isFreeVertex (i) == false)
{
f (i);
}
}
}
void visitVertices (unsigned int i, const std::function<void(unsigned int)>& f)
{
assert (this->isFreeFace (i) == false);
unsigned int i1, i2, i3;
this->vertexIndices (i, i1, i2, i3);
if (this->vertexVisited[i1] == 0)
{
this->vertexVisited[i1] = 1;
f (i1);
}
if (this->vertexVisited[i2] == 0)
{
this->vertexVisited[i2] = 1;
f (i2);
}
if (this->vertexVisited[i3] == 0)
{
this->vertexVisited[i3] = 1;
f (i3);
}
this->faceVisited[i] = 1;
}
void unvisitVertices ()
{
std::memset (this->vertexVisited.data (), 0, this->vertexVisited.size ());
}
void unvisitFaces () { std::memset (this->faceVisited.data (), 0, this->faceVisited.size ()); }
void forEachVertex (const DynamicFaces& faces, const std::function<void(unsigned int)>& f)
{
this->unvisitVertices ();
for (unsigned int i : faces)
{
this->visitVertices (i, f);
}
}
void forEachVertexExt (const DynamicFaces& faces, const std::function<void(unsigned int)>& f)
{
this->unvisitVertices ();
this->unvisitFaces ();
for (unsigned int i : faces)
{
this->visitVertices (i, [this, &f](unsigned int j) {
f (j);
for (unsigned int a : this->vertexData[j].adjacentFaces)
{
if (this->faceVisited[a] == 0)
{
this->visitVertices (a, f);
}
}
});
}
}
void forEachVertexAdjacentToVertex (unsigned int i,
const std::function<void(unsigned int)>& f) const
{
assert (this->isFreeVertex (i) == false);
for (unsigned int a : this->vertexData[i].adjacentFaces)
{
unsigned int a1, a2, a3;
this->vertexIndices (a, a1, a2, a3);
if (i == a1)
{
f (a2);
}
else if (i == a2)
{
f (a3);
}
else if (i == a3)
{
f (a1);
}
else
{
DILAY_IMPOSSIBLE
}
}
}
void forEachVertexAdjacentToFace (unsigned int i,
const std::function<void(unsigned int)>& f) const
{
assert (this->isFreeFace (i) == false);
unsigned int i1, i2, i3;
this->vertexIndices (i, i1, i2, i3);
f (i1);
f (i2);
f (i3);
}
void forEachFace (const std::function<void(unsigned int)>& f) const
{
for (unsigned int i = 0; i < this->faceData.size (); i++)
{
if (this->isFreeFace (i) == false)
{
f (i);
}
}
}
void forEachFaceExt (const DynamicFaces& faces, const std::function<void(unsigned int)>& f)
{
this->unvisitVertices ();
this->unvisitFaces ();
for (unsigned int i : faces)
{
if (this->faceVisited[i] == 0)
{
f (i);
this->faceVisited[i] = 1;
}
this->visitVertices (i, [this, &f](unsigned int j) {
for (unsigned int a : this->vertexData[j].adjacentFaces)
{
if (this->faceVisited[a] == 0)
{
f (a);
this->faceVisited[a] = 1;
}
}
});
}
}
void average (const DynamicFaces& faces, glm::vec3& position, glm::vec3& normal) const
{
assert (faces.numElements () > 0);
position = glm::vec3 (0.0f);
normal = glm::vec3 (0.0f);
for (unsigned int f : faces)
{
unsigned int i1, i2, i3;
this->vertexIndices (f, i1, i2, i3);
position += this->mesh.vertex (i1);
position += this->mesh.vertex (i2);
position += this->mesh.vertex (i3);
normal += glm::cross (this->mesh.vertex (i2) - this->mesh.vertex (i1),
this->mesh.vertex (i3) - this->mesh.vertex (i1));
}
position /= float(faces.numElements () * 3);
normal = glm::normalize (normal);
}
glm::vec3 averagePosition (const DynamicFaces& faces) const
{
assert (faces.numElements () > 0);
glm::vec3 position = glm::vec3 (0.0f);
for (unsigned int f : faces)
{
this->forEachVertexAdjacentToFace (
f, [this, &position](unsigned int v) { position += this->mesh.vertex (v); });
}
return position / float(faces.numElements () * 3);
}
glm::vec3 averagePosition (unsigned int i) const
{
assert (this->isFreeVertex (i) == false);
assert (this->vertexData[i].adjacentFaces.size () > 0);
glm::vec3 position = glm::vec3 (0.0f);
this->forEachVertexAdjacentToVertex (
i, [this, &position](unsigned int v) { position += this->mesh.vertex (v); });
return position / float(this->vertexData[i].adjacentFaces.size ());
}
glm::vec3 averageNormal (const DynamicFaces& faces) const
{
assert (faces.numElements () > 0);
glm::vec3 normal = glm::vec3 (0.0f);
for (unsigned int f : faces)
{
unsigned int i1, i2, i3;
this->vertexIndices (f, i1, i2, i3);
normal += glm::cross (this->mesh.vertex (i2) - this->mesh.vertex (i1),
this->mesh.vertex (i3) - this->mesh.vertex (i1));
}
return glm::normalize (normal);
}
glm::vec3 averageNormal (unsigned int i) const
{
assert (this->isFreeVertex (i) == false);
assert (this->vertexData[i].adjacentFaces.size () > 0);
glm::vec3 normal = glm::vec3 (0.0f);
for (unsigned int f : this->vertexData[i].adjacentFaces)
{
unsigned int i1, i2, i3;
this->vertexIndices (f, i1, i2, i3);
normal += glm::cross (this->mesh.vertex (i2) - this->mesh.vertex (i1),
this->mesh.vertex (i3) - this->mesh.vertex (i1));
}
return glm::normalize (normal);
}
float averageEdgeLengthSqr (const DynamicFaces& faces) const
{
assert (faces.numElements () > 0);
float length = 0.0f;
for (unsigned int i : faces)
{
length += this->averageEdgeLengthSqr (i);
}
return length / float(faces.numElements ());
}
float averageEdgeLengthSqr (unsigned int i) const
{
assert (this->isFreeFace (i) == false);
unsigned int i1, i2, i3;
this->vertexIndices (i, i1, i2, i3);
const glm::vec3& v1 = this->mesh.vertex (i1);
const glm::vec3& v2 = this->mesh.vertex (i2);
const glm::vec3& v3 = this->mesh.vertex (i3);
return (glm::distance2 (v1, v2) + glm::distance2 (v1, v3) + glm::distance2 (v2, v3)) / 3.0f;
}
unsigned int addVertex (const glm::vec3& vertex, const glm::vec3& normal)
{
assert (this->vertexData.size () == this->mesh.numVertices ());
assert (this->vertexVisited.size () == this->mesh.numVertices ());
if (this->freeVertexIndices.empty ())
{
this->vertexData.emplace_back ();
this->vertexData.back ().isFree = false;
this->vertexVisited.push_back (0);
return this->mesh.addVertex (vertex, normal);
}
else
{
const unsigned int index = this->freeVertexIndices.back ();
this->mesh.vertex (index, vertex);
this->mesh.normal (index, normal);
this->vertexData[index].reset ();
this->vertexData[index].isFree = false;
this->vertexVisited[index] = 0;
this->freeVertexIndices.pop_back ();
return index;
}
}
unsigned int addFace (unsigned int i1, unsigned int i2, unsigned int i3)
{
assert (i1 < this->mesh.numVertices ());
assert (i2 < this->mesh.numVertices ());
assert (i3 < this->mesh.numVertices ());
assert (3 * this->faceData.size () == this->mesh.numIndices ());
assert (this->faceData.size () == this->faceVisited.size ());
unsigned int index = Util::invalidIndex ();
if (this->freeFaceIndices.empty ())
{
index = this->numFaces ();
this->faceData.emplace_back ();
this->faceVisited.push_back (0);
this->mesh.addIndex (i1);
this->mesh.addIndex (i2);
this->mesh.addIndex (i3);
}
else
{
index = this->freeFaceIndices.back ();
this->faceData[index].reset ();
this->faceVisited[index] = 0;
this->freeFaceIndices.pop_back ();
this->mesh.index ((3 * index) + 0, i1);
this->mesh.index ((3 * index) + 1, i2);
this->mesh.index ((3 * index) + 2, i3);
}
this->faceData[index].isFree = false;
this->vertexData[i1].addAdjacentFace (index);
this->vertexData[i2].addAdjacentFace (index);
this->vertexData[i3].addAdjacentFace (index);
this->addFaceToOctree (index);
return index;
}
void addFaceToOctree (unsigned int i)
{
const PrimTriangle tri = this->face (i);
if (this->octree.hasRoot () == false)
{
this->octree.setupRoot (tri.center (), tri.maxDimExtent ());
}
this->octree.addElement (i, tri.center (), tri.maxDimExtent ());
}
void deleteVertex (unsigned int i)
{
assert (i < this->vertexData.size ());
assert (i < this->vertexVisited.size ());
std::vector<unsigned int> adjacentFaces = this->vertexData[i].adjacentFaces;
for (unsigned int f : adjacentFaces)
{
this->deleteFace (f);
}
this->vertexData[i].reset ();
this->vertexVisited[i] = 0;
this->freeVertexIndices.push_back (i);
}
void deleteFace (unsigned int i)
{
assert (i < this->faceData.size ());
assert (i < this->faceVisited.size ());
this->vertexData[this->mesh.index ((3 * i) + 0)].deleteAdjacentFace (i);
this->vertexData[this->mesh.index ((3 * i) + 1)].deleteAdjacentFace (i);
this->vertexData[this->mesh.index ((3 * i) + 2)].deleteAdjacentFace (i);
this->faceData[i].reset ();
this->faceVisited[i] = 0;
this->freeFaceIndices.push_back (i);
this->octree.deleteElement (i);
}
void vertexNormal (unsigned int i, const glm::vec3& n)
{
assert (this->isFreeVertex (i) == false);
assert (this->mesh.numVertices () == this->vertexData.size ());
this->mesh.normal (i, n);
}
void setVertexNormal (unsigned int i)
{
const glm::vec3 avg = this->averageNormal (i);
if (Util::isNaN (avg))
{
this->mesh.normal (i, glm::vec3 (0.0f));
}
else
{
this->mesh.normal (i, avg);
}
}
void setAllNormals ()
{
this->forEachVertex ([this](unsigned int i) { this->setVertexNormal (i); });
}
void reset ()
{
this->mesh.reset ();
this->vertexData.clear ();
this->vertexVisited.clear ();
this->freeVertexIndices.clear ();
this->faceData.clear ();
this->faceVisited.clear ();
this->freeFaceIndices.clear ();
this->octree.reset ();
}
void fromMesh (const Mesh& mesh)
{
this->reset ();
this->mesh.reserveVertices (mesh.numVertices ());
for (unsigned int i = 0; i < mesh.numVertices (); i++)
{
this->addVertex (mesh.vertex (i), mesh.normal (i));
}
assert (mesh.numIndices () % 3 == 0);
this->mesh.reserveIndices (mesh.numIndices ());
for (unsigned int i = 0; i < mesh.numIndices (); i += 3)
{
this->addFace (mesh.index (i), mesh.index (i + 1), mesh.index (i + 2));
}
this->setAllNormals ();
this->mesh.bufferData ();
}
void realignFace (unsigned int i)
{
assert (this->isFreeFace (i) == false);
const PrimTriangle tri = this->face (i);
this->octree.realignElement (i, tri.center (), tri.maxDimExtent ());
}
void realignFaces (const DynamicFaces& faces)
{
for (unsigned int i : faces)
{
this->realignFace (i);
}
}
void realignAllFaces ()
{
this->forEachFace ([this](unsigned int i) { this->realignFace (i); });
}
void sanitize ()
{
this->octree.deleteEmptyChildren ();
this->octree.shrinkRoot ();
}
void prune (std::vector<unsigned int>* pVertexIndexMap, std::vector<unsigned int>* pFaceIndexMap)
{
if (this->isPruned () == false)
{
std::vector<unsigned int> defaultVertexIndexMap;
std::vector<unsigned int> defaultFaceIndexMap;
if (pVertexIndexMap == nullptr)
{
pVertexIndexMap = &defaultVertexIndexMap;
}
if (pFaceIndexMap == nullptr)
{
pFaceIndexMap = &defaultFaceIndexMap;
}
Util::prune<VertexData> (this->vertexData, [](const VertexData& d) { return d.isFree; },
pVertexIndexMap);
Util::prune<FaceData> (this->faceData, [](const FaceData& d) { return d.isFree; },
pFaceIndexMap);
const unsigned int newNumVertices = this->vertexData.size ();
const unsigned int newNumFaces = this->faceData.size ();
for (VertexData& d : this->vertexData)
{
for (unsigned int& f : d.adjacentFaces)
{
assert (pFaceIndexMap->at (f) != Util::invalidIndex ());
f = pFaceIndexMap->at (f);
}
}
for (unsigned int i = 0; i < pVertexIndexMap->size (); i++)
{
const unsigned int newV = pVertexIndexMap->at (i);
if (newV != Util::invalidIndex ())
{
this->mesh.vertex (newV, this->mesh.vertex (i));
this->mesh.normal (newV, this->mesh.normal (i));
}
else
{
// Expensive (!) in debug builds
assert (std::find (this->freeVertexIndices.begin (), this->freeVertexIndices.end (), i) !=
this->freeVertexIndices.end ());
}
}
this->freeVertexIndices.clear ();
this->mesh.shrinkVertices (newNumVertices);
this->vertexVisited.resize (newNumVertices);
assert (this->numVertices () == newNumVertices);
for (unsigned int i = 0; i < pFaceIndexMap->size (); i++)
{
const unsigned int newF = pFaceIndexMap->at (i);
if (newF != Util::invalidIndex ())
{
const unsigned int oldI1 = this->mesh.index ((3 * i) + 0);
const unsigned int oldI2 = this->mesh.index ((3 * i) + 1);
const unsigned int oldI3 = this->mesh.index ((3 * i) + 2);
assert (pVertexIndexMap->at (oldI1) != Util::invalidIndex ());
assert (pVertexIndexMap->at (oldI2) != Util::invalidIndex ());
assert (pVertexIndexMap->at (oldI3) != Util::invalidIndex ());
this->mesh.index ((3 * newF) + 0, pVertexIndexMap->at (oldI1));
this->mesh.index ((3 * newF) + 1, pVertexIndexMap->at (oldI2));
this->mesh.index ((3 * newF) + 2, pVertexIndexMap->at (oldI3));
}
else
{
// Expensive (!) in debug builds
assert (std::find (this->freeFaceIndices.begin (), this->freeFaceIndices.end (), i) !=
this->freeFaceIndices.end ());
}
}
this->freeFaceIndices.clear ();
this->mesh.shrinkIndices (3 * newNumFaces);
this->faceVisited.resize (newNumFaces);
assert (this->numFaces () == newNumFaces);
this->octree.updateIndices (*pFaceIndexMap);
}
}
bool pruneAndCheckConsistency (std::vector<unsigned int>* pVertexIndexMap,
std::vector<unsigned int>* pFaceIndexMap)
{
this->prune (pVertexIndexMap, pFaceIndexMap);
this->bufferData ();
if (MeshUtil::checkConsistency (this->mesh))
{
for (unsigned int i = 0; i < this->vertexData.size (); i++)
{
if (this->vertexData[i].isFree == false)
{
if (this->vertexData[i].adjacentFaces.empty ())
{
DILAY_WARN ("vertex %u is not free but has no adjacent faces", i);
return false;
}
}
}
return true;
}
else
{
return false;
}
}
bool mirrorPositive (const PrimPlane& plane)
{
assert (this->pruneAndCheckConsistency (nullptr, nullptr));
const auto inBorder = [this, &plane](unsigned int f) {
unsigned int i1, i2, i3;
this->vertexIndices (f, i1, i2, i3);
const float d1 = glm::abs (plane.distance (this->mesh.vertex (i1)));
const float d2 = glm::abs (plane.distance (this->mesh.vertex (i2)));
const float d3 = glm::abs (plane.distance (this->mesh.vertex (i3)));
return d1 <= Util::epsilon () && d2 <= Util::epsilon () && d3 <= Util::epsilon ();
};
DynamicFaces faces;
do
{
faces.reset ();
if (this->intersects (plane, faces) == false)
{
break;
}
faces.filter (inBorder);
if (faces.isEmpty ())
{
break;
}
} while (ToolSculptAction::deleteFaces (*this->self, faces));
assert (this->pruneAndCheckConsistency (nullptr, nullptr));
this->prune (nullptr, nullptr);
Mesh mirrored = MeshUtil::mirrorPositive (this->mesh, plane);
if (mirrored.numVertices () == 0)
{
this->setAllNormals ();
return false;
}
else
{
this->fromMesh (mirrored);
assert (this->pruneAndCheckConsistency (nullptr, nullptr));
return true;
}
}
void mirror (const PrimPlane& plane)
{
MeshUtil::mirror (this->mesh, plane);
this->realignAllFaces ();
this->bufferData ();
}
void moveToCenter ()
{
MeshUtil::moveToCenter (this->mesh);
this->realignAllFaces ();
this->bufferData ();
}
void normalizeScaling ()
{
MeshUtil::normalizeScaling (this->mesh);
this->realignAllFaces ();
this->bufferData ();
}
void bufferData ()
{
const auto findNonFreeFaceIndex = [this]() -> unsigned int {
assert (this->numFaces () > 0);
for (unsigned int i = 0; i < this->faceData.size (); i++)
{
if (this->isFreeFace (i) == false)
{
return i;
}
}
DILAY_IMPOSSIBLE
};
if (this->numFaces () > 0 && this->freeFaceIndices.empty () == false)
{
const unsigned int nonFree = findNonFreeFaceIndex ();
for (unsigned int i : this->freeFaceIndices)
{
this->mesh.index ((3 * i) + 0, this->mesh.index ((3 * nonFree) + 0));
this->mesh.index ((3 * i) + 1, this->mesh.index ((3 * nonFree) + 1));
this->mesh.index ((3 * i) + 2, this->mesh.index ((3 * nonFree) + 2));
}
}
this->mesh.bufferData ();
}
void render (Camera& camera) const
{
this->mesh.render (camera);
#ifdef DILAY_RENDER_OCTREE
this->octree.render (camera);
#endif
}
bool intersects (const PrimRay& ray, Intersection& intersection, bool bothSides) const
{
this->octree.intersects (ray, [this, &ray, &intersection, bothSides](unsigned int i) -> float {
const PrimTriangle tri = this->face (i);
float t;
if (IntersectionUtil::intersects (ray, tri, bothSides, &t))
{
intersection.update (t, ray.pointAt (t), tri.normal ());
return t;
}
else
{
return Util::maxFloat ();
}
});
return intersection.isIntersection ();
}
bool intersects (const PrimRay& ray, DynamicMeshIntersection& intersection)
{
this->octree.intersects (ray, [this, &ray, &intersection](unsigned int i) -> float {
const PrimTriangle tri = this->face (i);
float t;
if (IntersectionUtil::intersects (ray, tri, false, &t))
{
intersection.update (t, ray.pointAt (t), tri.normal (), i, *this->self);
return intersection.distance ();
}
else
{
return Util::maxFloat ();
}
});
return intersection.isIntersection ();
}
template <typename T, typename... Ts>
bool intersectsT (const T& t, DynamicFaces& faces, const Ts&... args) const
{
this->octree.intersects (t, [this, &t, &faces, &args...](unsigned int i) {
if (IntersectionUtil::intersects (t, this->face (i), args...))
{
faces.insert (i);
}
});
faces.commit ();
return faces.isEmpty () == false;
}
template <typename T, typename... Ts>
bool containsOrIntersectsT (const T& t, DynamicFaces& faces, const Ts&... args) const
{
this->octree.intersects (t, [this, &t, &faces, &args...](bool contains, unsigned int i) {
if (contains || IntersectionUtil::intersects (t, this->face (i), args...))
{
faces.insert (i);
faces.commit ();
}
});
return faces.isEmpty () == false;
}
bool intersects (const PrimPlane& plane, DynamicFaces& faces) const
{
return this->intersectsT<PrimPlane> (plane, faces);
}
bool intersects (const PrimSphere& sphere, DynamicFaces& faces) const
{
return this->containsOrIntersectsT<PrimSphere> (sphere, faces);
}
bool intersects (const PrimAABox& box, DynamicFaces& faces) const
{
return this->containsOrIntersectsT<PrimAABox> (box, faces);
}
float unsignedDistance (const glm::vec3& pos) const
{
return this->octree.distance (
pos, [this, &pos](unsigned int i) { return Distance::distance (this->face (i), pos); });
}
void normalize ()
{
this->mesh.normalize ();
this->octree.reset ();
this->forEachFace ([this](unsigned int i) { this->addFaceToOctree (i); });
}
void printStatistics () const { this->octree.printStatistics (); }
void runFromConfig (const Config& config)
{
this->mesh.color (config.get<Color> ("editor/mesh/color/normal"));
this->mesh.wireframeColor (config.get<Color> ("editor/mesh/color/wireframe"));
}
};
DELEGATE_BIG4_COPY_SELF (DynamicMesh)
DELEGATE1_CONSTRUCTOR_SELF (DynamicMesh, const Mesh&)
DELEGATE_CONST (unsigned int, DynamicMesh, numVertices)
DELEGATE_CONST (unsigned int, DynamicMesh, numFaces)
DELEGATE_CONST (bool, DynamicMesh, isEmpty)
DELEGATE1_CONST (bool, DynamicMesh, isFreeVertex, unsigned int)
DELEGATE1_CONST (bool, DynamicMesh, isFreeFace, unsigned int)
DELEGATE1_MEMBER_CONST (const glm::vec3&, DynamicMesh, vertex, mesh, unsigned int)
DELEGATE1_CONST (unsigned int, DynamicMesh, valence, unsigned int)
DELEGATE4_CONST (void, DynamicMesh, vertexIndices, unsigned int, unsigned int&, unsigned int&,
unsigned int&)
DELEGATE1_CONST (PrimTriangle, DynamicMesh, face, unsigned int)
DELEGATE1_CONST (const glm::vec3&, DynamicMesh, vertexNormal, unsigned int)
DELEGATE1_CONST (glm::vec3, DynamicMesh, faceNormal, unsigned int)
DELEGATE1_CONST (const std::vector<unsigned int>&, DynamicMesh, adjacentFaces, unsigned int)
GETTER_CONST (const Mesh&, DynamicMesh, mesh)
DELEGATE1_CONST (void, DynamicMesh, forEachVertex, const std::function<void(unsigned int)>&)
DELEGATE2 (void, DynamicMesh, forEachVertex, const DynamicFaces&,
const std::function<void(unsigned int)>&)
DELEGATE2 (void, DynamicMesh, forEachVertexExt, const DynamicFaces&,
const std::function<void(unsigned int)>&)
DELEGATE2_CONST (void, DynamicMesh, forEachVertexAdjacentToVertex, unsigned int,
const std::function<void(unsigned int)>&)
DELEGATE2_CONST (void, DynamicMesh, forEachVertexAdjacentToFace, unsigned int,
const std::function<void(unsigned int)>&)
DELEGATE1_CONST (void, DynamicMesh, forEachFace, const std::function<void(unsigned int)>&)
DELEGATE2 (void, DynamicMesh, forEachFaceExt, const DynamicFaces&,
const std::function<void(unsigned int)>&)
DELEGATE3_CONST (void, DynamicMesh, average, const DynamicFaces&, glm::vec3&, glm::vec3&)
DELEGATE1_CONST (glm::vec3, DynamicMesh, averagePosition, const DynamicFaces&)
DELEGATE1_CONST (glm::vec3, DynamicMesh, averagePosition, unsigned int)
DELEGATE1_CONST (glm::vec3, DynamicMesh, averageNormal, const DynamicFaces&)
DELEGATE1_CONST (glm::vec3, DynamicMesh, averageNormal, unsigned int)
DELEGATE1_CONST (float, DynamicMesh, averageEdgeLengthSqr, const DynamicFaces&)
DELEGATE1_CONST (float, DynamicMesh, averageEdgeLengthSqr, unsigned int)
DELEGATE2 (unsigned int, DynamicMesh, addVertex, const glm::vec3&, const glm::vec3&)
DELEGATE3 (unsigned int, DynamicMesh, addFace, unsigned int, unsigned int, unsigned int)
DELEGATE1 (void, DynamicMesh, deleteVertex, unsigned int)
DELEGATE1 (void, DynamicMesh, deleteFace, unsigned int)
DELEGATE2_MEMBER (void, DynamicMesh, vertex, mesh, unsigned int, const glm::vec3&)
DELEGATE2 (void, DynamicMesh, vertexNormal, unsigned int, const glm::vec3&)
DELEGATE1 (void, DynamicMesh, setVertexNormal, unsigned int)
DELEGATE (void, DynamicMesh, setAllNormals)
DELEGATE (void, DynamicMesh, reset)
DELEGATE1 (void, DynamicMesh, fromMesh, const Mesh&)
DELEGATE1 (void, DynamicMesh, realignFace, unsigned int)
DELEGATE1 (void, DynamicMesh, realignFaces, const DynamicFaces&)
DELEGATE (void, DynamicMesh, realignAllFaces)
DELEGATE (void, DynamicMesh, sanitize)
DELEGATE2 (void, DynamicMesh, prune, std::vector<unsigned int>*, std::vector<unsigned int>*)
DELEGATE2 (bool, DynamicMesh, pruneAndCheckConsistency, std::vector<unsigned int>*,
std::vector<unsigned int>*)
DELEGATE1 (bool, DynamicMesh, mirrorPositive, const PrimPlane&)
DELEGATE1 (void, DynamicMesh, mirror, const PrimPlane&)
DELEGATE (void, DynamicMesh, moveToCenter)
DELEGATE (void, DynamicMesh, normalizeScaling)
DELEGATE (void, DynamicMesh, bufferData)
DELEGATE1_CONST (void, DynamicMesh, render, Camera&)
DELEGATE_MEMBER_CONST (const RenderMode&, DynamicMesh, renderMode, mesh)
DELEGATE_MEMBER (RenderMode&, DynamicMesh, renderMode, mesh)
DELEGATE3_CONST (bool, DynamicMesh, intersects, const PrimRay&, Intersection&, bool)
DELEGATE2 (bool, DynamicMesh, intersects, const PrimRay&, DynamicMeshIntersection&)
DELEGATE2_CONST (bool, DynamicMesh, intersects, const PrimPlane&, DynamicFaces&)
DELEGATE2_CONST (bool, DynamicMesh, intersects, const PrimSphere&, DynamicFaces&)
DELEGATE2_CONST (bool, DynamicMesh, intersects, const PrimAABox&, DynamicFaces&)
DELEGATE1_CONST (float, DynamicMesh, unsignedDistance, const glm::vec3&)
DELEGATE (void, DynamicMesh, normalize)
DELEGATE1_MEMBER (void, DynamicMesh, scale, mesh, const glm::vec3&)
DELEGATE1_MEMBER (void, DynamicMesh, scaling, mesh, const glm::vec3&)
DELEGATE_MEMBER_CONST (glm::vec3, DynamicMesh, scaling, mesh)
DELEGATE1_MEMBER (void, DynamicMesh, translate, mesh, const glm::vec3&)
DELEGATE1_MEMBER (void, DynamicMesh, position, mesh, const glm::vec3&)
DELEGATE_MEMBER_CONST (glm::vec3, DynamicMesh, position, mesh)
DELEGATE1_MEMBER (void, DynamicMesh, rotationMatrix, mesh, const glm::mat4x4&)
DELEGATE_MEMBER_CONST (const glm::mat4x4&, DynamicMesh, rotationMatrix, mesh)
DELEGATE2_MEMBER (void, DynamicMesh, rotation, mesh, const glm::vec3&, float)
DELEGATE1_MEMBER (void, DynamicMesh, rotationX, mesh, float)
DELEGATE1_MEMBER (void, DynamicMesh, rotationY, mesh, float)
DELEGATE1_MEMBER (void, DynamicMesh, rotationZ, mesh, float)
DELEGATE1_MEMBER (void, DynamicMesh, rotate, mesh, const glm::mat4x4&)
DELEGATE2_MEMBER (void, DynamicMesh, rotate, mesh, const glm::vec3&, float)
DELEGATE1_MEMBER (void, DynamicMesh, rotateX, mesh, float)
DELEGATE1_MEMBER (void, DynamicMesh, rotateY, mesh, float)
DELEGATE1_MEMBER (void, DynamicMesh, rotateZ, mesh, float)
DELEGATE_MEMBER_CONST (const Color&, DynamicMesh, color, mesh)
DELEGATE1_MEMBER (void, DynamicMesh, color, mesh, const Color&)
DELEGATE_MEMBER_CONST (const Color&, DynamicMesh, wireframeColor, mesh)
DELEGATE1_MEMBER (void, DynamicMesh, wireframeColor, mesh, const Color&)
DELEGATE_CONST (void, DynamicMesh, printStatistics)
DELEGATE1 (void, DynamicMesh, runFromConfig, const Config&)
void DynamicMesh::findAdjacent (unsigned int e1, unsigned int e2, unsigned int& leftFace,
unsigned int& leftVertex, unsigned int& rightFace,
unsigned int& rightVertex) const
{
return this->impl->findAdjacent (e1, e2, leftFace, leftVertex, rightFace, rightVertex);
}
================================================
FILE: lib/src/dynamic/mesh.hpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#ifndef DILAY_DYNAMIC_MESH
#define DILAY_DYNAMIC_MESH
#include <functional>
#include <glm/fwd.hpp>
#include <vector>
#include "configurable.hpp"
#include "macro.hpp"
class Camera;
class Color;
class DynamicFaces;
class DynamicMeshIntersection;
class Intersection;
class Mesh;
class PrimAABox;
class PrimPlane;
class PrimRay;
class PrimSphere;
class PrimTriangle;
class RenderMode;
class DynamicMesh : public Configurable
{
public:
DECLARE_BIG4_EXPLICIT_COPY (DynamicMesh);
DynamicMesh (const Mesh&);
unsigned int numVertices () const;
unsigned int numFaces () const;
bool isEmpty () const;
bool isFreeVertex (unsigned int) const;
bool isFreeFace (unsigned int) const;
const glm::vec3& vertex (unsigned int) const;
unsigned int valence (unsigned int) const;
void vertexIndices (unsigned int, unsigned int&, unsigned int&, unsigned int&) const;
PrimTriangle face (unsigned int) const;
const glm::vec3& vertexNormal (unsigned int) const;
glm::vec3 faceNormal (unsigned int) const;
void findAdjacent (unsigned int, unsigned int, unsigned int&, unsigned int&, unsigned int&,
unsigned int&) const;
const std::vector<unsigned int>& adjacentFaces (unsigned int) const;
void forEachVertex (const std::function<void(unsigned int)>&) const;
void forEachVertex (const DynamicFaces&, const std::function<void(unsigned int)>&);
void forEachVertexExt (const DynamicFaces&, const std::function<void(unsigned int)>&);
void forEachVertexAdjacentToVertex (unsigned int, const std::function<void(unsigned int)>&) const;
void forEachVertexAdjacentToFace (unsigned int, const std::function<void(unsigned int)>&) const;
void forEachFace (const std::function<void(unsigned int)>&) const;
void forEachFaceExt (const DynamicFaces&, const std::function<void(unsigned int)>&);
void average (const DynamicFaces&, glm::vec3&, glm::vec3&) const;
glm::vec3 averagePosition (const DynamicFaces&) const;
glm::vec3 averagePosition (unsigned int) const;
glm::vec3 averageNormal (const DynamicFaces&) const;
glm::vec3 averageNormal (unsigned int) const;
float averageEdgeLengthSqr (const DynamicFaces&) const;
float averageEdgeLengthSqr (unsigned int) const;
const Mesh& mesh () const;
unsigned int addVertex (const glm::vec3&, const glm::vec3&);
unsigned int addFace (unsigned int, unsigned int, unsigned int);
void deleteVertex (unsigned int);
void deleteFace (unsigned int);
void vertex (unsigned int, const glm::vec3&);
void vertexNormal (unsigned int, const glm::vec3&);
void setVertexNormal (unsigned int);
void setAllNormals ();
void reset ();
void fromMesh (const Mesh&);
void realignFace (unsigned int);
void realignFaces (const DynamicFaces&);
void realignAllFaces ();
void sanitize ();
void prune (std::vector<unsigned int>* = nullptr, std::vector<unsigned int>* = nullptr);
bool pruneAndCheckConsistency (std::vector<unsigned int>* = nullptr,
std::vector<unsigned int>* = nullptr);
bool mirrorPositive (const PrimPlane&);
void mirror (const PrimPlane&);
void moveToCenter ();
void normalizeScaling ();
void bufferData ();
void render (Camera&) const;
const RenderMode& renderMode () const;
RenderMode& renderMode ();
bool intersects (const PrimRay&, Intersection&, bool = false) const;
bool intersects (const PrimRay&, DynamicMeshIntersection&);
bool intersects (const PrimPlane&, DynamicFaces&) const;
bool intersects (const PrimSphere&, DynamicFaces&) const;
bool intersects (const PrimAABox&, DynamicFaces&) const;
float unsignedDistance (const glm::vec3&) const;
void normalize ();
void scale (const glm::vec3&);
void scaling (const glm::vec3&);
glm::vec3 scaling () const;
void translate (const glm::vec3&);
void position (const glm::vec3&);
glm::vec3 position () const;
void rotationMatrix (const glm::mat4x4&);
const glm::mat4x4& rotationMatrix () const;
void rotation (const glm::vec3&, float);
void rotationX (float);
void rotationY (float);
void rotationZ (float);
void rotate (const glm::mat4x4&);
void rotate (const glm::vec3&, float);
void rotateX (float);
void rotateY (float);
void rotateZ (float);
const Color& color () const;
void color (const Color&);
const Color& wireframeColor () const;
void wireframeColor (const Color&);
void printStatistics () const;
private:
IMPLEMENTATION
void runFromConfig (const Config&);
};
#endif
================================================
FILE: lib/src/dynamic/octree.cpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#include <array>
#include <functional>
#include <glm/glm.hpp>
#include <iostream>
#include <unordered_map>
#include <unordered_set>
#include "dynamic/octree.hpp"
#include "intersection.hpp"
#include "maybe.hpp"
#include "primitive/aabox.hpp"
#include "primitive/plane.hpp"
#include "primitive/sphere.hpp"
#include "util.hpp"
#ifdef DILAY_RENDER_OCTREE
#include "../mesh.hpp"
#include "color.hpp"
#include "render-mode.hpp"
#endif
namespace
{
struct IndexOctreeNode;
typedef Maybe<IndexOctreeNode> Child;
struct IndexOctreeStatistics
{
typedef std::unordered_map<int, unsigned int> DepthMap;
unsigned int numNodes;
unsigned int numElements;
int minDepth;
int maxDepth;
unsigned int maxElementsPerNode;
DepthMap numElementsPerDepth;
DepthMap numNodesPerDepth;
};
struct IndexOctreeNode
{
const glm::vec3 center;
const float width;
const int depth;
const PrimAABox looseAABox;
std::array<Child, 8> children;
std::unordered_set<unsigned int> indices;
static constexpr float relativeMinElementExtent = 0.25f;
IndexOctreeNode (const glm::vec3& c, float w, int d)
: center (c)
, width (w)
, depth (d)
, looseAABox (c, 2.0f * w, 2.0f * w, 2.0f * w)
{
static_assert (IndexOctreeNode::relativeMinElementExtent < 0.5f,
"relativeMinElementExtent must be smaller than 0.5f");
assert (w > 0.0f);
}
bool approxContains (const glm::vec3& position, float maxDimExtent) const
{
const glm::vec3 min = this->center - glm::vec3 (Util::epsilon () + (this->width * 0.5f));
const glm::vec3 max = this->center + glm::vec3 (Util::epsilon () + (this->width * 0.5f));
return glm::all (glm::lessThanEqual (min, position)) &&
glm::all (glm::lessThanEqual (position, max)) && maxDimExtent <= this->width;
}
/* node indices:
* (-,-,-) -> 0
* (-,-,+) -> 1
* (-,+,-) -> 2
* (-,+,+) -> 3
* (+,-,-) -> 4
* (+,-,+) -> 5
* (+,+,-) -> 6
* (+,+,+) -> 7
*/
unsigned int childIndex (const glm::vec3& position) const
{
unsigned int index = 0;
if (this->center.x < position.x)
{
index += 4;
}
if (this->center.y < position.y)
{
index += 2;
}
if (this->center.z < position.z)
{
index += 1;
}
return index;
}
bool hasChildren () const
{
return bool(this->children[0]) || bool(this->children[1]) || bool(this->children[2]) ||
bool(this->children[3]) || bool(this->children[4]) || bool(this->children[5]) ||
bool(this->children[6]) || bool(this->children[7]);
}
bool insertIntoChild (float maxDimExtent) const
{
return maxDimExtent <= this->width * IndexOctreeNode::relativeMinElementExtent;
}
IndexOctreeNode& insertIntoChild (unsigned int index, const glm::vec3& position,
float maxDimExtent)
{
const unsigned int childIndex = this->childIndex (position);
if (this->children[childIndex] == false)
{
const float q = this->width * 0.25f;
const float width = this->width * 0.5f;
const int depth = this->depth + 1;
switch (childIndex)
{
case 0:
this->children[0] = Child::make (this->center + glm::vec3 (-q, -q, -q), width, depth);
break;
case 1:
this->children[1] = Child::make (this->center + glm::vec3 (-q, -q, +q), width, depth);
break;
case 2:
this->children[2] = Child::make (this->center + glm::vec3 (-q, +q, -q), width, depth);
break;
case 3:
this->children[3] = Child::make (this->center + glm::vec3 (-q, +q, +q), width, depth);
break;
case 4:
this->children[4] = Child::make (this->center + glm::vec3 (+q, -q, -q), width, depth);
break;
case 5:
this->children[5] = Child::make (this->center + glm::vec3 (+q, -q, +q), width, depth);
break;
case 6:
this->children[6] = Child::make (this->center + glm::vec3 (+q, +q, -q), width, depth);
break;
case 7:
this->children[7] = Child::make (this->center + glm::vec3 (+q, +q, +q), width, depth);
break;
}
}
return this->children[childIndex]->addElement (index, position, maxDimExtent);
}
IndexOctreeNode& addElement (unsigned int index, const glm::vec3& position, float maxDimExtent)
{
assert (this->approxContains (position, maxDimExtent));
if (this->insertIntoChild (maxDimExtent))
{
return this->insertIntoChild (index, position, maxDimExtent);
}
else
{
this->indices.insert (index);
return *this;
}
}
bool isEmpty () const { return this->indices.empty () && this->hasChildren () == false; }
void deleteElement (unsigned int index)
{
unsigned int n = this->indices.erase (index);
assert (n > 0);
unused (n);
}
bool deleteEmptyChildren ()
{
bool allChildrenEmpty = true;
for (unsigned int i = 0; i < 8; i++)
{
if (this->children[i])
{
if (this->children[i]->deleteEmptyChildren ())
{
this->children[i].reset ();
}
else
{
allChildrenEmpty = false;
}
}
}
if (allChildrenEmpty)
{
assert (this->hasChildren () == false);
return this->indices.empty ();
}
else
{
return false;
}
}
#ifdef DILAY_RENDER_OCTREE
void render (Camera& camera, Mesh& nodeMesh) const
{
nodeMesh.position (this->center);
nodeMesh.scaling (glm::vec3 (this->width * 0.5f));
nodeMesh.renderLines (camera);
for (unsigned int i = 0; i < 8; i++)
{
if (this->children[i])
{
this->children[i]->render (camera, nodeMesh);
}
}
}
#endif
template <typename T>
void containsOrIntersectsT (const T& t,
const DynamicOctree::ContainsIntersectionCallback& f) const
{
const bool contains = t.contains (this->looseAABox);
if (contains || IntersectionUtil::intersects (t, this->looseAABox))
{
for (unsigned int index : this->indices)
{
f (contains, index);
}
for (unsigned int i = 0; i < 8; i++)
{
if (this->children[i])
{
this->children[i]->containsOrIntersectsT<T> (t, f);
}
}
}
}
template <typename T>
void intersectsT (const T& t, const DynamicOctree::IntersectionCallback& f) const
{
if (IntersectionUtil::intersects (t, this->looseAABox))
{
for (unsigned int index : this->indices)
{
f (index);
}
for (unsigned int i = 0; i < 8; i++)
{
if (this->children[i])
{
this->children[i]->intersectsT<T> (t, f);
}
}
}
}
void intersects (const PrimRay& ray, float& distance,
const DynamicOctree::RayIntersectionCallback& f) const
{
float t;
if (IntersectionUtil::intersects (ray, this->looseAABox, &t) && t < distance)
{
for (unsigned int index : this->indices)
{
distance = glm::min (f (index), distance);
}
for (unsigned int i = 0; i < 8; i++)
{
if (this->children[i])
{
this->children[i]->intersects (ray, distance, f);
}
}
}
}
void distance (PrimSphere& sphere, const DynamicOctree::DistanceCallback& getDistance) const
{
for (unsigned int i : this->indices)
{
const float distance = getDistance (i);
if (distance < sphere.radius ())
{
sphere.radius (distance);
}
}
const unsigned int first = this->childIndex (sphere.center ());
const bool hasFirst = bool(this->children[first]);
if (hasFirst && IntersectionUtil::intersects (sphere, this->children[first]->looseAABox))
{
this->children[first]->distance (sphere, getDistance);
}
for (unsigned int i = 0; i < 8; i++)
{
const bool hasChild = i != first && bool(this->children[i]);
if (hasChild && IntersectionUtil::intersects (sphere, this->children[i]->looseAABox))
{
this->children[i]->distance (sphere, getDistance);
}
}
}
unsigned int numElements () const { return this->indices.size (); }
void updateIndices (const std::vector<unsigned int>& indexMap)
{
std::unordered_set<unsigned int> newIndices;
for (unsigned int i : this->indices)
{
assert (indexMap[i] != Util::invalidIndex ());
newIndices.insert (indexMap[i]);
}
this->indices = std::move (newIndices);
for (unsigned int i = 0; i < 8; i++)
{
if (this->children[i])
{
this->children[i]->updateIndices (indexMap);
}
}
}
void updateStatistics (IndexOctreeStatistics& stats) const
{
stats.numNodes += 1;
stats.numElements += this->numElements ();
stats.minDepth = glm::min (stats.minDepth, this->depth);
stats.maxDepth = glm::max (stats.maxDepth, this->depth);
stats.maxElementsPerNode = glm::max (stats.maxElementsPerNode, this->numElements ());
auto e = stats.numElementsPerDepth.find (this->depth);
if (e == stats.numElementsPerDepth.end ())
{
stats.numElementsPerDepth.emplace (this->depth, this->numElements ());
}
else
{
e->second = e->second + this->numElements ();
}
e = stats.numNodesPerDepth.find (this->depth);
if (e == stats.numNodesPerDepth.end ())
{
stats.numNodesPerDepth.emplace (this->depth, 1);
}
else
{
e->second = e->second + 1;
}
for (unsigned int i = 0; i < 8; i++)
{
if (this->children[i])
{
this->children[i]->updateStatistics (stats);
}
}
}
};
}
struct DynamicOctree::Impl
{
Child root;
std::vector<IndexOctreeNode*> elementNodeMap;
Impl () {}
Impl (const Impl& other)
: root (other.root)
{
this->makeElementNodeMap ();
}
bool hasRoot () const { return bool(this->root); }
void setupRoot (const glm::vec3& position, float width)
{
assert (this->hasRoot () == false);
this->root = IndexOctreeNode (position, width, 0);
}
void makeElementNodeMap ()
{
std::function<void(IndexOctreeNode&)> traverse = [this, &traverse](IndexOctreeNode& node) {
for (unsigned i : node.indices)
{
this->addToElementNodeMap (i, node);
}
for (unsigned int i = 0; i < 8; i++)
{
if (node.children[i])
{
traverse (*node.children[i]);
}
}
};
if (this->root)
{
traverse (*this->root);
}
}
void addToElementNodeMap (unsigned int index, IndexOctreeNode& node)
{
if (index >= this->elementNodeMap.size ())
{
this->elementNodeMap.resize (index + 1, nullptr);
}
assert (this->elementNodeMap[index] == nullptr);
this->elementNodeMap[index] = &node;
}
void makeParent (const glm::vec3& position)
{
assert (this->hasRoot ());
const glm::vec3 rootCenter = this->root->center;
const float rootWidth = this->root->width;
const float halfRootWidth = this->root->width * 0.5f;
glm::vec3 parentCenter;
int index = 0;
if (rootCenter.x < position.x)
parentCenter.x = rootCenter.x + halfRootWidth;
else
{
parentCenter.x = rootCenter.x - halfRootWidth;
index += 4;
}
if (rootCenter.y < position.y)
parentCenter.y = rootCenter.y + halfRootWidth;
else
{
parentCenter.y = rootCenter.y - halfRootWidth;
index += 2;
}
if (rootCenter.z < position.z)
parentCenter.z = rootCenter.z + halfRootWidth;
else
{
parentCenter.z = rootCenter.z - halfRootWidth;
index += 1;
}
IndexOctreeNode* newRoot =
new IndexOctreeNode (parentCenter, rootWidth * 2.0f, this->root->depth - 1);
newRoot->children[index] = std::move (this->root);
this->root.reset (newRoot);
}
void addElement (unsigned int index, const glm::vec3& position, float maxDimExtent)
{
assert (this->hasRoot ());
if (this->root->approxContains (position, maxDimExtent))
{
IndexOctreeNode& node = this->root->addElement (index, position, maxDimExtent);
this->addToElementNodeMap (index, node);
}
else
{
this->makeParent (position);
this->addElement (index, position, maxDimExtent);
}
}
void realignElement (unsigned int index, const glm::vec3& position, float maxDimExtent)
{
assert (this->hasRoot ());
assert (index < this->elementNodeMap.size ());
assert (this->elementNodeMap[index]);
IndexOctreeNode* node = this->elementNodeMap[index];
if (node->approxContains (position, maxDimExtent) == false ||
node->insertIntoChild (maxDimExtent))
{
this->deleteElement (index);
this->addElement (index, position, maxDimExtent);
}
}
void deleteElement (unsigned int index)
{
assert (index < this->elementNodeMap.size ());
assert (this->elementNodeMap[index]);
this->elementNodeMap[index]->deleteElement (index);
this->elementNodeMap[index] = nullptr;
if (this->hasRoot ())
{
if (this->root->isEmpty ())
{
this->root.reset ();
}
else
{
this->shrinkRoot ();
}
}
}
void deleteEmptyChildren ()
{
if (this->hasRoot ())
{
if (this->root->deleteEmptyChildren ())
{
this->root.reset ();
}
}
}
void updateIndices (const std::vector<unsigned int>& newIndices)
{
for (unsigned int i = 0; i < newIndices.size (); i++)
{
const unsigned int newI = newIndices[i];
if (newI != Util::invalidIndex () && newI != i)
{
assert (i < this->elementNodeMap.size ());
assert (newI < this->elementNodeMap.size ());
assert (this->elementNodeMap[i]);
assert (this->elementNodeMap[newI] == nullptr);
this->elementNodeMap[newI] = this->elementNodeMap[i];
this->elementNodeMap[i] = nullptr;
}
}
this->elementNodeMap.resize (newIndices.size ());
if (this->hasRoot ())
{
this->root->updateIndices (newIndices);
}
}
void shrinkRoot ()
{
if (this->hasRoot () && this->root->indices.empty () && this->root->hasChildren ())
{
int singleNonEmptyChildIndex = -1;
for (int i = 0; i < 8; i++)
{
if (this->root->children[i] && this->root->children[i]->isEmpty () == false)
{
if (singleNonEmptyChildIndex == -1)
{
singleNonEmptyChildIndex = i;
}
else
{
return;
}
}
}
if (singleNonEmptyChildIndex != -1)
{
this->root = std::move (this->root->children[singleNonEmptyChildIndex]);
this->shrinkRoot ();
}
}
}
void reset ()
{
this->root.reset ();
this->elementNodeMap.clear ();
}
#ifdef DILAY_RENDER_OCTREE
void render (Camera& camera) const
{
Mesh nodeMesh;
nodeMesh.addVertex (glm::vec3 (-1.0f, -1.0f, -1.0f));
nodeMesh.addVertex (glm::vec3 (-1.0f, -1.0f, 1.0f));
nodeMesh.addVertex (glm::vec3 (-1.0f, 1.0f, -1.0f));
nodeMesh.addVertex (glm::vec3 (-1.0f, 1.0f, 1.0f));
nodeMesh.addVertex (glm::vec3 (1.0f, -1.0f, -1.0f));
nodeMesh.addVertex (glm::vec3 (1.0f, -1.0f, 1.0f));
nodeMesh.addVertex (glm::vec3 (1.0f, 1.0f, -1.0f));
nodeMesh.addVertex (glm::vec3 (1.0f, 1.0f, 1.0f));
nodeMesh.addIndex (0);
nodeMesh.addIndex (1);
nodeMesh.addIndex (1);
nodeMesh.addIndex (3);
nodeMesh.addIndex (3);
nodeMesh.addIndex (2);
nodeMesh.addIndex (2);
nodeMesh.addIndex (0);
nodeMesh.addIndex (4);
nodeMesh.addIndex (5);
nodeMesh.addIndex (5);
nodeMesh.addIndex (7);
nodeMesh.addIndex (7);
nodeMesh.addIndex (6);
nodeMesh.addIndex (6);
nodeMesh.addIndex (4);
nodeMesh.addIndex (1);
nodeMesh.addIndex (5);
nodeMesh.addIndex (5);
nodeMesh.addIndex (7);
nodeMesh.addIndex (7);
nodeMesh.addIndex (3);
nodeMesh.addIndex (3);
nodeMesh.addIndex (1);
nodeMesh.addIndex (4);
nodeMesh.addIndex (6);
nodeMesh.addIndex (6);
nodeMesh.addIndex (2);
nodeMesh.addIndex (2);
nodeMesh.addIndex (0);
nodeMesh.addIndex (0);
nodeMesh.addIndex (4);
nodeMesh.renderMode ().constantShading (true);
nodeMesh.renderMode ().noDepthTest (true);
nodeMesh.color (Color (1.0f, 1.0f, 0.0f));
nodeMesh.bufferData ();
if (this->hasRoot ())
{
this->root->render (camera, nodeMesh);
}
}
#else
void render (Camera&) const { DILAY_IMPOSSIBLE }
#endif
void intersects (const PrimRay& ray, const DynamicOctree::RayIntersectionCallback& f) const
{
if (this->hasRoot ())
{
float distance = Util::maxFloat ();
return this->root->intersects (ray, distance, f);
}
}
void intersects (const PrimPlane& plane, const DynamicOctree::IntersectionCallback& f) const
{
if (this->hasRoot ())
{
return this->root->intersectsT<PrimPlane> (plane, f);
}
}
void intersects (const PrimSphere& sphere,
const DynamicOctree::ContainsIntersectionCallback& f) const
{
if (this->hasRoot ())
{
return this->root->containsOrIntersectsT<PrimSphere> (sphere, f);
}
}
void intersects (const PrimAABox& box, const DynamicOctree::ContainsIntersectionCallback& f) const
{
if (this->hasRoot ())
{
return this->root->containsOrIntersectsT<PrimAABox> (box, f);
}
}
float distance (const glm::vec3& p, const DistanceCallback& getDistance) const
{
assert (this->hasRoot ());
PrimSphere sphere (p, Util::maxFloat ());
this->root->distance (sphere, getDistance);
return sphere.radius ();
}
void printStatistics () const
{
IndexOctreeStatistics stats{0,
0,
Util::maxInt (),
Util::minInt (),
0,
IndexOctreeStatistics::DepthMap (),
IndexOctreeStatistics::DepthMap ()};
if (this->hasRoot ())
{
this->root->updateStatistics (stats);
}
std::cout << "octree:"
<< "\n\tnum nodes:\t\t\t" << stats.numNodes << "\n\tnum elements:\t\t\t"
<< stats.numElements << "\n\tmax elements per node:\t\t" << stats.maxElementsPerNode
<< "\n\tmin depth:\t\t\t" << stats.minDepth << "\n\tmax depth:\t\t\t"
<< stats.maxDepth << "\n\telements per node:\t\t"
<< float(stats.numElements) / float(stats.numNodes) << std::endl;
}
};
DELEGATE_BIG4_COPY (DynamicOctree)
DELEGATE_CONST (bool, DynamicOctree, hasRoot)
DELEGATE2 (void, DynamicOctree, setupRoot, const glm::vec3&, float)
DELEGATE3 (void, DynamicOctree, addElement, unsigned int, const glm::vec3&, float)
DELEGATE3 (void, DynamicOctree, realignElement, unsigned int, const glm::vec3&, float)
DELEGATE1 (void, DynamicOctree, deleteElement, unsigned int)
DELEGATE (void, DynamicOctree, deleteEmptyChildren)
DELEGATE1 (void, DynamicOctree, updateIndices, const std::vector<unsigned int>&)
DELEGATE (void, DynamicOctree, shrinkRoot)
DELEGATE (void, DynamicOctree, reset)
DELEGATE1_CONST (void, DynamicOctree, render, Camera&)
DELEGATE2_CONST (void, DynamicOctree, intersects, const PrimRay&,
const DynamicOctree::RayIntersectionCallback&)
DELEGATE2_CONST (void, DynamicOctree, intersects, const PrimPlane&,
const DynamicOctree::IntersectionCallback&)
DELEGATE2_CONST (void, DynamicOctree, intersects, const PrimSphere&,
const DynamicOctree::ContainsIntersectionCallback&)
DELEGATE2_CONST (void, DynamicOctree, intersects, const PrimAABox&,
const DynamicOctree::ContainsIntersectionCallback&)
DELEGATE2_CONST (float, DynamicOctree, distance, const glm::vec3&,
const DynamicOctree::DistanceCallback&)
DELEGATE_CONST (void, DynamicOctree, printStatistics)
================================================
FILE: lib/src/dynamic/octree.hpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#ifndef DILAY_DYNAMIC_OCTREE
#define DILAY_DYNAMIC_OCTREE
#include <functional>
#include <glm/fwd.hpp>
#include <vector>
#include "macro.hpp"
class Camera;
class PrimAABox;
class PrimPlane;
class PrimRay;
class PrimSphere;
class DynamicOctree
{
public:
DECLARE_BIG4_EXPLICIT_COPY (DynamicOctree)
typedef std::function<void(unsigned int)> IntersectionCallback;
typedef std::function<float(unsigned int)> RayIntersectionCallback;
typedef std::function<void(bool, unsigned int)> ContainsIntersectionCallback;
typedef std::function<float(unsigned int)> DistanceCallback;
bool hasRoot () const;
void setupRoot (const glm::vec3&, float);
void addElement (unsigned int, const glm::vec3&, float);
void realignElement (unsigned int, const glm::vec3&, float);
void deleteElement (unsigned int);
void deleteEmptyChildren ();
void updateIndices (const std::vector<unsigned int>&);
void shrinkRoot ();
void reset ();
void render (Camera&) const;
void intersects (const PrimRay&, const RayIntersectionCallback&) const;
void intersects (const PrimPlane&, const IntersectionCallback&) const;
void intersects (const PrimSphere&, const ContainsIntersectionCallback&) const;
void intersects (const PrimAABox&, const ContainsIntersectionCallback&) const;
float distance (const glm::vec3&, const DistanceCallback&) const;
void printStatistics () const;
private:
IMPLEMENTATION
};
#endif
================================================
FILE: lib/src/hash.hpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#ifndef DILAY_HASH
#define DILAY_HASH
#include <functional>
#include <utility>
namespace Hash
{
// cf. `http://www.boost.org/doc/libs/1_55_0/boost/functional/hash/hash.hpp`
template <typename T> void combine (std::size_t& seed, const T& value)
{
seed ^= std::hash<T> () (value) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
}
namespace std
{
template <typename T1, typename T2> struct hash<std::pair<T1, T2>>
{
size_t operator() (const std::pair<T1, T2>& pair) const
{
size_t seed = 0;
Hash::combine (seed, pair.first);
Hash::combine (seed, pair.second);
return seed;
}
};
}
#endif
================================================
FILE: lib/src/history.cpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#include <list>
#include <vector>
#include "config.hpp"
#include "dynamic/mesh.hpp"
#include "history.hpp"
#include "maybe.hpp"
#include "mesh.hpp"
#include "scene.hpp"
#include "sketch/mesh.hpp"
#include "sketch/path.hpp"
#include "state.hpp"
namespace
{
struct SnapshotConfig
{
bool snapshotDynamicMeshes;
bool snapshotSketchMeshes;
SnapshotConfig (bool d, bool s)
: snapshotDynamicMeshes (d)
, snapshotSketchMeshes (s)
{
assert (this->snapshotDynamicMeshes || this->snapshotSketchMeshes);
}
};
struct SceneSnapshot
{
const SnapshotConfig config;
std::list<DynamicMesh> dynamicMeshes;
std::list<SketchMesh> sketchMeshes;
SceneSnapshot (const SnapshotConfig& c)
: config (c)
{
}
};
typedef std::list<SceneSnapshot> Timeline;
SceneSnapshot sceneSnapshot (const Scene& scene, const SnapshotConfig& config)
{
SceneSnapshot snapshot (config);
if (config.snapshotDynamicMeshes)
{
scene.forEachConstMesh (
[&snapshot](const DynamicMesh& mesh) { snapshot.dynamicMeshes.emplace_back (mesh); });
}
if (config.snapshotSketchMeshes)
{
scene.forEachConstMesh (
[&snapshot](const SketchMesh& mesh) { snapshot.sketchMeshes.emplace_back (mesh); });
}
return snapshot;
}
void resetToSnapshot (const SceneSnapshot& snapshot, State& state)
{
Scene& scene = state.scene ();
if (snapshot.config.snapshotDynamicMeshes)
{
scene.deleteDynamicMeshes ();
for (const DynamicMesh& mesh : snapshot.dynamicMeshes)
{
scene.newDynamicMesh (state.config (), mesh);
}
}
if (snapshot.config.snapshotSketchMeshes)
{
scene.deleteSketchMeshes ();
for (const SketchMesh& mesh : snapshot.sketchMeshes)
{
scene.newSketchMesh (state.config (), mesh);
}
}
}
}
struct History::Impl
{
unsigned int undoDepth;
Timeline past;
Timeline future;
Impl (const Config& config) { this->runFromConfig (config); }
void snapshotAll (const Scene& scene) { this->snapshot (scene, SnapshotConfig (true, true)); }
void snapshotDynamicMeshes (const Scene& scene)
{
this->snapshot (scene, SnapshotConfig (true, false));
}
void snapshotSketchMeshes (const Scene& scene)
{
this->snapshot (scene, SnapshotConfig (false, true));
}
void snapshot (const Scene& scene, const SnapshotConfig& config)
{
assert (undoDepth > 0);
this->future.clear ();
while (this->past.size () >= this->undoDepth)
{
this->past.pop_back ();
}
this->past.push_front (sceneSnapshot (scene, config));
}
void dropPastSnapshot ()
{
if (this->past.empty () == false)
{
this->past.pop_front ();
}
}
void dropFutureSnapshot ()
{
if (this->future.empty () == false)
{
this->future.pop_front ();
}
}
void undo (State& state)
{
if (this->past.empty () == false)
{
const SnapshotConfig& config = this->past.front ().config;
this->future.push_front (sceneSnapshot (state.scene (), config));
resetToSnapshot (this->past.front (), state);
this->past.pop_front ();
}
}
void redo (State& state)
{
if (this->future.empty () == false)
{
const SnapshotConfig& config = this->future.front ().config;
this->past.push_front (sceneSnapshot (state.scene (), config));
resetToSnapshot (this->future.front (), state);
this->future.pop_front ();
}
}
bool hasRecentDynamicMesh () const
{
return this->past.empty () == false && this->past.front ().config.snapshotDynamicMeshes;
}
void forEachRecentDynamicMesh (const std::function<void(const DynamicMesh&)>& f) const
{
assert (this->hasRecentDynamicMesh ());
for (const DynamicMesh& m : this->past.front ().dynamicMeshes)
{
f (m);
}
}
void reset ()
{
this->past.clear ();
this->future.clear ();
}
void runFromConfig (const Config& config)
{
this->undoDepth = config.get<int> ("editor/undo-depth");
}
};
DELEGATE1_BIG3 (History, const Config&)
DELEGATE1 (void, History, snapshotAll, const Scene&)
DELEGATE1 (void, History, snapshotDynamicMeshes, const Scene&)
DELEGATE1 (void, History, snapshotSketchMeshes, const Scene&)
DELEGATE (void, History, dropPastSnapshot)
DELEGATE (void, History, dropFutureSnapshot)
DELEGATE1 (void, History, undo, State&)
DELEGATE1 (void, History, redo, State&)
DELEGATE_CONST (bool, History, hasRecentDynamicMesh)
DELEGATE1_CONST (void, History, forEachRecentDynamicMesh,
const std::function<void(const DynamicMesh&)>&)
DELEGATE (void, History, reset)
DELEGATE1 (void, History, runFromConfig, const Config&)
================================================
FILE: lib/src/history.hpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#ifndef DILAY_HISTORY
#define DILAY_HISTORY
#include <functional>
#include "configurable.hpp"
#include "macro.hpp"
class DynamicMesh;
class Scene;
class State;
class History : public Configurable
{
public:
DECLARE_BIG3 (History, const Config&)
void snapshotAll (const Scene&);
void snapshotDynamicMeshes (const Scene&);
void snapshotSketchMeshes (const Scene&);
void dropPastSnapshot ();
void dropFutureSnapshot ();
void undo (State&);
void redo (State&);
bool hasRecentDynamicMesh () const;
void forEachRecentDynamicMesh (const std::function<void(const DynamicMesh&)>&) const;
void reset ();
private:
IMPLEMENTATION
void runFromConfig (const Config&);
};
#endif
================================================
FILE: lib/src/import-export.cpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#include <algorithm>
#include <fstream>
#include <sstream>
#include "dynamic/mesh.hpp"
#include "import-export.hpp"
#include "mesh-util.hpp"
#include "mesh.hpp"
#include "scene.hpp"
#include "sketch/fwd.hpp"
#include "sketch/mesh.hpp"
#include "sketch/path.hpp"
#include "util.hpp"
namespace
{
std::ostream& operator<< (std::ostream& os, const glm::vec3& v)
{
os << v.x << " " << v.y << " " << v.z;
return os;
}
std::istream& operator>> (std::istream& is, glm::vec3& v)
{
is >> v.x >> v.y >> v.z;
return is;
}
void toDlyFile (std::ostream& stream, const Mesh& mesh)
{
stream << "o\n";
for (unsigned int i = 0; i < mesh.numVertices (); i++)
{
stream << "v " << mesh.vertex (i) << std::endl;
}
for (unsigned int i = 0; i < mesh.numIndices (); i += 3)
{
stream << "f " << mesh.index (i + 0) + 1 << " " << mesh.index (i + 1) + 1 << " "
<< mesh.index (i + 2) + 1 << std::endl;
}
}
unsigned int toDlyFile (std::ostream& stream, const SketchNode& node, unsigned int parentIndex,
unsigned nodeIndex)
{
stream << "dly_sketch_node " << nodeIndex << " " << parentIndex << " " << node.data ().center ()
<< " " << node.data ().radius () << std::endl;
unsigned int childIndex = nodeIndex;
node.forEachConstChild ([&stream, nodeIndex, &childIndex](const SketchNode& child) {
childIndex = toDlyFile (stream, child, nodeIndex, childIndex + 1);
});
return childIndex;
}
void toDlyFile (std::ostream& stream, const SketchPath& path)
{
if (path.isEmpty () == false)
{
stream << "dly_sketch_path"
<< " " << path.intersectionFirst () << " " << path.intersectionLast () << std::endl;
for (const PrimSphere& s : path.spheres ())
{
stream << "dly_sketch_sphere"
<< " " << s.center () << " " << s.radius () << std::endl;
}
}
}
void toDlyFile (std::ostream& stream, const SketchMesh& mesh)
{
if (mesh.isEmpty () == false)
{
stream << "dly_sketch_mesh\n";
if (mesh.tree ().hasRoot ())
{
toDlyFile (stream, mesh.tree ().root (), Util::invalidIndex (), 0);
}
for (const SketchPath& p : mesh.paths ())
{
toDlyFile (stream, p);
}
}
}
};
namespace ImportExport
{
void toDlyFile (std::ostream& stream, Scene& scene, bool isObjFile)
{
scene.forEachMesh ([&stream](DynamicMesh& mesh) {
mesh.prune ();
::toDlyFile (stream, mesh.mesh ());
});
if (isObjFile == false)
{
scene.forEachConstMesh ([&stream](const SketchMesh& mesh) { ::toDlyFile (stream, mesh); });
}
}
bool toDlyFile (const std::string& fileName, Scene& scene, bool isObjFile)
{
std::ofstream file (fileName);
if (file.is_open ())
{
ImportExport::toDlyFile (file, scene, isObjFile);
file.close ();
return true;
}
else
{
return false;
}
}
bool fromDlyFile (std::istream& stream, const Config& config, Scene& scene)
{
unsigned int lineNumber = 0;
std::istringstream lineStream;
std::vector<Mesh> meshes;
std::vector<SketchNode*> nodes;
SketchMesh* sketch = nullptr;
SketchPath* sketchPath = nullptr;
glm::vec3 intersectionFirst, intersectionLast;
auto extractFirst = [](const std::string& string, unsigned int& value) -> bool {
auto slashPos = string.find ('/');
return Util::fromString (string.substr (0, slashPos), value);
};
auto nextLine = [&stream, &lineNumber, &lineStream]() -> bool {
std::string line;
std::getline (stream, line);
if (stream)
{
lineNumber++;
lineStream.clear ();
lineStream.str (line);
return true;
}
else
{
return false;
}
};
while (nextLine ())
{
std::string keyword;
lineStream >> keyword;
if (lineStream.fail () == false)
{
if (keyword == "o")
{
meshes.push_back (Mesh ());
}
else if (keyword == "v")
{
glm::vec3 vertex;
lineStream >> vertex;
if (lineStream.fail ())
{
DILAY_WARN ("could not parse vertex at line %u", lineNumber)
return false;
}
else
{
if (meshes.empty ())
{
meshes.push_back (Mesh ());
}
meshes.back ().addVertex (vertex);
}
}
else if (keyword == "f")
{
std::string v1String, v2String, v3String;
unsigned int v1, v2, v3;
lineStream >> v1String >> v2String >> v3String;
if (lineStream.fail () || extractFirst (v1String, v1) == false ||
extractFirst (v2String, v2) == false || extractFirst (v3String, v3) == false)
{
DILAY_WARN ("could not parse face at line %u", lineNumber)
return false;
}
else
{
std::string v4String;
unsigned int v4;
lineStream >> v4String;
if (lineStream.fail ())
{
lineStream.clear ();
if (meshes.empty ())
{
meshes.push_back (Mesh ());
}
MeshUtil::addFace (meshes.back (), v1 - 1, v2 - 1, v3 - 1);
}
else if (extractFirst (v4String, v4) == false)
{
DILAY_WARN ("could not parse face at line %u", lineNumber)
return false;
}
else
{
if (meshes.empty ())
{
meshes.push_back (Mesh ());
}
MeshUtil::addFace (meshes.back (), v1 - 1, v2 - 1, v3 - 1, v4 - 1);
}
}
}
else if (keyword == "dly_sketch_mesh")
{
nodes.clear ();
sketch = &scene.newSketchMesh (config, SketchTree ());
}
else if (keyword == "dly_sketch_node")
{
if (sketch == nullptr)
{
DILAY_WARN ("could not parse sketch node: no sketch found at line %u", lineNumber)
return false;
}
unsigned int nodeIndex;
unsigned int parentIndex;
glm::vec3 center;
float radius;
lineStream >> nodeIndex >> parentIndex >> center >> radius;
if (lineStream.fail ())
{
DILAY_WARN ("could not parse sketch node at line %u", lineNumber)
return false;
}
if (nodeIndex == nodes.size ())
{
if (nodeIndex == 0)
{
nodes.push_back (&sketch->tree ().emplaceRoot (PrimSphere (center, radius)));
}
else if (parentIndex < nodes.size ())
{
nodes.push_back (&nodes.at (parentIndex)->emplaceChild (PrimSphere (center, radius)));
}
else
{
DILAY_WARN ("invalid parent index at line %u", lineNumber)
return false;
}
}
else
{
DILAY_WARN ("invalid node index at line %u", lineNumber)
return false;
}
}
else if (keyword == "dly_sketch_path")
{
lineStream >> intersectionFirst >> intersectionLast;
if (lineStream.fail ())
{
DILAY_WARN ("could not parse sketch path at line %u", lineNumber)
return false;
}
if (sketch)
{
sketchPath = &sketch->addPath (SketchPath ());
}
else
{
DILAY_WARN ("could not parse sketch path: no sketch found at line %u", lineNumber)
return false;
}
}
else if (keyword == "dly_sketch_sphere")
{
glm::vec3 center;
float radius;
lineStream >> center >> radius;
if (lineStream.fail ())
{
DILAY_WARN ("could not parse sketch sphere at line %u", lineNumber)
return false;
}
if (sketchPath)
{
if (sketchPath->isEmpty ())
{
sketchPath->addSphere (intersectionFirst, center, radius);
}
else
{
sketchPath->addSphere (intersectionLast, center, radius);
}
}
else
{
DILAY_WARN ("could not parse sketch sphere: no sketch path found at line %u",
lineNumber)
return false;
}
}
}
}
meshes.erase (std::remove_if (meshes.begin (), meshes.end (),
[](Mesh& m) { return m.numVertices () == 0; }),
meshes.end ());
if (std::all_of (meshes.begin (), meshes.end (),
[](Mesh& m) { return MeshUtil::checkConsistency (m); }))
{
for (Mesh& m : meshes)
{
scene.newDynamicMesh (config, m);
}
return true;
}
else
{
return false;
}
}
bool fromDlyFile (const std::string& fileName, const Config& config, Scene& scene)
{
std::ifstream file (fileName);
if (file.is_open ())
{
const bool success = ImportExport::fromDlyFile (file, config, scene);
file.close ();
return success;
}
else
{
return false;
}
}
};
================================================
FILE: lib/src/import-export.hpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#ifndef DILAY_IMPORT_EXPORT
#define DILAY_IMPORT_EXPORT
#include <iosfwd>
#include <string>
class Config;
class Scene;
namespace ImportExport
{
void toDlyFile (std::ostream&, Scene&, bool);
bool toDlyFile (const std::string&, Scene&, bool);
bool fromDlyFile (std::istream&, const Config&, Scene&);
bool fromDlyFile (const std::string&, const Config&, Scene&);
};
#endif
================================================
FILE: lib/src/intersection.cpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#include <glm/glm.hpp>
#include <glm/gtx/norm.hpp>
#include "intersection.hpp"
#include "primitive/aabox.hpp"
#include "primitive/cone.hpp"
#include "primitive/cylinder.hpp"
#include "primitive/plane.hpp"
#include "primitive/ray.hpp"
#include "primitive/sphere.hpp"
#include "primitive/triangle.hpp"
#include "util.hpp"
Intersection ::Intersection ()
: _isIntersection (false)
, _distance (Util::maxFloat ())
{
}
bool Intersection::isIntersection () const { return this->_isIntersection; }
const glm::vec3& Intersection::position () const
{
assert (this->_isIntersection);
return this->_position;
}
const glm::vec3& Intersection::normal () const
{
assert (this->_isIntersection);
return this->_normal;
}
float Intersection::distance () const
{
assert (this->_isIntersection);
return this->_distance;
}
void Intersection::reset () { this->_isIntersection = false; }
bool Intersection::update (float d, const glm::vec3& p, const glm::vec3& n)
{
if (this->_isIntersection == false || d < this->_distance)
{
this->_isIntersection = true;
this->_distance = d;
this->_position = p;
this->_normal = n;
return true;
}
return false;
}
Intersection& Intersection::min (Intersection& a, Intersection& b)
{
if (a._isIntersection && (b._isIntersection == false || a._distance < b._distance))
{
return a;
}
else
{
return b;
}
}
void Intersection::sort (Intersection& a, Intersection& b)
{
if (b._isIntersection && (a._isIntersection == false || b._distance < a._distance))
{
std::swap (a, b);
}
}
namespace
{
bool intersectsQuadric (float a, float b, float c, bool alongLine, float* t)
{
float s1, s2;
const unsigned int n = Util::solveQuadraticEq (a, b, c, s1, s2);
switch (n)
{
case 0:
return false;
case 1:
if (s1 >= 0.0f || alongLine)
{
Util::setIfNotNull (t, s1);
return true;
}
else
{
return false;
}
case 2:
{
const float sMin = glm::min (s1, s2);
const float sMax = glm::max (s1, s2);
if (sMin >= 0.0f)
{
Util::setIfNotNull (t, sMin);
return true;
}
else if (sMax >= 0.0f || alongLine)
{
Util::setIfNotNull (t, sMax);
return true;
}
return false;
}
default:
DILAY_IMPOSSIBLE
}
}
}
// see http://realtimecollisiondetection.net/blog/?p=103
bool IntersectionUtil::intersects (const PrimSphere& sphere, const PrimTriangle& tri)
{
const glm::vec3 A = tri.vertex1 () - sphere.center ();
const glm::vec3 B = tri.vertex2 () - sphere.center ();
const glm::vec3 C = tri.vertex3 () - sphere.center ();
const float rr = sphere.radius () * sphere.radius ();
const glm::vec3 V = glm::cross (B - A, C - A);
const float d = glm::dot (A, V);
const float e = glm::dot (V, V);
const bool sep1 = d * d > rr * e;
const float aa = glm::dot (A, A);
const float ab = glm::dot (A, B);
const float ac = glm::dot (A, C);
const float bb = glm::dot (B, B);
const float bc = glm::dot (B, C);
const float cc = glm::dot (C, C);
const bool sep2 = (aa > rr) && (ab > aa) && (ac > aa);
const bool sep3 = (bb > rr) && (ab > bb) && (bc > bb);
const bool sep4 = (cc > rr) && (ac > cc) && (bc > cc);
const glm::vec3 AB = B - A;
const glm::vec3 BC = C - B;
const glm::vec3 CA = A - C;
const float d1 = ab - aa;
const float d2 = bc - bb;
const float d3 = ac - cc;
const float e1 = glm::dot (AB, AB);
const float e2 = glm::dot (BC, BC);
const float e3 = glm::dot (CA, CA);
const glm::vec3 Q1 = (A * e1) - (d1 * AB);
const glm::vec3 Q2 = (B * e2) - (d2 * BC);
const glm::vec3 Q3 = (C * e3) - (d3 * CA);
const glm::vec3 QC = (C * e1) - Q1;
const glm::vec3 QA = (A * e2) - Q2;
const glm::vec3 QB = (B * e3) - Q3;
const bool sep5 = (glm::dot (Q1, Q1) > rr * e1 * e1) && (glm::dot (Q1, QC) > 0.0f);
const bool sep6 = (glm::dot (Q2, Q2) > rr * e2 * e2) && (glm::dot (Q2, QA) > 0.0f);
const bool sep7 = (glm::dot (Q3, Q3) > rr * e3 * e3) && (glm::dot (Q3, QB) > 0.0f);
return (sep1 || sep2 || sep3 || sep4 || sep5 || sep6 || sep7) == false;
}
bool IntersectionUtil::intersects (const PrimSphere& sphere, const PrimAABox& box)
{
const glm::vec3 c = sphere.center ();
const glm::vec3& min = box.minimum ();
const glm::vec3& max = box.maximum ();
float d = 0.0f;
for (unsigned int i = 0; i < 3; i++)
{
if (c[i] < min[i])
{
const float s = c[i] - min[i];
d += s * s;
}
else if (c[i] > max[i])
{
const float s = c[i] - max[i];
d += s * s;
}
}
return d <= sphere.radius () * sphere.radius ();
}
bool IntersectionUtil::intersects (const PrimSphere& sphere1, const PrimSphere& sphere2)
{
return glm::distance2 (sphere1.center (), sphere2.center ()) <
((sphere1.radius () + sphere2.radius ()) * (sphere1.radius () + sphere2.radius ()));
}
bool IntersectionUtil::intersects (const PrimRay& ray, const PrimSphere& sphere, float* t)
{
const glm::vec3& dir = ray.direction ();
const glm::vec3& origin = ray.origin () - sphere.center ();
const float radius2 = sphere.radius () * sphere.radius ();
return intersectsQuadric (glm::dot (dir, dir), 2.0f * glm::dot (dir, origin),
glm::dot (origin, origin) - radius2, ray.isLine (), t);
}
bool IntersectionUtil::intersects (const PrimRay& ray, const PrimPlane& plane, float* t)
{
const float d = glm::dot (ray.direction (), plane.normal ());
if (Util::almostEqual (d, 0.0f))
{
return false;
}
const float s = glm::dot (plane.point () - ray.origin (), plane.normal ()) / d;
if (s >= 0.0f || ray.isLine ())
{
Util::setIfNotNull (t, s);
return true;
}
else
{
return false;
}
}
// see
// http://www.cs.virginia.edu/~gfx/Courses/2003/ImageSynthesis/papers/Acceleration/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf
bool IntersectionUtil::intersects (const PrimRay& ray, const PrimTriangle& tri, bool both, float* t)
{
const float dot = glm::dot (ray.direction (), tri.normal ());
if (both == false && dot > -Util::epsilon ())
{
return false;
}
else if (both && dot < Util::epsilon () && dot > -Util::epsilon ())
{
return false;
}
const glm::vec3 e1 = tri.vertex2 () - tri.vertex1 ();
const glm::vec3 e2 = tri.vertex3 () - tri.vertex1 ();
const glm::vec3 s1 = glm::cross (ray.direction (), e2);
const float invDet = 1.0f / glm::dot (s1, e1);
const glm::vec3 d = ray.origin () - tri.vertex1 ();
const glm::vec3 s2 = glm::cross (d, e1);
const float b1 = glm::dot (d, s1) * invDet;
const float b2 = glm::dot (ray.direction (), s2) * invDet;
const float tRay = glm::dot (e2, s2) * invDet;
if (b1 < 0.0f || b2 < 0.0f || b1 + b2 > 1.0f || (tRay < 0.0f && ray.isLine () == false))
{
return false;
}
else
{
Util::setIfNotNull (t, tRay);
return true;
}
}
bool IntersectionUtil::intersects (const PrimRay& ray, const PrimAABox& box, float* t)
{
const glm::vec3 invDir = glm::vec3 (1.0f) / ray.direction ();
const glm::vec3 lowerTs = (box.minimum () - ray.origin ()) * invDir;
const glm::vec3 upperTs = (box.maximum () - ray.origin ()) * invDir;
const glm::vec3 min = glm::min (lowerTs, upperTs);
const glm::vec3 max = glm::max (lowerTs, upperTs);
const float tMin = glm::max (glm::max (min.x, min.y), min.z);
const float tMax = glm::min (glm::min (max.x, max.y), max.z);
if ((tMax >= 0.0f || ray.isLine ()) && tMin <= tMax)
{
Util::setIfNotNull (t, tMin);
return true;
}
else
{
return false;
}
}
bool IntersectionUtil::intersects (const PrimRay& ray, const PrimCylinder& cylinder, float* tRay,
float* tCyl)
{
const glm::vec3& dir = ray.direction ();
const glm::vec3& cylDir = cylinder.direction ();
const glm::vec3 offset = ray.origin () - cylinder.center1 ();
const glm::vec3 d = dir - (cylDir * glm::dot (cylDir, dir));
const glm::vec3 c = offset - (cylDir * glm::dot (cylDir, offset));
const float radius2 = cylinder.radius () * cylinder.radius ();
float tmpRay;
if (intersectsQuadric (glm::dot (d, d), 2.0f * glm::dot (c, d), glm::dot (c, c) - radius2,
ray.isLine (), &tmpRay))
{
const glm::vec3 p = ray.pointAt (tmpRay);
const float tmpCyl = glm::dot (cylDir, p - cylinder.center1 ());
if (tmpCyl >= 0.0f && tmpCyl <= cylinder.length ())
{
Util::setIfNotNull (tRay, tmpRay);
Util::setIfNotNull (tCyl, tmpCyl);
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
bool IntersectionUtil::intersects (const PrimRay& ray, const PrimCone& cone, float* tRay,
float* tCone)
{
if (cone.isCylinder ())
{
return IntersectionUtil::intersects (ray, PrimCylinder (cone), tRay, tCone);
}
else
{
const glm::vec3& dir = ray.direction ();
const glm::vec3& coneDir = cone.direction ();
const glm::vec3 offset = ray.origin () - cone.apex ();
const float dotD = glm::dot (coneDir, dir);
const float dotO = glm::dot (coneDir, offset);
const glm::vec3 d = dir - (coneDir * dotD);
const glm::vec3 c = offset - (coneDir * glm::dot (coneDir, offset));
const float sinSqr = cone.sinAlpha () * cone.sinAlpha ();
const float cosSqr = cone.cosAlpha () * cone.cosAlpha ();
float tmpRay;
if (intersectsQuadric ((cosSqr * glm::dot (d, d)) - (sinSqr * dotD * dotD),
(2.0f * cosSqr * glm::dot (c, d)) - (2.0f * sinSqr * dotD * dotO),
(cosSqr * glm::dot (c, c)) - (sinSqr * dotO * dotO), ray.isLine (),
&tmpRay))
{
const glm::vec3 p = ray.pointAt (tmpRay);
const float tmpCone = glm::dot (coneDir, p - cone.center1 ());
if (tmpCone >= 0.0f && tmpCone <= cone.length ())
{
Util::setIfNotNull (tRay, tmpRay);
Util::setIfNotNull (tCone, tmpCone);
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
}
bool IntersectionUtil::intersects (const PrimPlane& plane, const PrimAABox& box)
{
const glm::vec3& max = box.maximum ();
const glm::vec3& min = box.minimum ();
const glm::vec3 p =
glm::vec3 (plane.normal ().x >= 0.0f ? max.x : min.x, plane.normal ().y >= 0.0f ? max.y : min.y,
plane.normal ().z >= 0.0f ? max.z : min.z);
const glm::vec3 n =
glm::vec3 (plane.normal ().x >= 0.0f ? min.x : max.x, plane.normal ().y >= 0.0f ? min.y : max.y,
plane.normal ().z >= 0.0f ? min.z : max.z);
return plane.distance (p) * plane.distance (n) < 0.0f;
}
bool IntersectionUtil::intersects (const PrimPlane& plane, const PrimTriangle& tri)
{
const float d1 = plane.distance (tri.vertex1 ());
const float d2 = plane.distance (tri.vertex2 ());
const float d3 = plane.distance (tri.vertex3 ());
const bool oneLess = d1 < Util::epsilon () || d2 < Util::epsilon () || d3 < Util::epsilon ();
const bool oneGreater =
d1 > -Util::epsilon () || d2 > -Util::epsilon () || d3 > -Util::epsilon ();
return oneLess && oneGreater;
}
bool IntersectionUtil::intersects (const PrimCylinder& cylinder, const glm::vec3& point)
{
const glm::vec3 d = point - cylinder.center1 ();
const float dot = glm::dot (cylinder.direction (), d);
const glm::vec3 t = d - (cylinder.direction () * dot);
return dot >= 0.0f && dot <= cylinder.length () &&
glm::dot (t, t) <= cylinder.radius () * cylinder.radius ();
}
bool IntersectionUtil::intersects (const PrimCone& cone, const glm::vec3& point)
{
if (cone.isCylinder ())
{
return IntersectionUtil::intersects (PrimCylinder (cone), point);
}
else
{
const glm::vec3 d = point - cone.center1 ();
const float dot = glm::dot (cone.direction (), d);
const glm::vec3 t = d - (cone.direction () * dot);
const float r = glm::mix (cone.radius1 (), cone.radius2 (), dot / cone.length ());
return dot >= 0.0f && dot <= cone.length () && glm::dot (t, t) <= r * r;
}
}
bool IntersectionUtil::intersects (const PrimAABox& a, const PrimAABox& b)
{
const bool overlap1 = glm::all (glm::greaterThanEqual (a.minimum (), b.maximum ()));
const bool overlap2 = glm::all (glm::greaterThanEqual (b.minimum (), a.maximum ()));
const bool contain1 = glm::all (glm::greaterThan (a.maximum (), b.maximum ())) &&
glm::all (glm::lessThan (a.minimum (), b.minimum ()));
const bool contain2 = glm::all (glm::greaterThan (b.maximum (), a.maximum ())) &&
glm::all (glm::lessThan (b.minimum (), a.minimum ()));
return overlap1 || overlap2 || contain1 || contain2;
}
// http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/code/tribox_tam.pdf
bool IntersectionUtil::intersects (const PrimAABox& box, const PrimTriangle& tri)
{
const glm::vec3 v0 = tri.vertex1 () - box.center ();
const glm::vec3 v1 = tri.vertex2 () - box.center ();
const glm::vec3 v2 = tri.vertex3 () - box.center ();
const glm::vec3 e0 = v1 - v0;
const glm::vec3 e1 = v2 - v1;
const glm::vec3 e2 = v0 - v2;
const glm::vec3 hw = box.halfWidth ();
const glm::vec3 x = glm::vec3 (1.0f, 0.0f, 0.0f);
const glm::vec3 y = glm::vec3 (0.0f, 1.0f, 0.0f);
const glm::vec3 z = glm::vec3 (0.0f, 0.0f, 1.0f);
auto sepAxis = [&v0, &v1, &v2, &hw](const glm::vec3& a) -> bool {
const float radius = glm::dot (hw, glm::abs (a));
const float p0 = glm::dot (a, v0);
const float p1 = glm::dot (a, v1);
const float p2 = glm::dot (a, v2);
const float min = glm::min (p0, glm::min (p1, p2));
const float max = glm::max (p0, glm::max (p1, p2));
return min > radius || max < -radius;
};
const bool sep1 = glm::min (v0.x, glm::min (v1.x, v2.x)) > hw.x;
const bool sep2 = glm::max (v0.x, glm::max (v1.x, v2.x)) < -hw.x;
const bool sep3 = glm::min (v0.y, glm::min (v1.y, v2.y)) > hw.y;
const bool sep4 = glm::max (v0.y, glm::max (v1.y, v2.y)) < -hw.y;
const bool sep5 = glm::min (v0.z, glm::min (v1.z, v2.z)) > hw.z;
const bool sep6 = glm::max (v0.z, glm::max (v1.z, v2.z)) < -hw.z;
if (sep1 || sep2 || sep3 || sep4 || sep5 || sep6)
{
return false;
}
const bool sep7 = sepAxis (glm::cross (x, e0));
const bool sep8 = sepAxis (glm::cross (x, e1));
const bool sep9 = sepAxis (glm::cross (x, e2));
const bool sep10 = sepAxis (glm::cross (y, e0));
const bool sep11 = sepAxis (glm::cross (y, e1));
const bool sep12 = sepAxis (glm::cross (y, e2));
const bool sep13 = sepAxis (glm::cross (z, e0));
const bool sep14 = sepAxis (glm::cross (z, e1));
const bool sep15 = sepAxis (glm::cross (z, e2));
if (sep7 || sep8 || sep9 || sep10 || sep11 || sep12 || sep13 || sep14 || sep15)
{
return false;
}
else
{
return IntersectionUtil::intersects (PrimPlane (tri.vertex1 (), tri.normal ()), box);
}
}
================================================
FILE: lib/src/intersection.hpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#ifndef DILAY_INTERSECTION
#define DILAY_INTERSECTION
#include <glm/glm.hpp>
class PrimAABox;
class PrimCone;
class PrimCylinder;
class PrimPlane;
class PrimRay;
class PrimSphere;
class PrimTriangle;
class Intersection
{
public:
Intersection ();
bool isIntersection () const;
const glm::vec3& position () const;
const glm::vec3& normal () const;
float distance () const;
void reset ();
bool update (float, const glm::vec3&, const glm::vec3&);
static Intersection& min (Intersection&, Intersection&);
static void sort (Intersection&, Intersection&);
private:
bool _isIntersection;
float _distance;
glm::vec3 _position;
glm::vec3 _normal;
};
namespace IntersectionUtil
{
bool intersects (const PrimSphere&, const PrimTriangle&);
bool intersects (const PrimSphere&, const PrimAABox&);
bool intersects (const PrimSphere&, const PrimSphere&);
bool intersects (const PrimRay&, const PrimSphere&, float*);
bool intersects (const PrimRay&, const PrimPlane&, float*);
bool intersects (const PrimRay&, const PrimTriangle&, bool, float*);
bool intersects (const PrimRay&, const PrimAABox&, float*);
bool intersects (const PrimRay&, const PrimCylinder&, float*, float*);
bool intersects (const PrimRay&, const PrimCone&, float*, float*);
bool intersects (const PrimPlane&, const PrimAABox&);
bool intersects (const PrimPlane&, const PrimTriangle&);
bool intersects (const PrimCylinder&, const glm::vec3&);
bool intersects (const PrimCone&, const glm::vec3&);
bool intersects (const PrimAABox&, const PrimAABox&);
bool intersects (const PrimAABox&, const PrimTriangle&);
}
#endif
================================================
FILE: lib/src/isosurface-extraction/IsosurfaceExtractionConfigurations.hs
================================================
{- This file is part of Dilay
- Copyright © 2015-2018 Alexander Bau
- Use and redistribute under the terms of the GNU General Public License
-}
import Control.Exception (assert)
import Control.Monad (forM_)
import Data.Char (toLower)
import Data.Function (on)
import Data.List (intercalate,nubBy,sortBy)
data Configuration = Configuration
{ base :: Int
, vertices :: [Bool]
, vertexIndices :: [Int]
, nonManifoldConfig :: Bool
}
deriving Show
set :: Int -> a -> [a] -> [a]
set 0 x (y:ys) = x:ys
set i x (y:ys) = y:(set (i - 1) x ys)
setList :: [Int] -> a -> [a] -> [a]
setList is value xs = foldl (\xs i -> set i value xs) xs is
baseConfigurations :: [Configuration]
baseConfigurations =
[ go 0 [] [] False
, go 1 [4] [[2, 6, 7]] False
, go 2 [4, 5] [[2, 5, 7, 10]] False
, go 3 [4, 7] [[2, 6, 7], [9, 10, 11]] False
, go 4 [3, 4] [[2, 6, 7], [3, 4, 11]] False
, go 5 [0, 1, 5] [[1, 2, 4, 6, 10]] False
, go 6 [3, 4, 5] [[2, 5, 7, 10], [3, 4, 11]] False
, go 7 [3, 5, 6] [[7, 8, 9], [3, 4, 11], [5, 6, 10]] False
, go 8 [0, 1, 4, 5] [[1, 4, 7, 10]] False
, go 9 [0, 1, 2, 4] [[3, 4, 5, 6, 7, 8]] False
, go 10 [1, 3, 4, 6] [[2, 6, 8, 9], [0, 3, 5, 11]] False
, go 11 [0, 1, 3, 4] [[1, 3, 5, 6, 7, 11]] False
, go 12 [0, 1, 5, 6] [[7, 8, 9], [1, 2, 4, 6, 10]] False
, go 13 [1, 2, 4, 7] [[2, 6, 7], [9, 10, 11], [1, 3, 8], [0, 4, 5]] False
, go 14 [0, 1, 2, 5] [[2, 3, 4, 6, 8, 10]] False
, go 15 [0, 1, 2, 4, 7] [[3, 4, 5, 6, 7, 8], [9, 10, 11]] False
, go 16 [0, 1, 2, 6, 7] [[2, 5, 7, 10], [3, 4, 11]] True
, go 17 [2, 3, 4, 6, 7] [[1, 2, 4, 6, 10]] False
, go 18 [0, 1, 2, 5, 6, 7] [[2, 6, 7], [3, 4, 11]] False
, go 19 [0, 1, 2, 3, 5, 6] [[2, 6, 7], [9, 10, 11]] True
, go 20 [0, 1, 2, 3, 6, 7] [[2, 5, 7, 10]] False
, go 21 [0, 1, 2, 3, 5, 6, 7] [[2, 6, 7]] False
, go 22 [0, 1, 2, 3, 4, 5, 6, 7] [] False
]
where
go base vertices vertexIndices nonManifold =
Configuration base (setList vertices True $ replicate 8 False)
(mkVertexIndices 0 vertexIndices) nonManifold
mkVertexIndices :: Int -> [[Int]] -> [Int]
mkVertexIndices vertexIndex [] = replicate 12 (-1)
mkVertexIndices vertexIndex (edgeGroup:edgeGroups) = setList edgeGroup vertexIndex rest
where
rest = mkVertexIndices (vertexIndex + 1) edgeGroups
allConfigurations :: [Configuration]
allConfigurations = sortBy (sort `on` vertices)
$ nubBy ((==) `on` vertices)
$ concat
$ do
x <- [id, rotateX, rotateX . rotateX, rotateX . rotateX . rotateX]
y <- [id, rotateY, rotateY . rotateY, rotateY . rotateY . rotateY]
z <- [id, rotateZ, rotateZ . rotateZ, rotateZ . rotateZ . rotateZ]
return $ map (($) (x . y . z)) baseConfigurations
where
rotateX (Configuration base [v0, v1, v2, v3, v4, v5, v6, v7]
[e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11] nonManifold)
= Configuration base [v4, v5, v0, v1, v6, v7, v2, v3]
[e6, e2, e7, e0, e5, e10, e9, e8, e1, e3, e11, e4] nonManifold
rotateY (Configuration base [v0, v1, v2, v3, v4, v5, v6, v7]
[e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11] nonManifold)
= Configuration base [v1, v5, v3, v7, v0, v4, v2, v6]
[e5, e4, e0, e11, e10, e6, e2, e1, e3, e8, e7, e9] nonManifold
rotateZ (Configuration base [v0, v1, v2, v3, v4, v5, v6, v7]
[e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11] nonManifold)
= Configuration base [v2, v0, v3, v1, v6, v4, v7, v5]
[e1, e3, e8, e4, e0, e2, e7, e9, e11, e10, e6, e5] nonManifold
sort xs ys = go (reverse xs) (reverse ys)
where
go (False:xs) (True:ys) = LT
go (True:xs) (False:ys) = GT
go (_:xs) (_:ys) = go xs ys
main :: IO ()
main = assert (length allConfigurations == 256)
$ printBases >> printNonManifold >> printVertexIndices
where
printBases = putStrLn $ toList (show . base) allConfigurations
printNonManifold = putStrLn $ toList (map toLower . show . nonManifoldConfig) allConfigurations
printVertexIndices =
putStrLn $ toList (\c -> toList show (vertexIndices c) ++ "\n") allConfigurations
toList xToString xs = unwords $ "{" :
[ intercalate ", " $ map xToString xs ]
++ ["}"]
================================================
FILE: lib/src/isosurface-extraction/grid.cpp
================================================
/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
gitextract_luuhfc7x/
├── .clang-format
├── .gitignore
├── LICENSE.txt
├── README.md
├── app/
│ ├── app.pro
│ └── src/
│ └── main.cpp
├── common.pri
├── dilay.pro
├── icon.tex
├── lib/
│ ├── lib.pro
│ └── src/
│ ├── IsosurfaceExtractionConfigurations.hs
│ ├── bitset.hpp
│ ├── cache.hpp
│ ├── camera.cpp
│ ├── camera.hpp
│ ├── color.cpp
│ ├── color.hpp
│ ├── config.cpp
│ ├── config.hpp
│ ├── configurable.cpp
│ ├── configurable.hpp
│ ├── dimension.cpp
│ ├── dimension.hpp
│ ├── distance.cpp
│ ├── distance.hpp
│ ├── dynamic/
│ │ ├── faces.cpp
│ │ ├── faces.hpp
│ │ ├── mesh-intersection.cpp
│ │ ├── mesh-intersection.hpp
│ │ ├── mesh.cpp
│ │ ├── mesh.hpp
│ │ ├── octree.cpp
│ │ └── octree.hpp
│ ├── hash.hpp
│ ├── history.cpp
│ ├── history.hpp
│ ├── import-export.cpp
│ ├── import-export.hpp
│ ├── intersection.cpp
│ ├── intersection.hpp
│ ├── isosurface-extraction/
│ │ ├── IsosurfaceExtractionConfigurations.hs
│ │ ├── grid.cpp
│ │ └── grid.hpp
│ ├── isosurface-extraction.cpp
│ ├── isosurface-extraction.hpp
│ ├── kvstore.cpp
│ ├── kvstore.hpp
│ ├── log.cpp
│ ├── log.hpp
│ ├── macro.hpp
│ ├── maybe.hpp
│ ├── mesh-util.cpp
│ ├── mesh-util.hpp
│ ├── mesh.cpp
│ ├── mesh.hpp
│ ├── mirror.cpp
│ ├── mirror.hpp
│ ├── opengl-buffer-id.cpp
│ ├── opengl-buffer-id.hpp
│ ├── opengl.cpp
│ ├── opengl.hpp
│ ├── primitive/
│ │ ├── aabox.cpp
│ │ ├── aabox.hpp
│ │ ├── cone-sphere.cpp
│ │ ├── cone-sphere.hpp
│ │ ├── cone.cpp
│ │ ├── cone.hpp
│ │ ├── cylinder.cpp
│ │ ├── cylinder.hpp
│ │ ├── plane.cpp
│ │ ├── plane.hpp
│ │ ├── ray.cpp
│ │ ├── ray.hpp
│ │ ├── sphere.cpp
│ │ ├── sphere.hpp
│ │ ├── triangle.cpp
│ │ └── triangle.hpp
│ ├── render-mode.cpp
│ ├── render-mode.hpp
│ ├── renderer.cpp
│ ├── renderer.hpp
│ ├── scene.cpp
│ ├── scene.hpp
│ ├── shader.cpp
│ ├── shader.hpp
│ ├── sketch/
│ │ ├── bone-intersection.cpp
│ │ ├── bone-intersection.hpp
│ │ ├── fwd.hpp
│ │ ├── mesh-intersection.cpp
│ │ ├── mesh-intersection.hpp
│ │ ├── mesh.cpp
│ │ ├── mesh.hpp
│ │ ├── node-intersection.cpp
│ │ ├── node-intersection.hpp
│ │ ├── path-intersection.cpp
│ │ ├── path-intersection.hpp
│ │ ├── path.cpp
│ │ └── path.hpp
│ ├── state.cpp
│ ├── state.hpp
│ ├── time-delta.cpp
│ ├── time-delta.hpp
│ ├── tool/
│ │ ├── convert-sketch.cpp
│ │ ├── delete-mesh.cpp
│ │ ├── delete-sketch.cpp
│ │ ├── edit-sketch.cpp
│ │ ├── key.hpp
│ │ ├── move-camera.cpp
│ │ ├── move-camera.hpp
│ │ ├── new-mesh.cpp
│ │ ├── remesh.cpp
│ │ ├── sculpt/
│ │ │ ├── crease.cpp
│ │ │ ├── draw.cpp
│ │ │ ├── flatten.cpp
│ │ │ ├── grab.cpp
│ │ │ ├── pinch.cpp
│ │ │ ├── reduce.cpp
│ │ │ ├── smooth.cpp
│ │ │ └── util/
│ │ │ ├── action.cpp
│ │ │ ├── action.hpp
│ │ │ ├── brush.cpp
│ │ │ ├── brush.hpp
│ │ │ ├── edge-collection.cpp
│ │ │ └── edge-collection.hpp
│ │ ├── sculpt.cpp
│ │ ├── sculpt.hpp
│ │ ├── sketch-spheres.cpp
│ │ ├── transform-mesh.cpp
│ │ ├── trim-mesh/
│ │ │ ├── action.cpp
│ │ │ ├── action.hpp
│ │ │ ├── border.cpp
│ │ │ ├── border.hpp
│ │ │ ├── split-mesh.cpp
│ │ │ └── split-mesh.hpp
│ │ ├── trim-mesh.cpp
│ │ └── util/
│ │ ├── movement.cpp
│ │ ├── movement.hpp
│ │ ├── rotation.cpp
│ │ ├── rotation.hpp
│ │ ├── scaling.cpp
│ │ ├── scaling.hpp
│ │ ├── step.cpp
│ │ └── step.hpp
│ ├── tool.cpp
│ ├── tool.hpp
│ ├── tools.hpp
│ ├── tree.hpp
│ ├── util.cpp
│ ├── util.hpp
│ ├── variant.hpp
│ ├── view/
│ │ ├── axis.cpp
│ │ ├── axis.hpp
│ │ ├── color-button.cpp
│ │ ├── color-button.hpp
│ │ ├── configuration.cpp
│ │ ├── configuration.hpp
│ │ ├── context-menu.cpp
│ │ ├── context-menu.hpp
│ │ ├── cursor.cpp
│ │ ├── cursor.hpp
│ │ ├── double-slider.cpp
│ │ ├── double-slider.hpp
│ │ ├── floor-plane.cpp
│ │ ├── floor-plane.hpp
│ │ ├── gl-widget.cpp
│ │ ├── gl-widget.hpp
│ │ ├── info-pane/
│ │ │ ├── scene.cpp
│ │ │ └── scene.hpp
│ │ ├── info-pane.cpp
│ │ ├── info-pane.hpp
│ │ ├── input.cpp
│ │ ├── input.hpp
│ │ ├── key-event.cpp
│ │ ├── key-event.hpp
│ │ ├── light.cpp
│ │ ├── light.hpp
│ │ ├── log.cpp
│ │ ├── log.hpp
│ │ ├── main-window.cpp
│ │ ├── main-window.hpp
│ │ ├── menu-bar.cpp
│ │ ├── menu-bar.hpp
│ │ ├── pointing-event.cpp
│ │ ├── pointing-event.hpp
│ │ ├── resolution-slider.cpp
│ │ ├── resolution-slider.hpp
│ │ ├── shortcut.cpp
│ │ ├── shortcut.hpp
│ │ ├── tool-pane.cpp
│ │ ├── tool-pane.hpp
│ │ ├── tool-tip.cpp
│ │ ├── tool-tip.hpp
│ │ ├── two-column-grid.cpp
│ │ ├── two-column-grid.hpp
│ │ ├── util.cpp
│ │ ├── util.hpp
│ │ ├── vector-edit.cpp
│ │ └── vector-edit.hpp
│ ├── xml-conversion.cpp
│ └── xml-conversion.hpp
├── test/
│ ├── src/
│ │ ├── main.cpp
│ │ ├── test-bitset.cpp
│ │ ├── test-bitset.hpp
│ │ ├── test-distance.cpp
│ │ ├── test-distance.hpp
│ │ ├── test-intersection.cpp
│ │ ├── test-intersection.hpp
│ │ ├── test-maybe.cpp
│ │ ├── test-maybe.hpp
│ │ ├── test-misc.cpp
│ │ ├── test-misc.hpp
│ │ ├── test-octree.cpp
│ │ ├── test-octree.hpp
│ │ ├── test-prune.cpp
│ │ ├── test-prune.hpp
│ │ ├── test-tree.cpp
│ │ └── test-tree.hpp
│ └── test.pro
├── unix/
│ ├── dilay.desktop
│ └── docker/
│ ├── appimage/
│ │ ├── Dockerfile
│ │ └── entrypoint.sh
│ ├── debian-sid/
│ │ ├── Dockerfile
│ │ └── entrypoint.sh
│ ├── ubuntu-bionic/
│ │ ├── Dockerfile
│ │ └── entrypoint.sh
│ ├── ubuntu-trusty/
│ │ ├── Dockerfile
│ │ └── entrypoint.sh
│ └── ubuntu-xenial/
│ ├── Dockerfile
│ └── entrypoint.sh
└── win32/
├── LICENSE.rtf
├── deploy.bat
└── installer.wix
SYMBOL INDEX (1570 symbols across 185 files)
FILE: app/src/main.cpp
function QString (line 19) | QString configPath ()
function backupCrashLog (line 24) | void backupCrashLog ()
function main (line 40) | int main (int argv, char** args)
FILE: lib/src/bitset.hpp
class Bitset (line 10) | class Bitset
method Bitset (line 13) | Bitset ()
method Bitset (line 18) | Bitset (const Bitset& other)
method get (line 23) | bool get () const
method set (line 29) | void set (bool value = true)
method toggle (line 43) | void toggle () { this->set<N> (!this->get<N> ()); }
method reset (line 45) | void reset () { this->set<N> (false); }
method reset (line 47) | void reset () { this->_data = 0; }
method none (line 49) | bool none () const { return this->_data == 0; }
method all (line 51) | bool all () const
method T (line 59) | T value () const { return this->_data; }
FILE: lib/src/cache.hpp
class Cache (line 10) | class Cache
method Cache (line 13) | Cache ()
method T (line 18) | const T& get (const std::string& path, const T& value) const
method set (line 23) | void set (const std::string& path, const T& value)
class CacheProxy (line 32) | class CacheProxy
method CacheProxy (line 35) | CacheProxy (Cache& c, const std::string& p)
method CacheProxy (line 42) | CacheProxy (CacheProxy& o, const std::string& path)
method Cache (line 47) | Cache& cache () const { return this->_cache; }
method key (line 49) | std::string key (const std::string& path) const { return this->prefix ...
method T (line 51) | const T& get (const std::string& path, const T& v) const
method set (line 56) | void set (const std::string& path, const T& v) const
FILE: lib/src/camera.cpp
type Camera::Impl (line 18) | struct Camera::Impl
method Impl (line 33) | Impl (Camera* s, const Config& config)
method realUp (line 49) | glm::vec3 realUp () const { return glm::normalize (glm::cross (this->t...
method position (line 51) | glm::vec3 position () const { return this->gazePoint + this->toEyePoin...
method world (line 53) | glm::mat4x4 world () const
method updateResolution (line 64) | void updateResolution (const glm::uvec2& dimension)
method setModelViewProjection (line 70) | void setModelViewProjection (const glm::mat4x4& model, const glm::mat3...
method set (line 86) | void set (const glm::vec3& g, const glm::vec3& e)
method setGaze (line 102) | void setGaze (const glm::vec3& g)
method stepAlongGaze (line 108) | void stepAlongGaze (float factor)
method verticalRotation (line 123) | void verticalRotation (float angle)
method horizontalRotation (line 131) | void horizontalRotation (float angle)
method viewport (line 138) | glm::vec4 viewport () const { return glm::vec4 (0, 0, this->resolution...
method fromWorld (line 140) | glm::vec2 fromWorld (const glm::vec3& p, const glm::mat4x4& model, boo...
method toWorld (line 148) | glm::vec3 toWorld (const glm::ivec2& p, float z = 0.0f) const
method toWorld (line 156) | float toWorld (float length, float z)
method PrimRay (line 163) | PrimRay ray (const glm::ivec2& p) const
method updateProjection (line 170) | void updateProjection ()
method updateView (line 178) | void updateView ()
method Dimension (line 187) | Dimension primaryDimension () const
method planeIntersection (line 201) | glm::vec3 planeIntersection (const glm::ivec2& p, const PrimPlane& pla...
method viewPlaneIntersection (line 217) | glm::vec3 viewPlaneIntersection (const glm::ivec2& p) const
method primaryPlaneIntersection (line 223) | glm::vec3 primaryPlaneIntersection (const glm::ivec2& p) const
method runFromConfig (line 229) | void runFromConfig (const Config& config)
FILE: lib/src/camera.hpp
type Dimension (line 12) | enum class Dimension
class PrimRay (line 13) | class PrimRay
class Renderer (line 14) | class Renderer
class Camera (line 16) | class Camera : public Configurable
FILE: lib/src/color.cpp
function Color (line 54) | Color Color::Black () { return Color (0.0f, 0.0f, 0.0f); }
function Color (line 56) | Color Color::White () { return Color (1.0f, 1.0f, 1.0f); }
function Color (line 58) | Color Color::Red () { return Color (1.0f, 0.0f, 0.0f); }
function Color (line 60) | Color Color::Green () { return Color (0.0f, 1.0f, 0.0f); }
function Color (line 62) | Color Color::Blue () { return Color (0.0f, 0.0f, 1.0f); }
function QColor (line 91) | QColor Color::qColor () const
FILE: lib/src/color.hpp
class QColor (line 10) | class QColor
class Color (line 12) | class Color
FILE: lib/src/config.cpp
function updateValue (line 15) | void updateValue (Config& config, const std::string& path, const T& oldV...
function forceUpdateValue (line 24) | void forceUpdateValue (Config& config, const std::string& path, const T&...
function mapValue (line 30) | void mapValue (Config& config, const std::string& path, const std::funct...
FILE: lib/src/config.hpp
class Config (line 10) | class Config
method T (line 15) | const T& get (const std::string& path) const
method set (line 20) | void set (const std::string& path, const T& value)
method fromFile (line 25) | void fromFile (const std::string& fileName)
method toFile (line 31) | void toFile (const std::string& fileName) const { this->store.toFile (...
method remove (line 33) | void remove (const std::string& path) { this->store.remove (path); }
class ConfigProxy (line 43) | class ConfigProxy
method ConfigProxy (line 46) | ConfigProxy (const Config& c, const std::string& p)
method ConfigProxy (line 53) | ConfigProxy (const ConfigProxy& o, const std::string& path)
method Config (line 58) | const Config& config () const { return this->_config; }
method key (line 60) | std::string key (const std::string& path) const { return this->prefix ...
method T (line 62) | const T& get (const std::string& path) const
FILE: lib/src/configurable.hpp
class Config (line 8) | class Config
class ConfigProxy (line 9) | class ConfigProxy
class Configurable (line 11) | class Configurable
class ProxyConfigurable (line 20) | class ProxyConfigurable
FILE: lib/src/dimension.hpp
type Dimension (line 10) | enum class Dimension
type DimensionUtil (line 17) | namespace DimensionUtil
FILE: lib/src/distance.cpp
function distanceToCylinder (line 16) | float distanceToCylinder (const glm::vec3& center1, float radius, float ...
FILE: lib/src/distance.hpp
class PrimCone (line 10) | class PrimCone
class PrimConeSphere (line 11) | class PrimConeSphere
class PrimCylinder (line 12) | class PrimCylinder
class PrimSphere (line 13) | class PrimSphere
class PrimTriangle (line 14) | class PrimTriangle
type Distance (line 16) | namespace Distance
FILE: lib/src/dynamic/faces.hpp
class DynamicFaces (line 11) | class DynamicFaces
method Container (line 16) | const Container& indices () const { return this->_indices; }
method Container (line 17) | const Container& uncommitted () const { return this->_uncommitted; }
method numElements (line 18) | unsigned int numElements () const { return this->_indices.size (); }
method begin (line 20) | Container::iterator begin () { return this->_indices.begin (); }
method end (line 21) | Container::iterator end () { return this->_indices.end (); }
method begin (line 22) | Container::const_iterator begin () const { return this->_indices.begin...
method end (line 23) | Container::const_iterator end () const { return this->_indices.end (); }
FILE: lib/src/dynamic/mesh-intersection.cpp
function DynamicMesh (line 36) | DynamicMesh& DynamicMeshIntersection::mesh () const
FILE: lib/src/dynamic/mesh-intersection.hpp
class DynamicMesh (line 10) | class DynamicMesh
class DynamicMeshIntersection (line 12) | class DynamicMeshIntersection : public Intersection
FILE: lib/src/dynamic/mesh.cpp
type VertexData (line 27) | struct VertexData
method VertexData (line 32) | VertexData () { this->reset (); }
method reset (line 33) | void reset ()
method addAdjacentFace (line 39) | void addAdjacentFace (unsigned int face) { this->adjacentFaces.push_ba...
method deleteAdjacentFace (line 41) | void deleteAdjacentFace (unsigned int face)
type FaceData (line 55) | struct FaceData
method FaceData (line 59) | FaceData () { this->reset (); }
method reset (line 60) | void reset () { this->isFree = true; }
function Impl (line 76) | Impl (DynamicMesh* s)
function Impl (line 81) | Impl (DynamicMesh* s, const Mesh& m)
function numVertices (line 87) | unsigned int numVertices () const
function numFaces (line 94) | unsigned int numFaces () const
function isEmpty (line 100) | bool isEmpty () const { return this->numFaces () == 0; }
function isFreeVertex (line 102) | bool isFreeVertex (unsigned int i) const
function isFreeFace (line 108) | bool isFreeFace (unsigned int i) const
function isPruned (line 114) | bool isPruned () const
function valence (line 119) | unsigned int valence (unsigned int i) const
function vertexIndices (line 125) | void vertexIndices (unsigned int i, unsigned int& i1, unsigned int& i2, ...
function PrimTriangle (line 134) | PrimTriangle face (unsigned int i) const
function faceNormal (line 145) | glm::vec3 faceNormal (unsigned int i) const
function findAdjacent (line 156) | void findAdjacent (unsigned int e1, unsigned int e2, unsigned int& leftF...
function forEachVertex (line 216) | void forEachVertex (const std::function<void(unsigned int)>& f) const
function visitVertices (line 227) | void visitVertices (unsigned int i, const std::function<void(unsigned in...
function unvisitVertices (line 252) | void unvisitVertices ()
function unvisitFaces (line 257) | void unvisitFaces () { std::memset (this->faceVisited.data (), 0, this->...
function forEachVertex (line 259) | void forEachVertex (const DynamicFaces& faces, const std::function<void(...
function forEachVertexExt (line 269) | void forEachVertexExt (const DynamicFaces& faces, const std::function<vo...
function forEachVertexAdjacentToVertex (line 290) | void forEachVertexAdjacentToVertex (unsigned int ...
function forEachVertexAdjacentToFace (line 319) | void forEachVertexAdjacentToFace (unsigned int ...
function forEachFace (line 332) | void forEachFace (const std::function<void(unsigned int)>& f) const
function forEachFaceExt (line 343) | void forEachFaceExt (const DynamicFaces& faces, const std::function<void...
function average (line 368) | void average (const DynamicFaces& faces, glm::vec3& position, glm::vec3&...
function averagePosition (line 390) | glm::vec3 averagePosition (const DynamicFaces& faces) const
function averagePosition (line 404) | glm::vec3 averagePosition (unsigned int i) const
function averageNormal (line 416) | glm::vec3 averageNormal (const DynamicFaces& faces) const
function averageNormal (line 433) | glm::vec3 averageNormal (unsigned int i) const
function averageEdgeLengthSqr (line 451) | float averageEdgeLengthSqr (const DynamicFaces& faces) const
function averageEdgeLengthSqr (line 463) | float averageEdgeLengthSqr (unsigned int i) const
function addVertex (line 477) | unsigned int addVertex (const glm::vec3& vertex, const glm::vec3& normal)
function addFace (line 502) | unsigned int addFace (unsigned int i1, unsigned int i2, unsigned int i3)
function addFaceToOctree (line 544) | void addFaceToOctree (unsigned int i)
function deleteVertex (line 556) | void deleteVertex (unsigned int i)
function deleteFace (line 571) | void deleteFace (unsigned int i)
function vertexNormal (line 586) | void vertexNormal (unsigned int i, const glm::vec3& n)
function setVertexNormal (line 594) | void setVertexNormal (unsigned int i)
function setAllNormals (line 608) | void setAllNormals ()
function reset (line 613) | void reset ()
function fromMesh (line 625) | void fromMesh (const Mesh& mesh)
function realignFace (line 646) | void realignFace (unsigned int i)
function realignFaces (line 655) | void realignFaces (const DynamicFaces& faces)
function realignAllFaces (line 663) | void realignAllFaces ()
function sanitize (line 668) | void sanitize ()
function prune (line 674) | void prune (std::vector<unsigned int>* pVertexIndexMap, std::vector<unsi...
function pruneAndCheckConsistency (line 761) | bool pruneAndCheckConsistency (std::vector<unsigned int>* pVertexIndexMap,
function mirrorPositive (line 788) | bool mirrorPositive (const PrimPlane& plane)
function mirror (line 835) | void mirror (const PrimPlane& plane)
function moveToCenter (line 842) | void moveToCenter ()
function normalizeScaling (line 849) | void normalizeScaling ()
function bufferData (line 856) | void bufferData ()
FILE: lib/src/dynamic/mesh.hpp
class Camera (line 14) | class Camera
class Color (line 15) | class Color
class DynamicFaces (line 16) | class DynamicFaces
class DynamicMeshIntersection (line 17) | class DynamicMeshIntersection
class Intersection (line 18) | class Intersection
class Mesh (line 19) | class Mesh
class PrimAABox (line 20) | class PrimAABox
class PrimPlane (line 21) | class PrimPlane
class PrimRay (line 22) | class PrimRay
class PrimSphere (line 23) | class PrimSphere
class PrimTriangle (line 24) | class PrimTriangle
class RenderMode (line 25) | class RenderMode
class DynamicMesh (line 27) | class DynamicMesh : public Configurable
FILE: lib/src/dynamic/octree.cpp
type IndexOctreeNode (line 27) | struct IndexOctreeNode
method IndexOctreeNode (line 54) | IndexOctreeNode (const glm::vec3& c, float w, int d)
method approxContains (line 65) | bool approxContains (const glm::vec3& position, float maxDimExtent) const
method childIndex (line 83) | unsigned int childIndex (const glm::vec3& position) const
method hasChildren (line 101) | bool hasChildren () const
method insertIntoChild (line 108) | bool insertIntoChild (float maxDimExtent) const
method IndexOctreeNode (line 113) | IndexOctreeNode& insertIntoChild (unsigned int index, const glm::vec3&...
method IndexOctreeNode (line 155) | IndexOctreeNode& addElement (unsigned int index, const glm::vec3& posi...
method isEmpty (line 170) | bool isEmpty () const { return this->indices.empty () && this->hasChil...
method deleteElement (line 172) | void deleteElement (unsigned int index)
method deleteEmptyChildren (line 179) | bool deleteEmptyChildren ()
method render (line 210) | void render (Camera& camera, Mesh& nodeMesh) const
method containsOrIntersectsT (line 227) | void containsOrIntersectsT (const T& ...
method intersectsT (line 249) | void intersectsT (const T& t, const DynamicOctree::IntersectionCallbac...
method intersects (line 267) | void intersects (const PrimRay& ray, float& distance,
method distance (line 287) | void distance (PrimSphere& sphere, const DynamicOctree::DistanceCallba...
method numElements (line 315) | unsigned int numElements () const { return this->indices.size (); }
method updateIndices (line 317) | void updateIndices (const std::vector<unsigned int>& indexMap)
method updateStatistics (line 338) | void updateStatistics (IndexOctreeStatistics& stats) const
type IndexOctreeStatistics (line 30) | struct IndexOctreeStatistics
type IndexOctreeNode (line 43) | struct IndexOctreeNode
method IndexOctreeNode (line 54) | IndexOctreeNode (const glm::vec3& c, float w, int d)
method approxContains (line 65) | bool approxContains (const glm::vec3& position, float maxDimExtent) const
method childIndex (line 83) | unsigned int childIndex (const glm::vec3& position) const
method hasChildren (line 101) | bool hasChildren () const
method insertIntoChild (line 108) | bool insertIntoChild (float maxDimExtent) const
method IndexOctreeNode (line 113) | IndexOctreeNode& insertIntoChild (unsigned int index, const glm::vec3&...
method IndexOctreeNode (line 155) | IndexOctreeNode& addElement (unsigned int index, const glm::vec3& posi...
method isEmpty (line 170) | bool isEmpty () const { return this->indices.empty () && this->hasChil...
method deleteElement (line 172) | void deleteElement (unsigned int index)
method deleteEmptyChildren (line 179) | bool deleteEmptyChildren ()
method render (line 210) | void render (Camera& camera, Mesh& nodeMesh) const
method containsOrIntersectsT (line 227) | void containsOrIntersectsT (const T& ...
method intersectsT (line 249) | void intersectsT (const T& t, const DynamicOctree::IntersectionCallbac...
method intersects (line 267) | void intersects (const PrimRay& ray, float& distance,
method distance (line 287) | void distance (PrimSphere& sphere, const DynamicOctree::DistanceCallba...
method numElements (line 315) | unsigned int numElements () const { return this->indices.size (); }
method updateIndices (line 317) | void updateIndices (const std::vector<unsigned int>& indexMap)
method updateStatistics (line 338) | void updateStatistics (IndexOctreeStatistics& stats) const
type DynamicOctree::Impl (line 375) | struct DynamicOctree::Impl
method Impl (line 380) | Impl () {}
method Impl (line 382) | Impl (const Impl& other)
method hasRoot (line 388) | bool hasRoot () const { return bool(this->root); }
method setupRoot (line 390) | void setupRoot (const glm::vec3& position, float width)
method makeElementNodeMap (line 396) | void makeElementNodeMap ()
method addToElementNodeMap (line 417) | void addToElementNodeMap (unsigned int index, IndexOctreeNode& node)
method makeParent (line 427) | void makeParent (const glm::vec3& position)
method addElement (line 465) | void addElement (unsigned int index, const glm::vec3& position, float ...
method realignElement (line 481) | void realignElement (unsigned int index, const glm::vec3& position, fl...
method deleteElement (line 497) | void deleteElement (unsigned int index)
method deleteEmptyChildren (line 518) | void deleteEmptyChildren ()
method updateIndices (line 529) | void updateIndices (const std::vector<unsigned int>& newIndices)
method shrinkRoot (line 553) | void shrinkRoot ()
method reset (line 580) | void reset ()
method render (line 587) | void render (Camera& camera) const
method intersects (line 649) | void intersects (const PrimRay& ray, const DynamicOctree::RayIntersect...
method intersects (line 658) | void intersects (const PrimPlane& plane, const DynamicOctree::Intersec...
method intersects (line 666) | void intersects (const PrimSphere& sp...
method intersects (line 675) | void intersects (const PrimAABox& box, const DynamicOctree::ContainsIn...
method distance (line 683) | float distance (const glm::vec3& p, const DistanceCallback& getDistanc...
method printStatistics (line 691) | void printStatistics () const
FILE: lib/src/dynamic/octree.hpp
class Camera (line 13) | class Camera
class PrimAABox (line 14) | class PrimAABox
class PrimPlane (line 15) | class PrimPlane
class PrimRay (line 16) | class PrimRay
class PrimSphere (line 17) | class PrimSphere
class DynamicOctree (line 19) | class DynamicOctree
FILE: lib/src/hash.hpp
type Hash (line 11) | namespace Hash
function combine (line 14) | void combine (std::size_t& seed, const T& value)
type std (line 20) | namespace std
type hash<std::pair<T1, T2>> (line 22) | struct hash<std::pair<T1, T2>>
FILE: lib/src/history.cpp
type SnapshotConfig (line 19) | struct SnapshotConfig
method SnapshotConfig (line 24) | SnapshotConfig (bool d, bool s)
type SceneSnapshot (line 32) | struct SceneSnapshot
method SceneSnapshot (line 38) | SceneSnapshot (const SnapshotConfig& c)
function SceneSnapshot (line 46) | SceneSnapshot sceneSnapshot (const Scene& scene, const SnapshotConfig& c...
method SceneSnapshot (line 38) | SceneSnapshot (const SnapshotConfig& c)
function resetToSnapshot (line 63) | void resetToSnapshot (const SceneSnapshot& snapshot, State& state)
type History::Impl (line 88) | struct History::Impl
method Impl (line 94) | Impl (const Config& config) { this->runFromConfig (config); }
method snapshotAll (line 96) | void snapshotAll (const Scene& scene) { this->snapshot (scene, Snapsho...
method snapshotDynamicMeshes (line 98) | void snapshotDynamicMeshes (const Scene& scene)
method snapshotSketchMeshes (line 103) | void snapshotSketchMeshes (const Scene& scene)
method snapshot (line 108) | void snapshot (const Scene& scene, const SnapshotConfig& config)
method dropPastSnapshot (line 121) | void dropPastSnapshot ()
method dropFutureSnapshot (line 129) | void dropFutureSnapshot ()
method undo (line 137) | void undo (State& state)
method redo (line 149) | void redo (State& state)
method hasRecentDynamicMesh (line 161) | bool hasRecentDynamicMesh () const
method forEachRecentDynamicMesh (line 166) | void forEachRecentDynamicMesh (const std::function<void(const DynamicM...
method reset (line 176) | void reset ()
method runFromConfig (line 182) | void runFromConfig (const Config& config)
FILE: lib/src/history.hpp
class DynamicMesh (line 12) | class DynamicMesh
class Scene (line 13) | class Scene
class State (line 14) | class State
class History (line 16) | class History : public Configurable
FILE: lib/src/import-export.cpp
function toDlyFile (line 32) | void toDlyFile (std::ostream& stream, const Mesh& mesh)
function toDlyFile (line 46) | unsigned int toDlyFile (std::ostream& stream, const SketchNode& node, un...
function toDlyFile (line 60) | void toDlyFile (std::ostream& stream, const SketchPath& path)
function toDlyFile (line 75) | void toDlyFile (std::ostream& stream, const SketchMesh& mesh)
type ImportExport (line 94) | namespace ImportExport
function toDlyFile (line 96) | void toDlyFile (std::ostream& stream, Scene& scene, bool isObjFile)
function toDlyFile (line 109) | bool toDlyFile (const std::string& fileName, Scene& scene, bool isObjF...
function fromDlyFile (line 125) | bool fromDlyFile (std::istream& stream, const Config& config, Scene& s...
function fromDlyFile (line 350) | bool fromDlyFile (const std::string& fileName, const Config& config, S...
FILE: lib/src/import-export.hpp
class Config (line 11) | class Config
class Scene (line 12) | class Scene
type ImportExport (line 14) | namespace ImportExport
FILE: lib/src/intersection.cpp
function Intersection (line 55) | Intersection& Intersection::min (Intersection& a, Intersection& b)
function intersectsQuadric (line 77) | bool intersectsQuadric (float a, float b, float c, bool alongLine, float...
FILE: lib/src/intersection.hpp
class PrimAABox (line 10) | class PrimAABox
class PrimCone (line 11) | class PrimCone
class PrimCylinder (line 12) | class PrimCylinder
class PrimPlane (line 13) | class PrimPlane
class PrimRay (line 14) | class PrimRay
class PrimSphere (line 15) | class PrimSphere
class PrimTriangle (line 16) | class PrimTriangle
class Intersection (line 18) | class Intersection
type IntersectionUtil (line 41) | namespace IntersectionUtil
FILE: lib/src/isosurface-extraction.cpp
type Parameters (line 28) | struct Parameters
method Parameters (line 34) | Parameters (const DistanceCallback& d, const IntersectionCallback* i, ...
function sampleDistancesThread (line 43) | void sampleDistancesThread (Parameters& params, unsigned int numThreads,...
function sampleDistances (line 90) | void sampleDistances (Parameters& params)
function sampleIntersectionsThread (line 105) | void sampleIntersectionsThread (Parameters& params, unsigned int numThre...
function sampleIntersections (line 168) | void sampleIntersections (Parameters& params)
function isIntersecting (line 183) | bool isIntersecting (float s1, float s2)
function markSamplePositions (line 188) | void markSamplePositions (Parameters& params)
FILE: lib/src/isosurface-extraction.hpp
class DynamicMesh (line 11) | class DynamicMesh
class Intersection (line 12) | class Intersection
class PrimAABox (line 13) | class PrimAABox
class PrimRay (line 14) | class PrimRay
type IsosurfaceExtraction (line 16) | namespace IsosurfaceExtraction
type Intersection (line 18) | enum class Intersection
FILE: lib/src/isosurface-extraction/grid.cpp
function numVertices (line 314) | unsigned char numVertices (unsigned char configuration)
function isIntersecting (line 324) | bool isIntersecting (float s1, float s2)
type Cube (line 329) | struct Cube
method Cube (line 337) | Cube ()
method nonManifoldConfig (line 345) | bool nonManifoldConfig () const { return ::nonManifoldConfig[this->con...
method collapseNonManifoldConfig (line 347) | bool collapseNonManifoldConfig () const
method vertexIndex (line 352) | unsigned int vertexIndex (unsigned char edge) const
method getAmbiguousFaceOfNonManifoldConfig (line 367) | unsigned char getAmbiguousFaceOfNonManifoldConfig () const
type IsosurfaceExtractionGrid::Impl (line 396) | struct IsosurfaceExtractionGrid::Impl
method Impl (line 406) | Impl (const PrimAABox& bounds, float r)
method samplePos (line 424) | glm::vec3 samplePos (unsigned int x, unsigned int y, unsigned int z) c...
method samplePos (line 434) | glm::vec3 samplePos (unsigned int i) const
method sampleIndex (line 448) | unsigned int sampleIndex (unsigned int x, unsigned int y, unsigned int...
method sampleIndex (line 453) | unsigned int sampleIndex (unsigned int cubeIndex, unsigned char vertex...
method cubeIndex (line 488) | unsigned int cubeIndex (unsigned int x, unsigned int y, unsigned int z...
method cubeVertexIndex (line 493) | unsigned int cubeVertexIndex (unsigned int cubeIndex, unsigned char ed...
method setCubeVertex (line 498) | void setCubeVertex (unsigned int cubeIndex)
method setCubeVertices (line 580) | void setCubeVertices ()
method hasAmbiguousNeighbor (line 635) | bool hasAmbiguousNeighbor (const Cube& cube, unsigned int x, unsigned ...
method resolveNonManifold (line 664) | void resolveNonManifold (unsigned int x, unsigned int y, unsigned int z)
method resolveNonManifolds (line 690) | void resolveNonManifolds ()
method addCubeVerticesToMesh (line 704) | void addCubeVerticesToMesh (Cube& cube, DynamicMesh& mesh)
method addQuadToMesh (line 721) | void addQuadToMesh (DynamicMesh& mesh, unsigned int i, unsigned int iu...
method makeFaces (line 737) | void makeFaces (DynamicMesh& mesh, unsigned char edge, unsigned int x,...
method makeFaces (line 785) | void makeFaces (DynamicMesh& mesh, unsigned int x, unsigned int y, uns...
method makeMesh (line 801) | void makeMesh (DynamicMesh& mesh)
FILE: lib/src/isosurface-extraction/grid.hpp
class DynamicMesh (line 12) | class DynamicMesh
class PrimAABox (line 13) | class PrimAABox
class IsosurfaceExtractionGrid (line 15) | class IsosurfaceExtractionGrid
FILE: lib/src/kvstore.cpp
type KVStore::Impl (line 16) | struct KVStore::Impl
method Impl (line 24) | Impl (const std::string& r)
method path (line 30) | std::string path (const std::string& suffix) const
method T (line 45) | const T& get (const std::string& p) const
method T (line 59) | const T& get (const std::string& p, const T& defaultV) const
method set (line 73) | void set (const std::string& p, const T& t)
method fromFile (line 82) | void fromFile (const std::string& fileName)
method loadNode (line 115) | void loadNode (const QString& prefix, QDomNode& node)
method loadElement (line 171) | bool loadElement (const QString& prefix, QDomElement& element)
method toFile (line 191) | void toFile (const std::string& fileName) const
method appendAsDomChild (line 221) | void appendAsDomChild (QDomDocument& doc, QDomNode& parent, QStringLis...
method remove (line 278) | void remove (const std::string& p) { this->map.erase (this->path (p)); }
method reset (line 280) | void reset () { this->map.clear (); }
function T (line 289) | const T& KVStore::get (const std::string& path) const
function T (line 294) | const T& KVStore::get (const std::string& path, const T& defaultV) const
FILE: lib/src/kvstore.hpp
class KVStore (line 11) | class KVStore
FILE: lib/src/log.cpp
function shutdown (line 28) | void shutdown ()
type Log (line 38) | namespace Log
function initialize (line 40) | void initialize (const std::string& path)
function log (line 58) | void log (Log::Level level, const char* file, unsigned int line, const...
FILE: lib/src/log.hpp
type Log (line 10) | namespace Log
type Level (line 12) | enum class Level
FILE: lib/src/maybe.hpp
class Maybe (line 11) | class Maybe
method Maybe (line 17) | Maybe () = default;
method Maybe (line 19) | explicit Maybe (T* v)
method Maybe (line 24) | Maybe (const T& v)
method Maybe (line 29) | Maybe (const Maybe<T>& o)
method Maybe (line 34) | Maybe (Maybe<T>&&) = default;
method Maybe (line 36) | Maybe (std::unique_ptr<T>&& v)
method make (line 41) | static Maybe<T> make (Args&&... args)
method T (line 81) | T& operator* ()
method T (line 87) | const T& operator* () const
method T (line 93) | T* operator-> () { return this->get (); }
method T (line 95) | const T* operator-> () const { return this->get (); }
method T (line 97) | T* get () { return this->value.get (); }
method T (line 99) | const T* get () const { return this->value.get (); }
method T (line 101) | T* release () { return this->value.release (); }
method hasValue (line 103) | bool hasValue () const { return bool(this->value); }
method reset (line 105) | void reset (T* newValue = nullptr) { this->value.reset (newValue); }
method swap (line 107) | void swap (Maybe<T>& o) { this->value.swap (o.value); }
FILE: lib/src/mesh-util.cpp
type VertexCache (line 22) | struct VertexCache
method lookup (line 28) | unsigned int lookup (unsigned int i1, unsigned int i2, const MakeNewVe...
type EdgeMap (line 46) | struct EdgeMap
method EdgeMap (line 48) | EdgeMap (unsigned int numVertices) { this->elements.resize (numVertice...
method add (line 65) | void add (unsigned int i1, unsigned int i2, const unsigned int& element)
method increase (line 80) | void increase (unsigned int i1, unsigned int i2)
function Mesh (line 118) | Mesh& withDefaultNormals (Mesh& mesh)
function Mesh (line 146) | Mesh MeshUtil::cube (unsigned int numSubdivisions)
function Mesh (line 239) | Mesh MeshUtil::sphere (unsigned int rings, unsigned int sectors)
function Mesh (line 292) | Mesh MeshUtil::icosphere (unsigned int numSubdivisions)
function Mesh (line 371) | Mesh MeshUtil::cone (unsigned int numBaseVertices)
function Mesh (line 396) | Mesh MeshUtil::cylinder (unsigned int numVertices)
function Mesh (line 429) | Mesh MeshUtil::mirrorPositive (const Mesh& mesh, const PrimPlane& plane)
FILE: lib/src/mesh-util.hpp
class Mesh (line 8) | class Mesh
class PrimPlane (line 9) | class PrimPlane
type MeshUtil (line 11) | namespace MeshUtil
FILE: lib/src/mesh.cpp
type BufferedData (line 23) | struct BufferedData
method BufferedData (line 31) | BufferedData () { this->reset (); }
method reset (line 33) | void reset ()
method resetBounds (line 41) | void resetBounds ()
method numElements (line 47) | unsigned int numElements () const { return this->data.size (); }
method reserve (line 49) | void reserve (unsigned int size) { this->data.reserve (size); }
method shrink (line 51) | void shrink (unsigned int n)
method updateBounds (line 59) | void updateBounds (unsigned int index)
method add (line 65) | unsigned int add (const T& value)
method set (line 72) | void set (unsigned int index, const T& value)
method T (line 79) | const T& get (unsigned int index) const
method bufferData (line 85) | void bufferData (unsigned int target)
type Mesh::Impl (line 121) | struct Mesh::Impl
method Impl (line 135) | Impl ()
method numVertices (line 145) | unsigned int numVertices () const { return this->vertices.numElements ...
method numIndices (line 147) | unsigned int numIndices () const { return this->indices.numElements (); }
method index (line 151) | unsigned int index (unsigned int i) const { return this->indices.get (...
method copyNonGeometry (line 155) | void copyNonGeometry (const Mesh& source)
method addIndex (line 165) | unsigned int addIndex (unsigned int i) { return this->indices.add (i); }
method reserveIndices (line 167) | void reserveIndices (unsigned int n) { this->indices.reserve (n); }
method shrinkIndices (line 169) | void shrinkIndices (unsigned int n) { this->indices.shrink (n); }
method addVertex (line 171) | unsigned int addVertex (const glm::vec3& v) { return this->addVertex (...
method addVertex (line 173) | unsigned int addVertex (const glm::vec3& v, const glm::vec3& n)
method reserveVertices (line 183) | void reserveVertices (unsigned int n)
method shrinkVertices (line 189) | void shrinkVertices (unsigned int n)
method index (line 195) | void index (unsigned int i, unsigned int index) { this->indices.set (i...
method vertex (line 197) | void vertex (unsigned int i, const glm::vec3& v)
method normal (line 203) | void normal (unsigned int i, const glm::vec3& n)
method bufferData (line 209) | void bufferData ()
method modelMatrix (line 219) | glm::mat4x4 modelMatrix () const
method modelNormalMatrix (line 224) | glm::mat3x3 modelNormalMatrix () const
method setModelMatrix (line 229) | void setModelMatrix (Camera& camera, bool noZoom) const
method renderBegin (line 234) | void renderBegin (Camera& camera) const
method renderEnd (line 272) | void renderEnd () const
method render (line 281) | void render (Camera& camera) const
method renderLines (line 302) | void renderLines (Camera& camera) const
method reset (line 309) | void reset ()
method resetGeometry (line 317) | void resetGeometry ()
method scale (line 324) | void scale (const glm::vec3& v) { this->scalingMatrix = glm::scale (th...
method scaling (line 326) | void scaling (const glm::vec3& v) { this->scalingMatrix = glm::scale (...
method scaling (line 328) | glm::vec3 scaling () const
method translate (line 334) | void translate (const glm::vec3& v)
method position (line 339) | void position (const glm::vec3& v)
method position (line 344) | glm::vec3 position () const
method rotation (line 350) | void rotation (const glm::vec3& axis, float angle)
method rotationX (line 355) | void rotationX (float angle) { this->rotation (glm::vec3 (1.0f, 0.0f, ...
method rotationY (line 357) | void rotationY (float angle) { this->rotation (glm::vec3 (0.0f, 1.0f, ...
method rotationZ (line 359) | void rotationZ (float angle) { this->rotation (glm::vec3 (0.0f, 0.0f, ...
method rotate (line 361) | void rotate (const glm::mat4x4& matrix) { this->rotationMatrix = matri...
method rotate (line 363) | void rotate (const glm::vec3& axis, float angle)
method rotateX (line 368) | void rotateX (float angle) { this->rotate (glm::vec3 (1.0f, 0.0f, 0.0f...
method rotateY (line 370) | void rotateY (float angle) { this->rotate (glm::vec3 (0.0f, 1.0f, 0.0f...
method rotateZ (line 372) | void rotateZ (float angle) { this->rotate (glm::vec3 (0.0f, 0.0f, 1.0f...
method normalize (line 374) | void normalize ()
method PrimAABox (line 392) | PrimAABox bounds () const
FILE: lib/src/mesh.hpp
class Camera (line 11) | class Camera
class Color (line 12) | class Color
class PrimAABox (line 13) | class PrimAABox
class RenderFlags (line 14) | class RenderFlags
class RenderMode (line 15) | class RenderMode
class Mesh (line 17) | class Mesh
FILE: lib/src/mirror.cpp
type Mirror::Impl (line 16) | struct Mirror::Impl
method Impl (line 23) | Impl (const Config& config, Dimension d)
method Dimension (line 35) | Dimension dimension () const { return this->_dimension; }
method dimension (line 37) | void dimension (Dimension d)
method position (line 43) | void position (const glm::vec3& p)
method PrimPlane (line 50) | const PrimPlane& plane () const { return *this->_plane; }
method render (line 52) | void render (Camera& camera) const
method updateMesh (line 106) | void updateMesh ()
method runFromConfig (line 126) | void runFromConfig (const Config& config)
FILE: lib/src/mirror.hpp
class Camera (line 12) | class Camera
type Dimension (line 13) | enum class Dimension
class PrimPlane (line 14) | class PrimPlane
class Mirror (line 16) | class Mirror : public Configurable
FILE: lib/src/opengl-buffer-id.cpp
function OpenGLBufferId (line 23) | const OpenGLBufferId& OpenGLBufferId::operator= (const OpenGLBufferId&) ...
function OpenGLBufferId (line 25) | const OpenGLBufferId& OpenGLBufferId::operator= (OpenGLBufferId&& other)
FILE: lib/src/opengl-buffer-id.hpp
class OpenGLBufferId (line 10) | class OpenGLBufferId
FILE: lib/src/opengl.cpp
type OpenGL (line 36) | namespace OpenGL
function setDefaultFormat (line 45) | void setDefaultFormat ()
function initializeFunctions (line 58) | void initializeFunctions (bool initGeometryShader)
function glUniformVec3 (line 165) | void glUniformVec3 (unsigned int id, const glm::vec3& v) { fun->glUnif...
function glUniformVec4 (line 166) | void glUniformVec4 (unsigned int id, const glm::vec4& v)
function safeDeleteBuffer (line 171) | void safeDeleteBuffer (unsigned int& id)
function safeDeleteShader (line 180) | void safeDeleteShader (unsigned int& id)
function safeDeleteProgram (line 189) | void safeDeleteProgram (unsigned int& id)
function loadProgram (line 207) | unsigned int loadProgram (const char* vertexShader, const char* fragme...
function clearError (line 276) | void clearError () { fun->glGetError (); }
function printError (line 278) | void printError ()
FILE: lib/src/opengl.hpp
type OpenGL (line 11) | namespace OpenGL
type VertexAttributIndex (line 92) | enum VertexAttributIndex
FILE: lib/src/primitive/aabox.hpp
class PrimAABox (line 10) | class PrimAABox
FILE: lib/src/primitive/cone-sphere.cpp
function PrimCone (line 34) | PrimCone PrimConeSphere::toCone () const
FILE: lib/src/primitive/cone-sphere.hpp
class PrimCone (line 11) | class PrimCone
class PrimConeSphere (line 13) | class PrimConeSphere
method PrimSphere (line 18) | const PrimSphere& sphere1 () const { return this->_sphere1; }
method PrimSphere (line 20) | const PrimSphere& sphere2 () const { return this->_sphere2; }
method length (line 22) | float length () const { return this->_length; }
method alpha (line 26) | float alpha () const { return this->_alpha; }
method sinAlpha (line 28) | float sinAlpha () const { return this->_sinAlpha; }
method cosAlpha (line 30) | float cosAlpha () const { return this->_cosAlpha; }
FILE: lib/src/primitive/cone.hpp
class PrimCone (line 10) | class PrimCone
method radius1 (line 17) | float radius1 () const { return this->_radius1; }
method radius2 (line 19) | float radius2 () const { return this->_radius2; }
method length (line 20) | float length () const { return this->_length; }
method isCylinder (line 22) | bool isCylinder () const { return this->_isCylinder; }
method alpha (line 24) | float alpha () const { return this->_alpha; }
method sinAlpha (line 25) | float sinAlpha () const { return this->_sinAlpha; }
method cosAlpha (line 26) | float cosAlpha () const { return this->_cosAlpha; }
FILE: lib/src/primitive/cylinder.hpp
class PrimCone (line 10) | class PrimCone
class PrimCylinder (line 12) | class PrimCylinder
method radius (line 21) | float radius () const { return this->_radius; }
method length (line 22) | float length () const { return this->_length; }
FILE: lib/src/primitive/plane.hpp
class PrimPlane (line 11) | class PrimPlane
FILE: lib/src/primitive/ray.hpp
class PrimRay (line 10) | class PrimRay
method isLine (line 16) | bool isLine () const { return this->_isLine; }
method origin (line 20) | void origin (const glm::vec3& o) { this->_origin = o; }
FILE: lib/src/primitive/sphere.hpp
class PrimAABox (line 10) | class PrimAABox
class PrimTriangle (line 11) | class PrimTriangle
class PrimSphere (line 13) | class PrimSphere
method radius (line 19) | float radius () const { return this->_radius; }
method center (line 21) | void center (const glm::vec3& c) { this->_center = c; }
method radius (line 22) | void radius (float r) { this->_radius = r; }
FILE: lib/src/primitive/triangle.hpp
class PrimTriangle (line 10) | class PrimTriangle
FILE: lib/src/render-mode.hpp
class RenderMode (line 10) | class RenderMode
FILE: lib/src/renderer.cpp
type LightIds (line 17) | struct LightIds
method LightIds (line 23) | LightIds ()
type ShaderIds (line 31) | struct ShaderIds
method ShaderIds (line 44) | ShaderIds ()
type GlobalLightUniforms (line 58) | struct GlobalLightUniforms
type GlobalUniforms (line 65) | struct GlobalUniforms
type Renderer::Impl (line 72) | struct Renderer::Impl
method Impl (line 81) | Impl (const Config& config)
method setupRendering (line 95) | void setupRendering ()
method shutdownRendering (line 108) | void shutdownRendering ()
method shaderIndex (line 114) | unsigned int shaderIndex (const RenderMode& renderMode)
method initalizeProgram (line 134) | void initalizeProgram (const RenderMode& renderMode)
method setProgram (line 163) | void setProgram (const RenderMode& renderMode)
method setModel (line 189) | void setModel (const float* model, const float* modelNormal)
method setView (line 196) | void setView (const float* view)
method setProjection (line 202) | void setProjection (const float* projection)
method setColor (line 208) | void setColor (const Color& c, bool withOpacity)
method setWireframeColor (line 222) | void setWireframeColor (const Color& c, bool withOpacity)
method setEyePoint (line 236) | void setEyePoint (const glm::vec3& e) { this->globalUniforms.eyePoint ...
method setLightDirection (line 238) | void setLightDirection (unsigned int i, const glm::vec3& d)
method setLightColor (line 244) | void setLightColor (unsigned int i, const Color& c)
method setLightIrradiance (line 250) | void setLightIrradiance (unsigned int i, float irr)
method runFromConfig (line 256) | void runFromConfig (const Config& config)
FILE: lib/src/renderer.hpp
class Color (line 12) | class Color
class Config (line 13) | class Config
class RenderMode (line 14) | class RenderMode
class Renderer (line 16) | class Renderer : public Configurable
FILE: lib/src/scene.cpp
type Scene::Impl (line 20) | struct Scene::Impl
method Impl (line 28) | Impl (Scene* s, const Config& config)
method DynamicMesh (line 36) | DynamicMesh& newDynamicMesh (const Config& config, const DynamicMesh& ...
method DynamicMesh (line 43) | DynamicMesh& newDynamicMesh (const Config& config, const Mesh& mesh)
method SketchMesh (line 50) | SketchMesh& newSketchMesh (const Config& config, const SketchMesh& other)
method SketchMesh (line 57) | SketchMesh& newSketchMesh (const Config& config, const SketchTree& tree)
method setupMesh (line 65) | void setupMesh (const Config& config, DynamicMesh& mesh)
method setupMesh (line 72) | void setupMesh (const Config& config, SketchMesh& mesh)
method deleteMesh (line 78) | void deleteMesh (DynamicMesh& mesh)
method deleteMesh (line 92) | void deleteMesh (SketchMesh& mesh)
method deleteDynamicMeshes (line 106) | void deleteDynamicMeshes () { this->dynamicMeshes.clear (); }
method deleteSketchMeshes (line 108) | void deleteSketchMeshes () { this->sketchMeshes.clear (); }
method deleteEmptyMeshes (line 110) | void deleteEmptyMeshes ()
method render (line 117) | void render (Camera& camera)
method intersectsT (line 124) | bool intersectsT (const PrimRay& ray, TIntersection& intersection, Ts....
method intersects (line 132) | bool intersects (const PrimRay& ray, DynamicMeshIntersection& intersec...
method intersects (line 137) | bool intersects (const PrimRay& ray, SketchNodeIntersection& intersect...
method intersects (line 143) | bool intersects (const PrimRay& ray, SketchBoneIntersection& intersect...
method intersects (line 148) | bool intersects (const PrimRay& ray, SketchMeshIntersection& intersect...
method intersects (line 153) | bool intersects (const PrimRay& ray, SketchMeshIntersection& intersect...
method intersects (line 159) | bool intersects (const PrimRay& ray, SketchPathIntersection& intersect...
method intersects (line 164) | bool intersects (const PrimRay& ray, Intersection& intersection)
method printStatistics (line 182) | void printStatistics () const
method forEachMeshT (line 187) | void forEachMeshT (std::list<T>& list, const std::function<void(T&)>& f)
method forEachConstMeshT (line 207) | void forEachConstMeshT (const std::list<T>& list, const std::function<...
method forEachMesh (line 226) | void forEachMesh (const std::function<void(DynamicMesh&)>& f)
method forEachMesh (line 231) | void forEachMesh (const std::function<void(SketchMesh&)>& f)
method forEachConstMesh (line 236) | void forEachConstMesh (const std::function<void(const DynamicMesh&)>& ...
method forEachConstMesh (line 241) | void forEachConstMesh (const std::function<void(const SketchMesh&)>& f...
method sanitizeMeshes (line 246) | void sanitizeMeshes ()
method reset (line 251) | void reset ()
method resetIfEmpty (line 258) | void resetIfEmpty ()
method setCommonRenderMode (line 266) | void setCommonRenderMode (const RenderMode& mode)
method renderWireframe (line 274) | bool renderWireframe () const { return this->commonRenderMode.renderWi...
method renderWireframe (line 276) | void renderWireframe (bool value)
method toggleWireframe (line 282) | void toggleWireframe () { this->renderWireframe (!this->commonRenderMo...
method toggleShading (line 284) | void toggleShading ()
method isEmpty (line 297) | bool isEmpty () const { return this->numDynamicMeshes () == 0 && this-...
method numDynamicMeshes (line 299) | unsigned int numDynamicMeshes () const { return this->dynamicMeshes.si...
method numSketchMeshes (line 301) | unsigned int numSketchMeshes () const { return this->sketchMeshes.size...
method numFaces (line 303) | unsigned int numFaces () const
method hasFileName (line 310) | bool hasFileName () const { return !this->fileName.empty (); }
method toDlyFile (line 312) | bool toDlyFile (bool isObjFile)
method toDlyFile (line 329) | bool toDlyFile (const std::string& newFileName, bool isObjFile)
method fromDlyFile (line 335) | bool fromDlyFile (const Config& config, const std::string& newFileName)
method runFromConfig (line 350) | void runFromConfig (const Config& config)
FILE: lib/src/scene.hpp
class Camera (line 13) | class Camera
class DynamicMesh (line 14) | class DynamicMesh
class DynamicMeshIntersection (line 15) | class DynamicMeshIntersection
class Intersection (line 16) | class Intersection
class Mesh (line 17) | class Mesh
class PrimRay (line 18) | class PrimRay
class RenderMode (line 19) | class RenderMode
class Scene (line 21) | class Scene : public Configurable
FILE: lib/src/shader.hpp
type Shader (line 8) | namespace Shader
FILE: lib/src/sketch/bone-intersection.cpp
function SketchNode (line 30) | SketchNode& SketchBoneIntersection::parent () const
function SketchNode (line 37) | SketchNode& SketchBoneIntersection::child () const
FILE: lib/src/sketch/bone-intersection.hpp
class SketchBoneIntersection (line 11) | class SketchBoneIntersection : public SketchMeshIntersection
FILE: lib/src/sketch/fwd.hpp
class SketchPath (line 11) | class SketchPath
class SketchNodeIntersection (line 13) | class SketchNodeIntersection
class SketchBoneIntersection (line 14) | class SketchBoneIntersection
class SketchMeshIntersection (line 15) | class SketchMeshIntersection
class SketchPathIntersection (line 16) | class SketchPathIntersection
class SketchMesh (line 19) | class SketchMesh
FILE: lib/src/sketch/mesh-intersection.cpp
function SketchMesh (line 27) | SketchMesh& SketchMeshIntersection::mesh () const
FILE: lib/src/sketch/mesh-intersection.hpp
class SketchMeshIntersection (line 11) | class SketchMeshIntersection : public Intersection
FILE: lib/src/sketch/mesh.cpp
type RenderConfig (line 29) | struct RenderConfig
method RenderConfig (line 36) | RenderConfig ()
function almostEqual (line 42) | bool almostEqual (const glm::vec3& a, const glm::vec3& b)
class PrimSphereIntersection (line 47) | class PrimSphereIntersection : public Intersection
method PrimSphereIntersection (line 50) | PrimSphereIntersection ()
method update (line 55) | bool update (float d, const PrimSphere& s)
method PrimSphere (line 68) | const PrimSphere& sphere ()
type SketchMesh::Impl (line 79) | struct SketchMesh::Impl
method Impl (line 88) | Impl (SketchMesh* s)
method Impl (line 101) | Impl (const Impl& other)
method isEmpty (line 113) | bool isEmpty () const { return this->tree.hasRoot () == false && this-...
method fromTree (line 115) | void fromTree (const SketchTree& newTree) { this->tree = newTree; }
method reset (line 117) | void reset () { this->tree.reset (); }
method intersects (line 119) | bool intersects (const PrimRay& ray, SketchNodeIntersection& intersect...
method intersects (line 137) | bool intersects (const PrimRay& ray, SketchBoneIntersection& intersect...
method intersects (line 165) | bool intersects (const PrimRay& ray, SketchMeshIntersection& intersect...
method intersects (line 196) | bool intersects (const PrimRay& ray, SketchPathIntersection& intersect...
method intersects (line 205) | bool intersects (const glm::vec3& point, PrimSphereIntersection& inter...
method renderTree (line 292) | void renderTree (Camera& camera)
method renderPaths (line 356) | void renderPaths (Camera& camera)
method render (line 366) | void render (Camera& camera)
method renderWireframe (line 376) | void renderWireframe (bool v) { this->renderConfig.renderWireframe = v; }
method PrimPlane (line 378) | PrimPlane mirrorPlane (Dimension dim) const
method SketchNode (line 390) | SketchNode* mirrored (const SketchNode& node, const PrimPlane& mirrorP...
method SketchPath (line 412) | SketchPath* mirrored (const SketchPath& path)
method SketchNode (line 433) | SketchNode* addMirroredNode (SketchNode& node, const PrimPlane& mirror...
method SketchNode (line 451) | SketchNode& addChild (SketchNode& parent, const glm::vec3& pos, float ...
method SketchNode (line 463) | SketchNode& addParent (SketchNode& child, const glm::vec3& pos, float ...
method SketchPath (line 490) | SketchPath& addPath (const SketchPath& path)
method addSphere (line 496) | void addSphere (bool newPath, const glm::vec3& intersection, const glm...
method move (line 518) | void move (SketchNode& node, const glm::vec3& delta, bool all, const D...
method scale (line 550) | void scale (SketchNode& node, float factor, bool all, const Dimension*...
method rotate (line 581) | void rotate (SketchNode& node, const glm::vec3& axis, float angle, con...
method deleteNode (line 609) | void deleteNode (SketchNode& node, bool deleteChildren, const Dimensio...
method deletePath (line 648) | void deletePath (SketchPath& path, const Dimension* dim)
method mirrorPositiveTree (line 687) | void mirrorPositiveTree (Dimension dim)
method mirrorPositivePaths (line 726) | void mirrorPositivePaths (Dimension dim)
method mirrorPositive (line 745) | void mirrorPositive (Dimension dim)
method rebalance (line 751) | void rebalance (SketchNode& newRoot)
method SketchNode (line 757) | SketchNode& snap (SketchNode& node, Dimension dim)
method minMax (line 790) | void minMax (glm::vec3& min, glm::vec3& max) const
method smoothPath (line 809) | void smoothPath (SketchPath& path, const PrimSphere& range, unsigned i...
method optimizePaths (line 842) | void optimizePaths ()
method runFromConfig (line 909) | void runFromConfig (const Config& config)
FILE: lib/src/sketch/mesh.hpp
class Camera (line 13) | class Camera
type Dimension (line 14) | enum class Dimension
class PrimPlane (line 15) | class PrimPlane
class PrimRay (line 16) | class PrimRay
class PrimSphere (line 17) | class PrimSphere
type SketchPathSmoothEffect (line 18) | enum class SketchPathSmoothEffect
class SketchMesh (line 20) | class SketchMesh : public Configurable
FILE: lib/src/sketch/node-intersection.cpp
function SketchNode (line 27) | SketchNode& SketchNodeIntersection::node () const
FILE: lib/src/sketch/node-intersection.hpp
class SketchNodeIntersection (line 11) | class SketchNodeIntersection : public SketchMeshIntersection
FILE: lib/src/sketch/path-intersection.cpp
function SketchPath (line 27) | SketchPath& SketchPathIntersection::path () const
FILE: lib/src/sketch/path-intersection.hpp
class SketchPathIntersection (line 11) | class SketchPathIntersection : public SketchMeshIntersection
FILE: lib/src/sketch/path.cpp
type SketchPath::Impl (line 10) | struct SketchPath::Impl
method Impl (line 19) | Impl (SketchPath* s)
method resetMinMax (line 25) | void resetMinMax ()
method reset (line 31) | void reset ()
method setMinMax (line 37) | void setMinMax ()
method isEmpty (line 48) | bool isEmpty () const { return this->spheres.empty (); }
method PrimAABox (line 50) | PrimAABox aabox () const
method addSphere (line 56) | void addSphere (const glm::vec3& intersection, const glm::vec3& positi...
method deleteSphere (line 73) | SketchPath::Spheres::iterator deleteSphere (SketchPath::Spheres::const...
method render (line 78) | void render (Camera& camera, Mesh& mesh) const
method intersects (line 88) | bool intersects (const PrimRay& ray, SketchMesh& mesh, SketchPathInter...
method SketchPath (line 109) | SketchPath mirrorPositive (const PrimPlane& mPlane)
method smooth (line 145) | void smooth (const PrimSphere& range, unsigned int halfWidth, SketchPa...
FILE: lib/src/sketch/path.hpp
class Camera (line 12) | class Camera
class Intersection (line 13) | class Intersection
class Mesh (line 14) | class Mesh
class PrimAABox (line 15) | class PrimAABox
class PrimPlane (line 16) | class PrimPlane
class PrimRay (line 17) | class PrimRay
type SketchPathSmoothEffect (line 19) | enum class SketchPathSmoothEffect
class SketchPath (line 27) | class SketchPath
FILE: lib/src/state.cpp
type State::Impl (line 30) | struct State::Impl
method Impl (line 43) | Impl (State* s, ViewMainWindow& mW, Config& cfg, Cache& cch)
method hasTool (line 55) | bool hasTool () const { return bool(this->toolPtr); }
method Tool (line 57) | Tool& tool ()
method addToolShortcut (line 63) | void addToolShortcut (const ViewShortcut& shortcut, ViewToolTip& tip)
method addToolShortcut (line 69) | void addToolShortcut (ToolKey key, ViewToolTip& tip, ViewInputEvent ev...
method addToolShortcut (line 80) | void addToolShortcut (ToolKey key, ViewToolTip& tip, ViewInputEvent ev...
method addToggleToolShortcut (line 85) | void addToggleToolShortcut (ViewToolTip& tip, ViewInputEvent event)
method addExitToolShortcut (line 96) | void addExitToolShortcut (ViewToolTip& tip, ViewInputEvent event)
method setToolTip (line 120) | void setToolTip (const ViewToolTip* toolSpecificToolTip, const ViewSho...
method setToolTip (line 217) | void setToolTip (const ViewToolTip* toolSpecificToolTip)
method setTool (line 222) | void setTool (ToolKey key)
method setPreviousTool (line 269) | void setPreviousTool ()
method resetTool (line 281) | void resetTool ()
method fromConfig (line 299) | void fromConfig ()
method undo (line 311) | void undo ()
method redo (line 321) | void redo ()
method handleToolResponse (line 331) | void handleToolResponse (ToolResponse response)
FILE: lib/src/state.hpp
class Cache (line 11) | class Cache
class Camera (line 12) | class Camera
class Config (line 13) | class Config
class History (line 14) | class History
class Id (line 15) | class Id
class Mesh (line 16) | class Mesh
class Scene (line 17) | class Scene
class Tool (line 18) | class Tool
type ToolKey (line 19) | enum class ToolKey
type ToolResponse (line 20) | enum class ToolResponse
class ViewMainWindow (line 21) | class ViewMainWindow
class ViewShortcut (line 22) | class ViewShortcut
class ViewToolTip (line 23) | class ViewToolTip
class State (line 25) | class State
FILE: lib/src/time-delta.cpp
type TimeDelta (line 11) | namespace TimeDelta
type TimeData (line 13) | struct TimeData
method TimeData (line 18) | TimeData (std::clock_t c)
method call (line 24) | void call (std::clock_t c)
function printResults (line 36) | void printResults ()
function initialize (line 60) | void initialize ()
function resetTimer (line 66) | void resetTimer () { startTime = std::clock (); }
function addBreakpoint (line 67) | void addBreakpoint (const char* name)
FILE: lib/src/time-delta.hpp
type TimeDelta (line 13) | namespace TimeDelta
FILE: lib/src/tool.cpp
type Tool::Impl (line 33) | struct Tool::Impl
method Impl (line 44) | Impl (Tool* s, State& st, const char* cacheKey)
method ToolResponse (line 54) | ToolResponse initialize ()
method render (line 66) | void render () const
method paint (line 75) | void paint (QPainter& painter) const { this->self->runPaint (painter); }
method keyEvent (line 77) | void keyEvent (const ViewKeyEvent& e)
method ToolResponse (line 86) | ToolResponse pointingEvent (const ViewPointingEvent& e)
method ToolResponse (line 104) | ToolResponse cursorUpdate (const glm::ivec2& pos) { return this->self-...
method ToolResponse (line 106) | ToolResponse commit () { return this->self->runCommit (); }
method fromConfig (line 108) | void fromConfig ()
method updateGlWidget (line 117) | void updateGlWidget () { this->state.mainWindow ().glWidget ().update ...
method ViewTwoColumnGrid (line 119) | ViewTwoColumnGrid& properties () const
method Config (line 124) | Config& config () const { return this->state.config (); }
method CacheProxy (line 126) | CacheProxy& cache () { return this->_cache; }
method CacheProxy (line 128) | CacheProxy cache (const char* key) const
method cursorPosition (line 133) | glm::ivec2 cursorPosition () { return this->state.mainWindow ().glWidg...
method snapshotAll (line 135) | void snapshotAll () { this->state.history ().snapshotAll (this->state....
method snapshotDynamicMeshes (line 137) | void snapshotDynamicMeshes ()
method snapshotSketchMeshes (line 142) | void snapshotSketchMeshes ()
method intersectsRecentDynamicMesh (line 147) | bool intersectsRecentDynamicMesh (const PrimRay& ray, Intersection& in...
method intersectsRecentDynamicMesh (line 156) | bool intersectsRecentDynamicMesh (const glm::ivec2& pos, Intersection&...
method supportsMirror (line 161) | void supportsMirror ()
method mirrorEnabled (line 168) | bool mirrorEnabled () const
method mirrorPosition (line 173) | void mirrorPosition (const glm::vec3& p)
method mirrorDefaultPosition (line 179) | void mirrorDefaultPosition ()
method Mirror (line 201) | const Mirror& mirror () const
method Dimension (line 207) | const Dimension* mirrorDimension () const
method mirrorDynamicMeshes (line 214) | void mirrorDynamicMeshes ()
method mirrorSketchMeshes (line 228) | void mirrorSketchMeshes ()
method addMirrorProperties (line 237) | void addMirrorProperties ()
method enableMirrorProperties (line 266) | void enableMirrorProperties (bool state)
method addMoveOnPrimaryPlaneProperties (line 275) | void addMoveOnPrimaryPlaneProperties (ToolUtilMovement& movement)
method onKeymap (line 289) | bool onKeymap (char c) const
method intersectsScene (line 303) | bool intersectsScene (const PrimRay& ray, T& intersection, Ts... args)
method intersectsScene (line 309) | bool intersectsScene (const glm::ivec2& pos, T& intersection, Ts... args)
method intersectsScene (line 316) | bool intersectsScene (const ViewPointingEvent& e, T& intersection, Ts....
method ToolResponse (line 321) | ToolResponse runPointingEvent (const ViewPointingEvent& e)
FILE: lib/src/tool.hpp
class CacheProxy (line 13) | class CacheProxy
class Config (line 14) | class Config
type Dimension (line 15) | enum class Dimension
class Intersection (line 16) | class Intersection
class Mirror (line 17) | class Mirror
class PrimRay (line 18) | class PrimRay
class QPainter (line 19) | class QPainter
class QWidget (line 20) | class QWidget
class State (line 21) | class State
class ToolUtilMovement (line 22) | class ToolUtilMovement
class ViewKeyEvent (line 23) | class ViewKeyEvent
class ViewPointingEvent (line 24) | class ViewPointingEvent
class ViewToolTip (line 25) | class ViewToolTip
class ViewTwoColumnGrid (line 26) | class ViewTwoColumnGrid
type ToolResponse (line 28) | enum class ToolResponse
class Tool (line 35) | class Tool
method runInitialize (line 82) | runInitialize () = 0;
method runRender (line 84) | virtual void runRender () const {}
method runPaint (line 86) | virtual void runPaint (QPainter&) const {}
method ToolResponse (line 90) | virtual ToolResponse runPressEvent (const ViewPointingEvent&) { return...
method ToolResponse (line 92) | virtual ToolResponse runMoveEvent (const ViewPointingEvent&) { return ...
method ToolResponse (line 94) | virtual ToolResponse runReleaseEvent (const ViewPointingEvent&) { retu...
method ToolResponse (line 96) | virtual ToolResponse runCursorUpdate (const glm::ivec2&) { return Tool...
method ToolResponse (line 98) | virtual ToolResponse runCommit () { return ToolResponse::None; }
method runFromConfig (line 100) | virtual void runFromConfig () {}
FILE: lib/src/tool/convert-sketch.cpp
type ToolConvertSketch::Impl (line 26) | struct ToolConvertSketch::Impl
method Impl (line 31) | Impl (ToolConvertSketch* s)
method ToolResponse (line 37) | ToolResponse runInitialize ()
method setupProperties (line 45) | void setupProperties ()
method setupToolTip (line 58) | void setupToolTip ()
method DynamicMesh (line 65) | DynamicMesh& convert (SketchMesh& sketch)
method ToolResponse (line 102) | ToolResponse runReleaseEvent (const ViewPointingEvent& e)
FILE: lib/src/tool/delete-mesh.cpp
type ToolDeleteMesh::Impl (line 13) | struct ToolDeleteMesh::Impl
method Impl (line 17) | Impl (ToolDeleteMesh* s)
method ToolResponse (line 22) | ToolResponse runInitialize ()
method ToolResponse (line 31) | ToolResponse runReleaseEvent (const ViewPointingEvent& e)
FILE: lib/src/tool/delete-sketch.cpp
type Mode (line 24) | enum class Mode
type ToolDeleteSketch::Impl (line 32) | struct ToolDeleteSketch::Impl
method Impl (line 38) | Impl (ToolDeleteSketch* s)
method ToolResponse (line 45) | ToolResponse runInitialize ()
method setupProperties (line 55) | void setupProperties ()
method setupToolTip (line 108) | void setupToolTip ()
method ToolResponse (line 115) | ToolResponse runReleaseEvent (const ViewPointingEvent& e)
FILE: lib/src/tool/edit-sketch.cpp
type ToolEditSketch::Impl (line 25) | struct ToolEditSketch::Impl
method Impl (line 39) | Impl (ToolEditSketch* s)
method ToolResponse (line 54) | ToolResponse runInitialize ()
method setupProperties (line 64) | void setupProperties ()
method setupToolTip (line 110) | void setupToolTip ()
method ToolResponse (line 125) | ToolResponse runMoveEvent (const ViewPointingEvent& e)
method ToolResponse (line 170) | ToolResponse runPressEvent (const ViewPointingEvent& e)
method ToolResponse (line 282) | ToolResponse runReleaseEvent (const ViewPointingEvent& e)
method ToolResponse (line 305) | ToolResponse runCommit ()
FILE: lib/src/tool/key.hpp
type ToolKey (line 10) | enum class ToolKey
type std (line 31) | namespace std
type hash<ToolKey> (line 33) | struct hash<ToolKey>
FILE: lib/src/tool/move-camera.cpp
type ToolMoveCamera::Impl (line 20) | struct ToolMoveCamera::Impl
method Impl (line 29) | Impl (ToolMoveCamera* s, bool i)
method Impl (line 36) | Impl (ToolMoveCamera* s)
method ToolResponse (line 41) | ToolResponse runInitialize ()
method setupToolTip (line 50) | void setupToolTip ()
method mouseButton (line 66) | bool mouseButton (const ViewPointingEvent& e)
method ToolResponse (line 71) | ToolResponse runMoveEvent (const ViewPointingEvent& e)
method ToolResponse (line 121) | ToolResponse runPressEvent (const ViewPointingEvent& e)
method runFromConfig (line 136) | void runFromConfig ()
method ToolResponse (line 145) | ToolResponse wheelEvent (const QWheelEvent& e)
method snap (line 166) | void snap ()
method resetGazePoint (line 205) | void resetGazePoint ()
FILE: lib/src/tool/move-camera.hpp
class QWheelEvent (line 10) | class QWheelEvent
class ToolMoveCamera (line 12) | class ToolMoveCamera : public Tool
method ToolKey (line 19) | ToolKey getKey () const { return ToolKey::MoveCamera; }
FILE: lib/src/tool/new-mesh.cpp
type MeshType (line 19) | enum class MeshType
type ToolNewMesh::Impl (line 26) | struct ToolNewMesh::Impl
method Impl (line 33) | Impl (ToolNewMesh* s)
method ToolResponse (line 40) | ToolResponse runInitialize ()
method runRender (line 47) | void runRender () const
method ToolResponse (line 56) | ToolResponse runCommit ()
method setupProperties (line 66) | void setupProperties ()
method makeCurrentMesh (line 88) | void makeCurrentMesh ()
FILE: lib/src/tool/remesh.cpp
type Mode (line 28) | enum class Mode
function Impl (line 44) | Impl (ToolRemesh* s)
function setupProperties (line 51) | void setupProperties ()
function setupToolTip (line 73) | void setupToolTip ()
function ToolResponse (line 80) | ToolResponse runInitialize ()
function ToolResponse (line 88) | ToolResponse runMoveEvent (const ViewPointingEvent&)
function remesh (line 93) | void remesh (DynamicMesh& mesh)
function ToolResponse (line 336) | ToolResponse runPressEvent (const ViewPointingEvent& e)
function ToolResponse (line 349) | ToolResponse runReleaseEvent (const ViewPointingEvent& e)
function runPaint (line 405) | void runPaint (QPainter& painter) const
function ToolResponse (line 420) | ToolResponse runCommit () { return ToolResponse::Redraw; }
FILE: lib/src/tool/sculpt.cpp
type SculptState (line 33) | enum class SculptState
type ToolSculpt::Impl (line 42) | struct ToolSculpt::Impl
method Impl (line 54) | Impl (ToolSculpt* s)
method ToolResponse (line 65) | ToolResponse runInitialize ()
method setupBrush (line 77) | void setupBrush ()
method setupCursor (line 92) | void setupCursor ()
method setupProperties (line 111) | void setupProperties ()
method setupToolTip (line 151) | void setupToolTip ()
method runRender (line 161) | void runRender () const
method ToolResponse (line 171) | ToolResponse runPointingEvent (const ViewPointingEvent& e)
method ToolResponse (line 208) | ToolResponse runCursorUpdate (const glm::ivec2& pos)
method ToolResponse (line 215) | ToolResponse runCommit ()
method runFromConfig (line 227) | void runFromConfig ()
method addDefaultToolTip (line 237) | void addDefaultToolTip (ViewToolTip& toolTip, bool hasInvertedMode, bo...
method sculpt (line 253) | void sculpt ()
method setCursorByIntersection (line 272) | bool setCursorByIntersection (const glm::ivec2& pos, DynamicMeshInters...
method updateBrushByIntersection (line 291) | bool updateBrushByIntersection (bool useRecentMesh, const glm::vec3& c...
method drawlikeStroke (line 335) | bool drawlikeStroke (const ViewPointingEvent& e, bool useRecentMesh,
method grablikeStroke (line 400) | bool grablikeStroke (const ViewPointingEvent& e, ToolUtilMovement& mov...
method registerSecondarySlider (line 462) | void registerSecondarySlider (ViewDoubleSlider& slider) { this->second...
method setRelativeRadius (line 464) | void setRelativeRadius (float distance)
method setRelativeRadius (line 475) | void setRelativeRadius ()
method setAbsoluteRadius (line 481) | void setAbsoluteRadius ()
FILE: lib/src/tool/sculpt.hpp
class QString (line 10) | class QString
class SculptBrush (line 11) | class SculptBrush
class ToolUtilMovement (line 12) | class ToolUtilMovement
class ViewCursor (line 13) | class ViewCursor
class ViewDoubleSlider (line 14) | class ViewDoubleSlider
class ViewTwoColumnGrid (line 15) | class ViewTwoColumnGrid
class ToolSculpt (line 17) | class ToolSculpt : public Tool
FILE: lib/src/tool/sculpt/crease.cpp
type ToolSculptCrease::Impl (line 13) | struct ToolSculptCrease::Impl
method Impl (line 17) | Impl (ToolSculptCrease* s)
method runSetupBrush (line 22) | void runSetupBrush (SculptBrush& brush)
method runSetupCursor (line 30) | void runSetupCursor (ViewCursor&) {}
method runSetupProperties (line 32) | void runSetupProperties (ViewTwoColumnGrid& properties)
method runSetupToolTip (line 52) | void runSetupToolTip (ViewToolTip& toolTip)
method runSculptPointingEvent (line 57) | bool runSculptPointingEvent (const ViewPointingEvent& e)
FILE: lib/src/tool/sculpt/draw.cpp
type ToolSculptDraw::Impl (line 13) | struct ToolSculptDraw::Impl
method Impl (line 17) | Impl (ToolSculptDraw* s)
method runSetupBrush (line 22) | void runSetupBrush (SculptBrush& brush)
method runSetupCursor (line 31) | void runSetupCursor (ViewCursor&) {}
method runSetupProperties (line 33) | void runSetupProperties (ViewTwoColumnGrid& properties)
method runSetupToolTip (line 61) | void runSetupToolTip (ViewToolTip& toolTip)
method runSculptPointingEvent (line 66) | bool runSculptPointingEvent (const ViewPointingEvent& e)
FILE: lib/src/tool/sculpt/flatten.cpp
type ToolSculptFlatten::Impl (line 18) | struct ToolSculptFlatten::Impl
method Impl (line 23) | Impl (ToolSculptFlatten* s)
method runSetupBrush (line 29) | void runSetupBrush (SculptBrush& brush)
method runSetupCursor (line 39) | void runSetupCursor (ViewCursor&) {}
method runSetupProperties (line 41) | void runSetupProperties (ViewTwoColumnGrid& properties)
method runSetupToolTip (line 62) | void runSetupToolTip (ViewToolTip& toolTip)
method runSculptPointingEvent (line 67) | bool runSculptPointingEvent (const ViewPointingEvent& e)
FILE: lib/src/tool/sculpt/grab.cpp
type ToolSculptGrab::Impl (line 15) | struct ToolSculptGrab::Impl
method Impl (line 20) | Impl (ToolSculptGrab* s)
method runSetupBrush (line 26) | void runSetupBrush (SculptBrush& brush)
method runSetupCursor (line 33) | void runSetupCursor (ViewCursor&) {}
method runSetupProperties (line 35) | void runSetupProperties (ViewTwoColumnGrid& properties)
method runSetupToolTip (line 50) | void runSetupToolTip (ViewToolTip& toolTip)
method runSculptPointingEvent (line 55) | bool runSculptPointingEvent (const ViewPointingEvent& e)
FILE: lib/src/tool/sculpt/pinch.cpp
type ToolSculptPinch::Impl (line 12) | struct ToolSculptPinch::Impl
method Impl (line 16) | Impl (ToolSculptPinch* s)
method runSetupBrush (line 21) | void runSetupBrush (SculptBrush& brush)
method runSetupCursor (line 28) | void runSetupCursor (ViewCursor&) {}
method runSetupProperties (line 30) | void runSetupProperties (ViewTwoColumnGrid& properties)
method runSetupToolTip (line 42) | void runSetupToolTip (ViewToolTip& toolTip)
method runSculptPointingEvent (line 47) | bool runSculptPointingEvent (const ViewPointingEvent& e)
FILE: lib/src/tool/sculpt/reduce.cpp
type ToolSculptReduce::Impl (line 12) | struct ToolSculptReduce::Impl
method Impl (line 16) | Impl (ToolSculptReduce* s)
method runSetupBrush (line 21) | void runSetupBrush (SculptBrush& brush)
method runSetupCursor (line 30) | void runSetupCursor (ViewCursor&) {}
method runSetupProperties (line 32) | void runSetupProperties (ViewTwoColumnGrid& properties)
method runSetupToolTip (line 45) | void runSetupToolTip (ViewToolTip& toolTip)
method runSculptPointingEvent (line 50) | bool runSculptPointingEvent (const ViewPointingEvent& e)
FILE: lib/src/tool/sculpt/smooth.cpp
type ToolSculptSmooth::Impl (line 13) | struct ToolSculptSmooth::Impl
method Impl (line 17) | Impl (ToolSculptSmooth* s)
method runSetupBrush (line 22) | void runSetupBrush (SculptBrush& brush)
method runSetupCursor (line 31) | void runSetupCursor (ViewCursor&) {}
method runSetupProperties (line 33) | void runSetupProperties (ViewTwoColumnGrid& properties)
method runSetupToolTip (line 46) | void runSetupToolTip (ViewToolTip& toolTip)
method runSculptPointingEvent (line 51) | bool runSculptPointingEvent (const ViewPointingEvent& e)
FILE: lib/src/tool/sculpt/util/action.cpp
type NewFaces (line 22) | struct NewFaces
method reset (line 27) | void reset ()
method addFace (line 33) | void addFace (unsigned int i1, unsigned int i2, unsigned int i3)
method deleteFace (line 40) | void deleteFace (unsigned int i) { this->facesToDelete.insert (i); }
method applyToMesh (line 42) | bool applyToMesh (DynamicMesh& mesh, DynamicFaces& faces) const
function extendAndFilterDomain (line 65) | void extendAndFilterDomain (const SculptBrush& brush, DynamicFaces& face...
function extendDomain (line 110) | void extendDomain (DynamicMesh& mesh, DynamicFaces& faces, unsigned int ...
function extendDomainByPoles (line 132) | void extendDomainByPoles (DynamicMesh& mesh, DynamicFaces& faces)
function getSplitPosition (line 151) | glm::vec3 getSplitPosition (const DynamicMesh& mesh, unsigned int i1, un...
function splitEdges (line 176) | void splitEdges (DynamicMesh& mesh, ToolSculptEdgeMap& newE, float maxLe...
function triangulate (line 218) | void triangulate (DynamicMesh& mesh, const ToolSculptEdgeMap& newE, Dyna...
function relaxEdges (line 329) | void relaxEdges (DynamicMesh& mesh, const DynamicFaces& faces)
function smooth (line 378) | void smooth (DynamicMesh& mesh, DynamicFaces& faces)
function deleteValence3Vertex (line 440) | bool deleteValence3Vertex (DynamicMesh& mesh, unsigned int i, DynamicFac...
type ToolSculptAction (line 754) | namespace ToolSculptAction
function sculpt (line 756) | void sculpt (const SculptBrush& brush)
function smoothMesh (line 816) | void smoothMesh (DynamicMesh& mesh)
function deleteFaces (line 828) | bool deleteFaces (DynamicMesh& mesh, DynamicFaces& faces)
FILE: lib/src/tool/sculpt/util/action.hpp
class DynamicMesh (line 8) | class DynamicMesh
class SculptBrush (line 9) | class SculptBrush
type ToolSculptAction (line 11) | namespace ToolSculptAction
FILE: lib/src/tool/sculpt/util/brush.cpp
function PrimPlane (line 21) | const PrimPlane& SBFlattenParameters::lockedPlane () const { return *thi...
type SculptBrush::Impl (line 154) | struct SculptBrush::Impl
method Impl (line 169) | Impl (SculptBrush* s)
method DynamicMesh (line 180) | DynamicMesh& mesh () const
method mesh (line 187) | void mesh (DynamicMesh& m) { this->_mesh = &m; }
method subdivThreshold (line 189) | float subdivThreshold () const
method delta (line 215) | glm::vec3 delta () const
method PrimSphere (line 221) | PrimSphere sphere () const
method stepWidth (line 230) | float stepWidth () const { return this->stepWidthFactor * glm::log (th...
method setPointOfAction (line 232) | void setPointOfAction (DynamicMesh& mesh, const glm::vec3& p, const gl...
method resetPointOfAction (line 241) | void resetPointOfAction ()
method mirror (line 247) | void mirror (const PrimPlane& plane)
method DynamicFaces (line 262) | DynamicFaces getAffectedFaces () const
method sculpt (line 279) | void sculpt (const DynamicFaces& faces) const
method SBParameters (line 285) | SBParameters* parametersPointer () const { return this->_parameters.ge...
method parametersPointer (line 287) | void parametersPointer (SBParameters* p) { this->_parameters.reset (p); }
FILE: lib/src/tool/sculpt/util/brush.hpp
class DynamicFaces (line 12) | class DynamicFaces
class DynamicMesh (line 13) | class DynamicMesh
class PrimPlane (line 14) | class PrimPlane
class PrimSphere (line 15) | class PrimSphere
class SculptBrush (line 16) | class SculptBrush
method T (line 177) | T& initParameters ()
method T (line 183) | T& parameters () { return dynamic_cast<T&> (*this->parametersPointer (...
method SBParameters (line 185) | const SBParameters& parameters () const { return *this->parametersPoin...
class SBParameters (line 18) | class SBParameters
method intensity (line 23) | virtual float intensity () const { return 0.0f; }
method intensity (line 25) | virtual void intensity (float) {}
method useLastPos (line 27) | virtual bool useLastPos () const { return false; }
method discardBack (line 29) | virtual bool discardBack () const { return true; }
method reduce (line 31) | virtual bool reduce () const { return false; }
method mirror (line 33) | virtual void mirror (const PrimPlane&) {}
class SBIntensityParameter (line 38) | class SBIntensityParameter : virtual public SBParameters
method SBIntensityParameter (line 41) | SBIntensityParameter ()
class SBInvertParameter (line 49) | class SBInvertParameter : virtual public SBParameters
method SBInvertParameter (line 52) | SBInvertParameter ()
method toggleInvert (line 57) | void toggleInvert () { this->_invert = !this->_invert; }
method invert (line 59) | glm::vec3 invert (const glm::vec3& v) const { return this->_invert ? -...
class SBDiscardBackParameter (line 64) | class SBDiscardBackParameter : virtual public SBParameters
method SBDiscardBackParameter (line 67) | SBDiscardBackParameter ()
method discardBack (line 72) | bool discardBack () const override { return this->_discardBack; }
method discardBack (line 73) | void discardBack (bool d) { this->_discardBack = d; }
class SBDrawParameters (line 79) | class SBDrawParameters : public SBIntensityParameter, public SBInvertPar...
method SBDrawParameters (line 82) | SBDrawParameters ()
class SBGrablikeParameters (line 92) | class SBGrablikeParameters : public SBDiscardBackParameter
method useLastPos (line 97) | bool useLastPos () const override { return true; }
class SBSmoothParameters (line 100) | class SBSmoothParameters : public SBIntensityParameter
class SBReduceParameters (line 106) | class SBReduceParameters : public SBIntensityParameter
method reduce (line 109) | bool reduce () const override { return true; }
class SBFlattenParameters (line 114) | class SBFlattenParameters : public SBIntensityParameter
class SBCreaseParameters (line 133) | class SBCreaseParameters : public SBIntensityParameter, public SBInvertP...
class SBPinchParameters (line 139) | class SBPinchParameters : public SBInvertParameter
class SculptBrush (line 145) | class SculptBrush
method T (line 177) | T& initParameters ()
method T (line 183) | T& parameters () { return dynamic_cast<T&> (*this->parametersPointer (...
method SBParameters (line 185) | const SBParameters& parameters () const { return *this->parametersPoin...
FILE: lib/src/tool/sculpt/util/edge-collection.cpp
function ui_pair (line 11) | ui_pair makeUiKey (unsigned int i1, unsigned int i2)
FILE: lib/src/tool/sculpt/util/edge-collection.hpp
class ToolSculptEdgeMap (line 12) | class ToolSculptEdgeMap
class ToolSculptEdgeSet (line 27) | class ToolSculptEdgeSet
method begin (line 37) | Set::const_iterator begin () const { return this->set.begin (); }
method end (line 38) | Set::const_iterator end () const { return this->set.end (); }
FILE: lib/src/tool/sketch-spheres.cpp
type ToolSketchSpheres::Impl (line 28) | struct ToolSketchSpheres::Impl
method Impl (line 39) | Impl (ToolSketchSpheres* s)
method setupProperties (line 50) | void setupProperties ()
method setupToolTip (line 78) | void setupToolTip ()
method setupCursor (line 88) | void setupCursor ()
method ToolResponse (line 94) | ToolResponse runInitialize ()
method runRender (line 105) | void runRender () const
method newSpherePosition (line 115) | glm::vec3 newSpherePosition (bool considerHeight, const glm::vec3& pos...
method ToolResponse (line 130) | ToolResponse runMoveEvent (const ViewPointingEvent& e)
method ToolResponse (line 204) | ToolResponse runPressEvent (const ViewPointingEvent& e)
method ToolResponse (line 258) | ToolResponse runReleaseEvent (const ViewPointingEvent&) { return this-...
method ToolResponse (line 260) | ToolResponse runCursorUpdate (const glm::ivec2& pos)
method ToolResponse (line 275) | ToolResponse runCommit ()
method runFromConfig (line 281) | void runFromConfig ()
FILE: lib/src/tool/transform-mesh.cpp
type Mode (line 28) | enum class Mode
type RotationOrigin (line 35) | enum class RotationOrigin
type ScalingMode (line 42) | enum class ScalingMode
type ToolTransformMesh::Impl (line 49) | struct ToolTransformMesh::Impl
method Impl (line 61) | Impl (ToolTransformMesh* s)
method ToolResponse (line 73) | ToolResponse runInitialize ()
method setupProperties (line 81) | void setupProperties ()
method setupToolTip (line 109) | void setupToolTip ()
method scalingVector (line 121) | glm::vec3 scalingVector () const
method ToolResponse (line 168) | ToolResponse runMoveEvent (const ViewPointingEvent& e)
method ToolResponse (line 191) | ToolResponse runPressEvent (const ViewPointingEvent& e)
method ToolResponse (line 244) | ToolResponse runReleaseEvent (const ViewPointingEvent& e)
method ToolResponse (line 253) | ToolResponse runCommit ()
FILE: lib/src/tool/trim-mesh.cpp
type TrimStatus (line 30) | enum class TrimStatus
type TrimMode (line 37) | enum class TrimMode
function Impl (line 52) | Impl (ToolTrimMesh* s)
function setupProperties (line 59) | void setupProperties ()
function setupToolTip (line 80) | void setupToolTip ()
function ToolResponse (line 91) | ToolResponse runInitialize ()
function ToolResponse (line 99) | ToolResponse runMoveEvent (const ViewPointingEvent& e)
function TrimStatus (line 112) | TrimStatus trimMesh (DynamicMesh& mesh, int offset, bool reverse)
function TrimStatus (line 150) | TrimStatus trimMesh (DynamicMesh& mesh)
FILE: lib/src/tool/trim-mesh/action.cpp
type Simple (line 21) | namespace Simple
type Location (line 23) | enum class Location
function Location (line 30) | Location location (const glm::vec2& pos, const glm::vec2& from, const ...
function isLeft (line 48) | bool isLeft (const glm::vec2& pos, const glm::vec2& from, const glm::v...
function isRight (line 53) | bool isRight (const glm::vec2& pos, const glm::vec2& from, const glm::...
type TwoDSquare (line 58) | struct TwoDSquare
type State (line 60) | enum class State
method TwoDSquare (line 74) | TwoDSquare (const glm::uvec2& p, const glm::vec2& c, float width)
method intersects (line 84) | bool intersects (const glm::vec2& square1, const glm::vec2& square2,
method inside (line 104) | bool inside (const glm::vec2& v) const
method intersects (line 112) | bool intersects (const glm::vec2& segment1, const glm::vec2& segment...
type Curvature (line 129) | enum class Curvature
type TwoDVertex (line 136) | struct TwoDVertex
method TwoDVertex (line 146) | TwoDVertex (unsigned int i, const glm::vec2& p)
method Location (line 157) | Location location (const glm::vec2& from, const glm::vec2& to) const
method isLeft (line 162) | bool isLeft (const glm::vec2& from, const glm::vec2& to) const
method isRight (line 167) | bool isRight (const glm::vec2& from, const glm::vec2& to) const
method isInsideTriangle (line 172) | bool isInsideTriangle (const glm::vec2& v1, const glm::vec2& v2, con...
type TwoDPolyline (line 182) | struct TwoDPolyline
method TwoDPolyline (line 191) | TwoDPolyline (const TwoDVertices& vs)
method TwoDVertexRef (line 198) | TwoDVertexRef begin () { return this->vertices.begin (); }
method TwoDVertexCRef (line 199) | TwoDVertexCRef begin () const { return this->vertices.begin (); }
method TwoDVertexRef (line 200) | TwoDVertexRef end () { return this->vertices.end (); }
method TwoDVertexCRef (line 201) | TwoDVertexCRef end () const { return this->vertices.end (); }
method size (line 202) | unsigned int size () const { return this->vertices.size (); }
method TwoDVertexRef (line 204) | TwoDVertexRef prev (TwoDVertexRef v)
method TwoDVertexCRef (line 209) | TwoDVertexCRef prev (TwoDVertexCRef v) const
method TwoDVertexRef (line 214) | TwoDVertexRef next (TwoDVertexRef v)
method TwoDVertexCRef (line 219) | TwoDVertexCRef next (TwoDVertexCRef v) const
method setCurvature (line 224) | void setCurvature (TwoDVertexRef v) const
method setIsEar (line 240) | void setIsEar (TwoDVertexRef v) const
method setAngle (line 266) | void setAngle (TwoDVertexRef v)
method setProperties (line 283) | void setProperties ()
method removeEar (line 317) | void removeEar (TwoDVertexRef v)
method updateEarCandidate (line 334) | bool updateEarCandidate (TwoDVertexCRef v, float& weight) const
method fillHole (line 363) | bool fillHole (DynamicMesh& mesh)
method contains (line 400) | bool contains (const glm::vec2& v) const
method contains (line 423) | bool contains (const TwoDPolyline& poly) const
method intersects (line 435) | bool intersects (const TwoDSquare& square) const
type TwoDPolyline (line 185) | struct TwoDPolyline
method TwoDPolyline (line 191) | TwoDPolyline (const TwoDVertices& vs)
method TwoDVertexRef (line 198) | TwoDVertexRef begin () { return this->vertices.begin (); }
method TwoDVertexCRef (line 199) | TwoDVertexCRef begin () const { return this->vertices.begin (); }
method TwoDVertexRef (line 200) | TwoDVertexRef end () { return this->vertices.end (); }
method TwoDVertexCRef (line 201) | TwoDVertexCRef end () const { return this->vertices.end (); }
method size (line 202) | unsigned int size () const { return this->vertices.size (); }
method TwoDVertexRef (line 204) | TwoDVertexRef prev (TwoDVertexRef v)
method TwoDVertexCRef (line 209) | TwoDVertexCRef prev (TwoDVertexCRef v) const
method TwoDVertexRef (line 214) | TwoDVertexRef next (TwoDVertexRef v)
method TwoDVertexCRef (line 219) | TwoDVertexCRef next (TwoDVertexCRef v) const
method setCurvature (line 224) | void setCurvature (TwoDVertexRef v) const
method setIsEar (line 240) | void setIsEar (TwoDVertexRef v) const
method setAngle (line 266) | void setAngle (TwoDVertexRef v)
method setProperties (line 283) | void setProperties ()
method removeEar (line 317) | void removeEar (TwoDVertexRef v)
method updateEarCandidate (line 334) | bool updateEarCandidate (TwoDVertexCRef v, float& weight) const
method fillHole (line 363) | bool fillHole (DynamicMesh& mesh)
method contains (line 400) | bool contains (const glm::vec2& v) const
method contains (line 423) | bool contains (const TwoDPolyline& poly) const
method intersects (line 435) | bool intersects (const TwoDSquare& square) const
type TwoDGrid (line 448) | struct TwoDGrid
method index (line 453) | unsigned int index (unsigned int x, unsigned int y) const
method index (line 461) | unsigned int index (glm::uvec2 pos) const { return this->index (pos....
method TwoDSquare (line 463) | TwoDSquare& advanceNeighbor (const TwoDSquare& p, const TwoDSquare& n)
method TwoDGrid (line 506) | TwoDGrid (const ToolTrimMeshBorder& trimBorder, TwoDPolylines& ps)
method fill (line 687) | void fill (DynamicMesh& mesh) const
method smooth (line 746) | void smooth (DynamicMesh& mesh) const
function TwoDVertexCRef (line 765) | TwoDVertexCRef findMutuallyVisibleVertex (const TwoDPolyline& outer, c...
function TwoDPolyline (line 900) | TwoDPolyline combine (const TwoDPolyline& outer, const TwoDPolyline& i...
method TwoDPolyline (line 191) | TwoDPolyline (const TwoDVertices& vs)
method TwoDVertexRef (line 198) | TwoDVertexRef begin () { return this->vertices.begin (); }
method TwoDVertexCRef (line 199) | TwoDVertexCRef begin () const { return this->vertices.begin (); }
method TwoDVertexRef (line 200) | TwoDVertexRef end () { return this->vertices.end (); }
method TwoDVertexCRef (line 201) | TwoDVertexCRef end () const { return this->vertices.end (); }
method size (line 202) | unsigned int size () const { return this->vertices.size (); }
method TwoDVertexRef (line 204) | TwoDVertexRef prev (TwoDVertexRef v)
method TwoDVertexCRef (line 209) | TwoDVertexCRef prev (TwoDVertexCRef v) const
method TwoDVertexRef (line 214) | TwoDVertexRef next (TwoDVertexRef v)
method TwoDVertexCRef (line 219) | TwoDVertexCRef next (TwoDVertexCRef v) const
method setCurvature (line 224) | void setCurvature (TwoDVertexRef v) const
method setIsEar (line 240) | void setIsEar (TwoDVertexRef v) const
method setAngle (line 266) | void setAngle (TwoDVertexRef v)
method setProperties (line 283) | void setProperties ()
method removeEar (line 317) | void removeEar (TwoDVertexRef v)
method updateEarCandidate (line 334) | bool updateEarCandidate (TwoDVertexCRef v, float& weight) const
method fillHole (line 363) | bool fillHole (DynamicMesh& mesh)
method contains (line 400) | bool contains (const glm::vec2& v) const
method contains (line 423) | bool contains (const TwoDPolyline& poly) const
method intersects (line 435) | bool intersects (const TwoDSquare& square) const
function combine (line 925) | void combine (TwoDPolyline& outer, TwoDPolylines& inner)
type Nested (line 944) | namespace Nested
type TwoDPolyline (line 946) | struct TwoDPolyline
method TwoDPolyline (line 954) | TwoDPolyline (const Simple::TwoDPolyline& o)
method TwoDPolyline (line 959) | TwoDPolyline (const Simple::TwoDPolyline& o, const TwoDPolylines& i)
type TwoDPolyline (line 949) | struct TwoDPolyline
method TwoDPolyline (line 954) | TwoDPolyline (const Simple::TwoDPolyline& o)
method TwoDPolyline (line 959) | TwoDPolyline (const Simple::TwoDPolyline& o, const TwoDPolylines& i)
function fillHole (line 966) | bool fillHole (TwoDPolylines& polys, DynamicMesh& mesh)
function TwoDPolylines (line 997) | TwoDPolylines nest (const Simple::TwoDPolylines& ss)
function fillHole (line 1050) | bool fillHole (ToolTrimMeshBorder& border)
function trimVertices (line 1081) | void trimVertices (const ToolTrimMeshBorder& border)
type ToolTrimMeshAction (line 1118) | namespace ToolTrimMeshAction
function trimMesh (line 1120) | bool trimMesh (ToolTrimMeshBorder& border)
FILE: lib/src/tool/trim-mesh/action.hpp
class ToolTrimMeshBorder (line 8) | class ToolTrimMeshBorder
type ToolTrimMeshAction (line 10) | namespace ToolTrimMeshAction
FILE: lib/src/tool/trim-mesh/border.cpp
type ToolTrimMeshBorder::Impl (line 17) | struct ToolTrimMeshBorder::Impl
method Impl (line 25) | Impl (DynamicMesh& m, const PrimRay& r1, const PrimRay& r2)
method addVertex (line 33) | void addVertex (unsigned int index, const glm::vec3& p)
method addPolyline (line 42) | void addPolyline () { this->polylines.emplace_back (); }
method setNewIndices (line 44) | void setNewIndices (const std::vector<unsigned int>& newIndices)
method isValidProjection (line 57) | bool isValidProjection (const glm::vec3& p) const
method onBorder (line 69) | bool onBorder (const glm::vec3& p) const
method intersects (line 89) | bool intersects (const PrimRay& ray, float& t) const
method deleteEmptyPolylines (line 101) | void deleteEmptyPolylines ()
method hasVertices (line 108) | bool hasVertices () const
FILE: lib/src/tool/trim-mesh/border.hpp
class DynamicMesh (line 12) | class DynamicMesh
class PrimPlane (line 13) | class PrimPlane
class PrimRay (line 14) | class PrimRay
class ToolTrimMeshBorder (line 16) | class ToolTrimMeshBorder
FILE: lib/src/tool/trim-mesh/split-mesh.cpp
function splitEdge (line 19) | unsigned int splitEdge (DynamicMesh& mesh, unsigned int e1, unsigned e2,...
function splitEdge (line 38) | unsigned int splitEdge (const ToolTrimMeshBorder& border, unsigned int e...
function splitMesh (line 73) | void splitMesh (const ToolTrimMeshBorder& border, BorderVertices& border...
function checkBorderVertices (line 108) | bool checkBorderVertices (const DynamicMesh& mesh, const BorderVertices&...
function traverseAlongEdge (line 129) | bool traverseAlongEdge (const ToolTrimMeshBorder& border, unsigned int e...
function addPolylinesToBorder (line 138) | void addPolylinesToBorder (ToolTrimMeshBorder& border, BorderVertices& b...
FILE: lib/src/tool/trim-mesh/split-mesh.hpp
class ToolTrimMeshBorder (line 8) | class ToolTrimMeshBorder
type ToolTrimMeshSplitMesh (line 10) | namespace ToolTrimMeshSplitMesh
FILE: lib/src/tool/util/movement.cpp
type MovementPlane (line 15) | enum class MovementPlane
type ToolUtilMovement::Impl (line 23) | struct ToolUtilMovement::Impl
method Impl (line 31) | Impl (const Camera& cam, bool p)
method Impl (line 39) | Impl (const Camera& cam, const glm::vec3& n)
method setPlaneNormal (line 47) | void setPlaneNormal ()
method onPrimaryPlane (line 59) | bool onPrimaryPlane () const { return this->plane == MovementPlane::Pr...
method onPrimaryPlane (line 61) | void onPrimaryPlane (bool yes)
method onFreePlane (line 67) | void onFreePlane (const glm::vec3& n)
method delta (line 73) | glm::vec3 delta () const { return this->position - this->previousPosit...
method intersects (line 75) | bool intersects (const glm::ivec2& p, glm::vec3& i)
method move (line 91) | bool move (const ViewPointingEvent& e)
method reset (line 106) | void reset (const glm::vec3& p)
FILE: lib/src/tool/util/movement.hpp
class Camera (line 11) | class Camera
class ViewPointingEvent (line 12) | class ViewPointingEvent
class ToolUtilMovement (line 14) | class ToolUtilMovement
FILE: lib/src/tool/util/rotation.cpp
type ToolUtilRotation::Impl (line 11) | struct ToolUtilRotation::Impl
method Impl (line 20) | Impl (const Camera& cam)
method matrix (line 25) | glm::mat4x4 matrix () const { return Util::rotation (this->origin, thi...
method rotate (line 27) | bool rotate (const ViewPointingEvent& e)
method reset (line 69) | void reset (const glm::vec3& o)
method reset (line 77) | void reset (const glm::vec3& o, const glm::vec3& a)
FILE: lib/src/tool/util/rotation.hpp
class Camera (line 12) | class Camera
class ViewPointingEvent (line 13) | class ViewPointingEvent
class ToolUtilRotation (line 15) | class ToolUtilRotation
FILE: lib/src/tool/util/scaling.cpp
type ToolUtilScaling::Impl (line 13) | struct ToolUtilScaling::Impl
method Impl (line 20) | Impl (const Camera& cam)
method factor (line 25) | float factor (float previousDistance, float distance) const
method factor (line 37) | float factor () const
method factorRight (line 47) | float factorRight () const
method factorUp (line 56) | float factorUp () const
method intersects (line 65) | bool intersects (const glm::ivec2& p, glm::vec3& i) const
method move (line 80) | bool move (const ViewPointingEvent& e)
method reset (line 95) | void reset (const glm::vec3& origin, const glm::vec3& reference)
FILE: lib/src/tool/util/scaling.hpp
class Camera (line 11) | class Camera
class ViewPointingEvent (line 12) | class ViewPointingEvent
class ToolUtilScaling (line 14) | class ToolUtilScaling
FILE: lib/src/tool/util/step.cpp
type ToolUtilStep::Impl (line 14) | struct ToolUtilStep::Impl
method Impl (line 19) | Impl ()
method step (line 25) | void step (const glm::vec3& to, const std::function<bool(const glm::ve...
FILE: lib/src/tool/util/step.hpp
class ToolUtilStep (line 12) | class ToolUtilStep
FILE: lib/src/tree.hpp
class TreeNode (line 12) | class TreeNode
method TreeNode (line 15) | TreeNode (const T& d, TreeNode* p = nullptr)
method TreeNode (line 21) | TreeNode (T&& d, TreeNode* p = nullptr)
method TreeNode (line 27) | TreeNode (const TreeNode& o)
method TreeNode (line 35) | static TreeNode make (Args&&... args)
method T (line 40) | T& data () { return this->_data; }
method T (line 42) | const T& data () const { return this->_data; }
method data (line 44) | void data (const T& d) { this->_data = d; }
method TreeNode (line 46) | TreeNode* parent () const { return this->_parent; }
method TreeNode (line 48) | TreeNode& emplaceChild (Args&&... args)
method TreeNode (line 56) | TreeNode& addChild (const TreeNode& node)
method deleteChild (line 64) | void deleteChild (TreeNode& child)
method forEachChild (line 77) | void forEachChild (const std::function<void(TreeNode&)>& f)
method forEachConstChild (line 85) | void forEachConstChild (const std::function<void(const TreeNode&)>& f)...
method forEachNode (line 93) | void forEachNode (const std::function<void(TreeNode&)>& f)
method forEachConstNode (line 100) | void forEachConstNode (const std::function<void(const TreeNode&)>& f) ...
method TreeNode (line 107) | TreeNode& lastChild ()
method TreeNode (line 113) | const TreeNode& lastChild () const
method numChildren (line 119) | unsigned int numChildren () const { return this->_children.size (); }
method numNodes (line 121) | unsigned int numNodes () const
method deleteChildIf (line 128) | void deleteChildIf (const std::function<bool(const TreeNode&)>& f)
class Tree (line 149) | class Tree
method hasRoot (line 152) | bool hasRoot () const { return bool(this->_root); }
method reset (line 172) | void reset () { this->_root.reset (); }
method rebalance (line 174) | void rebalance (TreeNode<T>& node)
method split (line 198) | Tree<T> split (TreeNode<T>& node)
FILE: lib/src/util.cpp
function colinearUnitT (line 14) | bool colinearUnitT (const T& v1, const T& v2)
function colinearT (line 19) | bool colinearT (const T& v1, const T& v2)
type Util (line 278) | namespace Util
function withCLocale (line 280) | void withCLocale (const std::function<void()>& f)
FILE: lib/src/util.hpp
type Util (line 30) | namespace Util
function epsilon (line 60) | constexpr float epsilon () { return 0.0001f; }
function minFloat (line 62) | constexpr float minFloat () { return std::numeric_limits<float>::lowes...
function maxFloat (line 64) | constexpr float maxFloat () { return std::numeric_limits<float>::max (...
function minInt (line 66) | constexpr int minInt () { return std::numeric_limits<int>::lowest (); }
function maxInt (line 68) | constexpr int maxInt () { return std::numeric_limits<int>::max (); }
function maxUnsignedInt (line 70) | constexpr int maxUnsignedInt () { return std::numeric_limits<unsigned ...
function invalidIndex (line 72) | constexpr unsigned int invalidIndex () { return std::numeric_limits<un...
function setIfNotNull (line 74) | void setIfNotNull (T* ptr, const T& value)
function findIndexByReference (line 82) | unsigned int findIndexByReference (const std::vector<T>& vec, const T&...
function T (line 87) | T withCLocale (const std::function<T ()>& f)
function prune (line 97) | void prune (std::vector<T>& v, const std::function<bool(const T&)>& p,
FILE: lib/src/variant.hpp
type VariantDetails (line 13) | namespace VariantDetails
type InitValue (line 18) | struct InitValue
type SetValue (line 38) | struct SetValue
type GetType (line 58) | struct GetType
type GetIndex (line 71) | struct GetIndex
type GetIndex<i, U, T> (line 73) | struct GetIndex<i, U, T>
function VariantUnion (line 98) | VariantUnion ()
function VariantUnion (line 102) | VariantUnion (const VariantUnion&) = delete;
function VariantUnion (line 103) | VariantUnion (VariantUnion&&) = delete;
function VariantUnion (line 105) | const VariantUnion& operator= (const VariantUnion&) = delete;
function VariantUnion (line 106) | const VariantUnion& operator= (VariantUnion&&) = delete;
function copy (line 108) | void copy (unsigned int i, const VariantUnion& other)
function move (line 115) | void move (unsigned int i, VariantUnion&& other)
function release (line 123) | void release (unsigned int i)
function init (line 130) | void init () { InitValue<i, U, T>::run (*this); }
function set (line 132) | void set (const U& u)
function U (line 137) | U& get (unsigned int i)
function U (line 145) | const U& get (unsigned int i) const
function U (line 153) | U caseOf (unsigned int i, const std::function<U (T&)>& branch) const
function VariantUnion (line 170) | VariantUnion ()
function VariantUnion (line 174) | VariantUnion (const VariantUnion&) = delete;
function VariantUnion (line 175) | VariantUnion (VariantUnion&&) = delete;
function VariantUnion (line 177) | const VariantUnion& operator= (const VariantUnion&) = delete;
function VariantUnion (line 178) | const VariantUnion& operator= (VariantUnion&&) = delete;
function copy (line 180) | void copy (unsigned int i, const VariantUnion& other)
function move (line 192) | void move (unsigned int i, VariantUnion&& other)
function release (line 205) | void release (unsigned int i)
function init (line 217) | void init () { InitValue<i, U, T, Ts...>::run (*this); }
function set (line 219) | void set (const U& u)
function U (line 224) | U& get (unsigned int i)
function U (line 237) | const U& get (unsigned int i) const
function U (line 251) | U caseOf (unsigned int i, const std::function<U (T&)>& branch,
type InitValue<0, U, T, Ts...> (line 20) | struct InitValue<0, U, T, Ts...>
method run (line 22) | static void run (VariantUnion<T, Ts...>& variant)
type InitValue<i, U, T, Ts...> (line 29) | struct InitValue<i, U, T, Ts...>
method run (line 31) | static void run (VariantUnion<T, Ts...>& variant)
type SetValue<0, U, T, Ts...> (line 40) | struct SetValue<0, U, T, Ts...>
method run (line 42) | static void run (VariantUnion<T, Ts...>& variant, const U& u)
type SetValue<i, U, T, Ts...> (line 49) | struct SetValue<i, U, T, Ts...>
method run (line 51) | static void run (VariantUnion<T, Ts...>& variant, const U& u)
type GetType<0, T, Ts...> (line 60) | struct GetType<0, T, Ts...>
type GetType<i, T, Ts...> (line 65) | struct GetType<i, T, Ts...>
type GetIndex<i, U, T, Ts...> (line 79) | struct GetIndex<i, U, T, Ts...>
class Variant (line 267) | class Variant
method Variant (line 270) | Variant ()
method Variant (line 277) | Variant (const Variant& other)
method Variant (line 288) | Variant (Variant&& other)
method Variant (line 301) | const Variant& operator= (const Variant& other)
method Variant (line 318) | const Variant& operator= (Variant&& other)
method release (line 339) | void release ()
method U (line 348) | U& get ()
method U (line 354) | const U& get () const
method initAt (line 360) | void initAt ()
method init (line 366) | void init ()
method setAt (line 374) | void setAt (const U& u)
method set (line 380) | void set (const U& u)
method is (line 388) | bool is () const
method U (line 403) | U caseOf (const std::function<U (Ts&)>&... branches) const
method isSet (line 409) | bool isSet () const { return this->_isSet; }
method resetTo (line 416) | void resetTo ()
FILE: lib/src/view/axis.cpp
type ViewAxis::Impl (line 18) | struct ViewAxis::Impl
method Impl (line 30) | Impl (const Config& config)
method initializeGrid (line 51) | void initializeGrid ()
method render (line 77) | void render (Camera& camera)
method renderGrid (line 119) | void renderGrid (Camera& camera)
method render (line 138) | void render (Camera& camera, QPainter& painter)
method runFromConfig (line 173) | void runFromConfig (const Config& config)
FILE: lib/src/view/axis.hpp
class Camera (line 11) | class Camera
class Config (line 12) | class Config
class QPainter (line 13) | class QPainter
class ViewAxis (line 15) | class ViewAxis : public Configurable
FILE: lib/src/view/color-button.cpp
type ViewColorButton::Impl (line 11) | struct ViewColorButton::Impl
method Impl (line 16) | Impl (ViewColorButton* s, const Color& c, bool alpha)
method paintEvent (line 40) | void paintEvent (QPaintEvent* event)
FILE: lib/src/view/color-button.hpp
class Color (line 11) | class Color
class ViewColorButton (line 13) | class ViewColorButton : public QPushButton
FILE: lib/src/view/configuration.cpp
type DialogData (line 29) | struct DialogData
method DialogData (line 34) | DialogData (ViewGlWidget& w)
method checkIfRestartIsRequired (line 40) | void checkIfRestartIsRequired (const std::string& path)
function setAndUpdate (line 51) | void setAndUpdate (DialogData& data, const std::string& path, const T& v...
function addColorButton (line 59) | void addColorButton (DialogData& data, ViewTwoColumnGrid& grid, const st...
function addVectorEdit (line 70) | void addVectorEdit (DialogData& data, ViewTwoColumnGrid& grid, const std...
function addFloatEdit (line 80) | void addFloatEdit (DialogData& data, ViewTwoColumnGrid& grid, const std:...
function addIntEdit (line 89) | void addIntEdit (DialogData& data, ViewTwoColumnGrid& grid, const std::s...
function addBoolEdit (line 98) | void addBoolEdit (DialogData& data, ViewTwoColumnGrid& grid, const std::...
function QWidget (line 107) | QWidget* makeColorsPage (DialogData& data)
function QWidget (line 127) | QWidget* makeLightsPage (DialogData& data)
function QWidget (line 152) | QWidget* makeCameraPage (DialogData& data)
function QWidget (line 174) | QWidget* makeToolsPage (DialogData& data)
function QWidget (line 211) | QWidget* makeMiscPage (DialogData& data)
FILE: lib/src/view/configuration.hpp
class ViewGlWidget (line 8) | class ViewGlWidget
class ViewMainWindow (line 9) | class ViewMainWindow
type ViewConfiguration (line 11) | namespace ViewConfiguration
FILE: lib/src/view/context-menu.cpp
function addActions (line 23) | void addActions (QMenu& menu, ViewMainWindow& mainWindow, DynamicMesh& m...
function addActions (line 61) | void addActions (QMenu& menu, ViewMainWindow& mainWindow, SketchMesh& sk...
FILE: lib/src/view/context-menu.hpp
class DynamicMesh (line 11) | class DynamicMesh
class SketchMesh (line 12) | class SketchMesh
class ViewMainWindow (line 13) | class ViewMainWindow
class ViewContextMenu (line 15) | class ViewContextMenu : public QMenu
FILE: lib/src/view/cursor.cpp
type ViewCursor::Impl (line 12) | struct ViewCursor::Impl
method Impl (line 20) | Impl ()
method radius (line 29) | float radius () const { return this->_radius; }
method position (line 31) | glm::vec3 position () const { return this->radiusMesh.position (); }
method Color (line 33) | const Color& color () const { return this->radiusMesh.color (); }
method radius (line 35) | void radius (float r)
method position (line 41) | void position (const glm::vec3& p) { this->radiusMesh.position (p); }
method color (line 43) | void color (const Color& color) { this->radiusMesh.color (color); }
method enable (line 45) | void enable () { this->isEnabled = true; }
method disable (line 47) | void disable () { this->isEnabled = false; }
method render (line 49) | void render (Camera& camera) const
method update (line 85) | void update () { this->radiusMesh.scaling (glm::vec3 (this->radius ())...
FILE: lib/src/view/cursor.hpp
class Camera (line 11) | class Camera
class Color (line 12) | class Color
class Mesh (line 13) | class Mesh
class ViewCursor (line 15) | class ViewCursor
FILE: lib/src/view/double-slider.cpp
type ViewDoubleSlider::Impl (line 9) | struct ViewDoubleSlider::Impl
method Impl (line 15) | Impl (ViewDoubleSlider* s, unsigned short numDecimals, unsigned short o)
method toDouble (line 27) | double toDouble (int value, bool forceLinear) const
method toInt (line 47) | int toInt (double value, bool forceLinear) const
method doubleValue (line 67) | double doubleValue () const { return this->toDouble (this->self->value...
method doubleSingleStep (line 69) | double doubleSingleStep () const { return this->toDouble (this->self->...
method setDoubleValue (line 71) | void setDoubleValue (double v) { this->self->setValue (this->toInt (v,...
method setDoubleRange (line 73) | void setDoubleRange (double min, double max)
method setDoubleSingleStep (line 78) | void setDoubleSingleStep (double v) { this->self->setSingleStep (this-...
method setDoublePageStep (line 80) | void setDoublePageStep (double v) { this->self->setPageStep (this->toI...
method intValue (line 82) | int intValue () const { return this->self->QSlider::value (); }
method intSingleStep (line 84) | int intSingleStep () const { return this->self->QSlider::singleStep (); }
method setIntValue (line 86) | void setIntValue (int v) { this->self->QSlider::setValue (v); }
method setIntRange (line 88) | void setIntRange (int min, int max) { this->self->QSlider::setRange (m...
method setIntSingleStep (line 90) | void setIntSingleStep (int v) { this->self->QSlider::setSingleStep (v); }
method setIntPageStep (line 92) | void setIntPageStep (int v) { this->self->QSlider::setPageStep (v); }
method value (line 94) | int value () const { return this->intValue (); }
method singleStep (line 96) | int singleStep () const { return this->intSingleStep (); }
method setValue (line 98) | void setValue (int v) { this->setIntValue (v); }
method setRange (line 100) | void setRange (int min, int max) { this->setIntRange (min, max); }
method setSingleStep (line 102) | void setSingleStep (int v) { this->setIntSingleStep (v); }
method setPageStep (line 104) | void setPageStep (int v) { this->setIntPageStep (v); }
FILE: lib/src/view/double-slider.hpp
class ViewDoubleSlider (line 11) | class ViewDoubleSlider : public QSlider
FILE: lib/src/view/floor-plane.cpp
type ViewFloorPlane::Impl (line 13) | struct ViewFloorPlane::Impl
method Impl (line 20) | Impl (const Config& config, const Camera& camera)
method render (line 28) | void render (Camera& camera) const
method update (line 36) | void update (const Camera& cam)
method runFromConfig (line 77) | void runFromConfig (const Config& config)
FILE: lib/src/view/floor-plane.hpp
class Camera (line 11) | class Camera
class Config (line 12) | class Config
class ViewFloorPlane (line 14) | class ViewFloorPlane : public Configurable {
FILE: lib/src/view/gl-widget.cpp
type ViewGlWidget::Impl (line 30) | struct ViewGlWidget::Impl
method Impl (line 47) | Impl (ViewGlWidget* s, ViewMainWindow& mW, Config& cfg, Cache& cch)
method ToolMoveCamera (line 68) | ToolMoveCamera& immediateMoveCamera ()
method State (line 74) | State& state ()
method ViewFloorPlane (line 80) | ViewFloorPlane& floorPlane ()
method cursorPosition (line 86) | glm::ivec2 cursorPosition ()
method fromConfig (line 91) | void fromConfig ()
method initializeGL (line 105) | void initializeGL ()
method initializeScene (line 121) | void initializeScene ()
method paintGL (line 139) | void paintGL ()
method resizeGL (line 164) | void resizeGL (int w, int h) { this->state ().camera ().updateResoluti...
method pointingEvent (line 166) | void pointingEvent (const ViewPointingEvent& e)
method mouseMoveEvent (line 183) | void mouseMoveEvent (QMouseEvent* e)
method mousePressEvent (line 191) | void mousePressEvent (QMouseEvent* e)
method mouseReleaseEvent (line 199) | void mouseReleaseEvent (QMouseEvent* e)
method wheelEvent (line 207) | void wheelEvent (QWheelEvent* e)
method tabletEvent (line 216) | void tabletEvent (QTabletEvent* e)
method keyPressEvent (line 231) | void keyPressEvent (QKeyEvent* e)
method keyReleaseEvent (line 242) | void keyReleaseEvent (QKeyEvent* e)
method enterEvent (line 253) | void enterEvent (QEvent*) { this->self->setFocus (); }
method contextMenuEvent (line 255) | void contextMenuEvent (QContextMenuEvent* event)
method updateCursorInTool (line 263) | void updateCursorInTool ()
FILE: lib/src/view/gl-widget.hpp
class Cache (line 12) | class Cache
class Config (line 13) | class Config
class State (line 14) | class State
class ToolMoveCamera (line 15) | class ToolMoveCamera
class ViewFloorPlane (line 16) | class ViewFloorPlane
class ViewMainWindow (line 17) | class ViewMainWindow
class ViewGlWidget (line 19) | class ViewGlWidget : public QOpenGLWidget
FILE: lib/src/view/info-pane.cpp
type ViewInfoPane::Impl (line 13) | struct ViewInfoPane::Impl
method Impl (line 20) | Impl (ViewInfoPane* s, ViewMainWindow& m)
method QWidget (line 43) | QWidget* initializeToolTipTab ()
method addToolTip (line 61) | void addToolTip (const ViewToolTip& tip)
method resetToolTip (line 75) | void resetToolTip () { this->toolTip.reset (); }
FILE: lib/src/view/info-pane.hpp
class ViewInfoPaneScene (line 11) | class ViewInfoPaneScene
class ViewMainWindow (line 12) | class ViewMainWindow
class ViewToolTip (line 13) | class ViewToolTip
class ViewInfoPane (line 15) | class ViewInfoPane : public QDockWidget
FILE: lib/src/view/info-pane/scene.cpp
type MeshItem (line 23) | struct MeshItem : public QTreeWidgetItem
method MeshItem (line 27) | MeshItem (QTreeWidgetItem& parent, const QStringList& labels, DynamicM...
method MeshItem (line 33) | MeshItem (QTreeWidget& parent, const QStringList& labels, DynamicMesh& m)
type SketchItem (line 40) | struct SketchItem : public QTreeWidgetItem
method SketchItem (line 44) | SketchItem (QTreeWidgetItem& parent, const QStringList& labels, Sketch...
method SketchItem (line 50) | SketchItem (QTreeWidget& parent, const QStringList& labels, SketchMesh...
type ViewInfoPaneScene::Impl (line 58) | struct ViewInfoPaneScene::Impl
method Impl (line 64) | Impl (ViewInfoPaneScene* s, ViewMainWindow& m)
method updateInfo (line 79) | void updateInfo ()
method showMenu (line 109) | void showMenu (const QPoint& point)
FILE: lib/src/view/info-pane/scene.hpp
class ViewMainWindow (line 11) | class ViewMainWindow
class ViewInfoPaneScene (line 13) | class ViewInfoPaneScene : public QWidget
FILE: lib/src/view/input.cpp
type ViewInput (line 10) | namespace ViewInput
function QKeySequence (line 12) | QKeySequence toQKeySequence (ViewInputEvent event, ViewInputModifier m...
function QString (line 123) | QString toQString (ViewInputEvent event)
function QString (line 196) | QString toQString (ViewInputModifier modifier)
function QString (line 213) | QString toQString (ViewInputEvent event, ViewInputModifier modifier)
FILE: lib/src/view/input.hpp
class QKeySequence (line 8) | class QKeySequence
class QString (line 9) | class QString
type ViewInputEvent (line 11) | enum class ViewInputEvent
type ViewInputModifier (line 47) | enum class ViewInputModifier
type ViewInput (line 55) | namespace ViewInput
FILE: lib/src/view/key-event.hpp
class QKeyEvent (line 10) | class QKeyEvent
class ViewKeyEvent (line 12) | class ViewKeyEvent
method key (line 17) | Qt::Key key () const { return this->_key; }
method pressEvent (line 19) | bool pressEvent () const { return this->_pressEvent; }
method releaseEvent (line 21) | bool releaseEvent () const { return this->_releaseEvent; }
FILE: lib/src/view/light.cpp
type ViewLight::Impl (line 9) | struct ViewLight::Impl
method Impl (line 15) | Impl (const glm::vec3& p, const Color& c, float i)
FILE: lib/src/view/light.hpp
class Color (line 11) | class Color
class ViewLight (line 13) | class ViewLight
FILE: lib/src/view/log.cpp
function QString (line 17) | QString ViewLog::logPath () { return QDir::temp ().filePath ("dilay.log"...
function QString (line 19) | QString ViewLog::crashLogPath () { return QDir::temp ().filePath ("dilay...
FILE: lib/src/view/log.hpp
class ViewMainWindow (line 10) | class ViewMainWindow
type ViewLog (line 12) | namespace ViewLog
FILE: lib/src/view/main-window.cpp
type ViewMainWindow::Impl (line 14) | struct ViewMainWindow::Impl
method Impl (line 21) | Impl (ViewMainWindow* s, Config& config, Cache& cache)
method update (line 34) | void update ()
method closeEvent (line 41) | void closeEvent (QCloseEvent* e)
FILE: lib/src/view/main-window.hpp
class Cache (line 11) | class Cache
class Config (line 12) | class Config
class QCloseEvent (line 13) | class QCloseEvent
class ViewGlWidget (line 14) | class ViewGlWidget
class ViewInfoPane (line 15) | class ViewInfoPane
class ViewToolPane (line 16) | class ViewToolPane
class ViewMainWindow (line 18) | class ViewMainWindow : public QMainWindow
FILE: lib/src/view/menu-bar.cpp
function QString (line 25) | QString getFileDialogPath (const Scene& scene)
function QString (line 32) | QString filterAllFiles () { return QObject::tr ("All files (*.*)"); }
function QString (line 34) | QString filterDlyFiles () { return QObject::tr ("Dilay files (*.dly)"); }
function QString (line 36) | QString filterObjFiles () { return QObject::tr ("Wavefront files (*.obj)...
function QString (line 38) | QString fileDialogFilters ()
function QString (line 43) | QString selectedFilter (const Scene& scene)
FILE: lib/src/view/menu-bar.hpp
class ViewGlWidget (line 8) | class ViewGlWidget
class ViewMainWindow (line 9) | class ViewMainWindow
type ViewMenuBar (line 11) | namespace ViewMenuBar
FILE: lib/src/view/pointing-event.cpp
function fromButtons (line 13) | Qt::MouseButton fromButtons (const Qt::MouseButtons& buttons)
FILE: lib/src/view/pointing-event.hpp
class Config (line 11) | class Config
class QMouseEvent (line 12) | class QMouseEvent
class QTabletEvent (line 13) | class QTabletEvent
class ViewPointingEvent (line 15) | class ViewPointingEvent
method modifiers (line 27) | Qt::KeyboardModifiers modifiers () const { return this->_modifiers; }
method pressEvent (line 29) | bool pressEvent () const { return this->_pressEvent; }
method moveEvent (line 31) | bool moveEvent () const { return this->_moveEvent; }
method releaseEvent (line 33) | bool releaseEvent () const { return this->_releaseEvent; }
method delta (line 37) | glm::ivec2 delta () const { return this->_position - this->_prevPositi...
method intensity (line 39) | float intensity () const { return this->_intensity; }
FILE: lib/src/view/resolution-slider.cpp
type ViewResolutionSlider::Impl (line 8) | struct ViewResolutionSlider::Impl
method Impl (line 10) | Impl (ViewResolutionSlider* s, float min, float max)
FILE: lib/src/view/shortcut.cpp
type ViewShortcut::Impl (line 15) | struct ViewShortcut::Impl
method Impl (line 22) | Impl (const ViewInputEvent& e, const ViewInputModifier& m, const QStri...
method Impl (line 30) | Impl (const ViewInputEvent& e, const QString& l, Call&& c)
method QShortcut (line 35) | QShortcut& toQShortcut (QWidget& parent) const
FILE: lib/src/view/shortcut.hpp
type ViewInputEvent (line 11) | enum class ViewInputEvent
type ViewInputModifier (line 12) | enum class ViewInputModifier
class QShortcut (line 13) | class QShortcut
class QString (line 14) | class QString
class QWidget (line 15) | class QWidget
class ViewShortcut (line 17) | class ViewShortcut
FILE: lib/src/view/tool-pane.cpp
type ViewToolPane::Impl (line 17) | struct ViewToolPane::Impl
method Impl (line 28) | Impl (ViewToolPane* s, ViewGlWidget& g)
method initializeToolSelection (line 56) | void initializeToolSelection ()
method addToolButton (line 67) | void addToolButton (ToolKey key, QLayout* layout, const QString& name)
method QWidget (line 77) | QWidget* initalizeSculptSelection ()
method QWidget (line 104) | QWidget* initalizeSketchSelection ()
method forceWidth (line 122) | void forceWidth ()
method ViewToolPaneSelection (line 130) | ViewToolPaneSelection selection () const
method setButtonState (line 143) | void setButtonState (ToolKey key, bool state)
method QString (line 152) | QString buttonText (ToolKey key) const
FILE: lib/src/view/tool-pane.hpp
type ToolKey (line 11) | enum class ToolKey
class QPushButton (line 12) | class QPushButton
class ViewGlWidget (line 13) | class ViewGlWidget
class ViewTwoColumnGrid (line 14) | class ViewTwoColumnGrid
type ViewToolPaneSelection (line 16) | enum class ViewToolPaneSelection
class ViewToolPane (line 22) | class ViewToolPane : public QDockWidget
FILE: lib/src/view/tool-tip.cpp
type ViewToolTip::Impl (line 10) | struct ViewToolTip::Impl
method render (line 15) | void render (const std::function<void(const QString&, const QString&)>...
method add (line 23) | void add (ViewInputEvent event, ViewInputModifier modifier, const QStr...
method add (line 28) | void add (ViewInputEvent event, const QString& tip)
method reset (line 33) | void reset () { this->tips.clear (); }
method isEmpty (line 35) | bool isEmpty () const { return this->tips.empty (); }
FILE: lib/src/view/tool-tip.hpp
class ViewToolTip (line 12) | class ViewToolTip
FILE: lib/src/view/two-column-grid.cpp
type ViewTwoColumnGrid::Impl (line 13) | struct ViewTwoColumnGrid::Impl
method Impl (line 19) | Impl (ViewTwoColumnGrid* s)
method setEqualColumnStretch (line 28) | void setEqualColumnStretch ()
method add (line 34) | void add (QWidget& widget)
method add (line 41) | void add (const QString& labelLeft, const QString& labelRight)
method add (line 46) | void add (const QString& label, QWidget& widget) { this->add (*new QLa...
method add (line 48) | void add (QWidget& w1, QWidget& w2)
method add (line 56) | void add (QButtonGroup& group)
method addStacked (line 64) | void addStacked (const QString& labelText, QWidget& widget)
method addStacked (line 78) | void addStacked (const QString& labelText, QButtonGroup& group)
method addLeft (line 96) | void addLeft (const QString& label) { this->add (label, *new QWidget); }
method addCenter (line 98) | void addCenter (const QString& labelText)
method addStretcher (line 106) | void addStretcher ()
method addSeparator (line 112) | void addSeparator () { this->add (ViewUtil::horizontalLine ()); }
method reset (line 114) | void reset ()
FILE: lib/src/view/two-column-grid.hpp
class QButtonGroup (line 12) | class QButtonGroup
class QString (line 13) | class QString
class ViewTwoColumnGrid (line 15) | class ViewTwoColumnGrid : public QWidget
FILE: lib/src/view/util.cpp
function setupDoubleSlider (line 27) | void setupDoubleSlider (ViewDoubleSlider& slider, float min, float value...
function QSpinBox (line 38) | QSpinBox& ViewUtil::spinBox (int min, int value, int max, int stepSize)
function QDoubleSpinBox (line 47) | QDoubleSpinBox& ViewUtil::spinBox (float min, float value, float max, fl...
function QPushButton (line 57) | QPushButton& ViewUtil::pushButton (const QString& label, bool isDefaultB...
function QToolButton (line 64) | QToolButton& ViewUtil::toolButton (const QString& label)
function QRadioButton (line 71) | QRadioButton& ViewUtil::radioButton (const QString& label, bool isChecked)
function QCheckBox (line 78) | QCheckBox& ViewUtil::checkBox (const QString& label, bool isChecked)
function QSlider (line 85) | QSlider& ViewUtil::slider (int min, int value, int max)
function ViewDoubleSlider (line 97) | ViewDoubleSlider& ViewUtil::slider (unsigned short numDecimals, float mi...
function ViewResolutionSlider (line 105) | ViewResolutionSlider& ViewUtil::resolutionSlider (float min, float value...
function QButtonGroup (line 112) | QButtonGroup& ViewUtil::buttonGroup (const std::vector<QString>& labels)
function QFrame (line 126) | QFrame& ViewUtil::horizontalLine ()
function QWidget (line 134) | QWidget& ViewUtil::emptyWidget () { return *new QWidget; }
function QLineEdit (line 136) | QLineEdit& ViewUtil::lineEdit (float value, unsigned short numDecimals)
function QLineEdit (line 141) | QLineEdit& ViewUtil::lineEdit (float min, float value, float max, unsign...
function QLineEdit (line 153) | QLineEdit& ViewUtil::lineEdit (int value)
function QLineEdit (line 162) | QLineEdit& ViewUtil::lineEdit (int min, int value, int max)
function QPoint (line 182) | QPoint ViewUtil::toQPoint (const glm::uvec2& p) { return QPoint (int(p.x...
function QPoint (line 184) | QPoint ViewUtil::toQPoint (const glm::ivec2& p) { return QPoint (p.x, p....
function QWidget (line 275) | QWidget& ViewUtil::stretcher (bool horizontal, bool vertical)
function QAction (line 326) | QAction& ViewUtil::addAction (QMenu& menu, const QString& label, const Q...
function QAction (line 336) | QAction& ViewUtil::addCheckableAction (QMenu& menu, const QString& label,
FILE: lib/src/view/util.hpp
class ViewDoubleSlider (line 12) | class ViewDoubleSlider
class ViewResolutionSlider (line 13) | class ViewResolutionSlider
class QAbstractSpinBox (line 14) | class QAbstractSpinBox
class QAction (line 15) | class QAction
class QButtonGroup (line 16) | class QButtonGroup
class QCheckBox (line 17) | class QCheckBox
class QDoubleSpinBox (line 18) | class QDoubleSpinBox
class QFrame (line 19) | class QFrame
class QKeySequence (line 20) | class QKeySequence
class QLineEdit (line 21) | class QLineEdit
class QMenu (line 22) | class QMenu
class QPoint (line 23) | class QPoint
class QPushButton (line 24) | class QPushButton
class QRadioButton (line 25) | class QRadioButton
class QSlider (line 26) | class QSlider
class QSpinBox (line 27) | class QSpinBox
class QString (line 28) | class QString
class QTabWidget (line 29) | class QTabWidget
class QToolButton (line 30) | class QToolButton
class QWidget (line 31) | class QWidget
type ViewUtil (line 33) | namespace ViewUtil
FILE: lib/src/view/vector-edit.cpp
type ViewVectorEdit::Impl (line 10) | struct ViewVectorEdit::Impl
method Impl (line 18) | Impl (ViewVectorEdit* s, const glm::vec3& v)
method vector (line 40) | void vector (const glm::vec3& v)
method x (line 47) | void x (float v) { this->changeComponent (0, v); }
method y (line 49) | void y (float v) { this->changeComponent (1, v); }
method z (line 51) | void z (float v) { this->changeComponent (2, v); }
method changeComponent (line 53) | void changeComponent (int i, float v)
FILE: lib/src/view/vector-edit.hpp
class ViewVectorEdit (line 12) | class ViewVectorEdit : public QWidget
FILE: lib/src/xml-conversion.cpp
function QDomElement (line 77) | QDomElement& XmlConversion::toDomElement (QDomDocument& doc, QDomElement...
function QDomElement (line 84) | QDomElement& XmlConversion::toDomElement (QDomDocument& doc, QDomElement...
function QDomElement (line 91) | QDomElement& XmlConversion::toDomElement (QDomDocument& doc, QDomElement...
function QDomElement (line 98) | QDomElement& XmlConversion::toDomElement (QDomDocument& doc, QDomElement...
function QDomElement (line 110) | QDomElement& XmlConversion::toDomElement (QDomDocument& doc, QDomElement...
function QDomElement (line 120) | QDomElement& XmlConversion::toDomElement (QDomDocument& doc, QDomElement...
FILE: lib/src/xml-conversion.hpp
class QDomDocument (line 10) | class QDomDocument
class QDomElement (line 11) | class QDomElement
class Color (line 12) | class Color
type XmlConversion (line 14) | namespace XmlConversion
FILE: test/src/main.cpp
function main (line 16) | int main ()
FILE: test/src/test-bitset.hpp
type TestBitset (line 8) | namespace TestBitset
FILE: test/src/test-distance.hpp
type TestDistance (line 8) | namespace TestDistance
FILE: test/src/test-intersection.hpp
type TestIntersection (line 8) | namespace TestIntersection
FILE: test/src/test-maybe.cpp
class Foo (line 55) | class Foo
method Foo (line 58) | Foo (int d)
method data (line 63) | int data () const { return this->_data; }
FILE: test/src/test-maybe.hpp
type TestMaybe (line 8) | namespace TestMaybe
FILE: test/src/test-misc.hpp
type TestMisc (line 8) | namespace TestMisc
FILE: test/src/test-octree.hpp
type TestOctree (line 8) | namespace TestOctree
FILE: test/src/test-prune.cpp
function equals (line 10) | bool equals (std::vector<int> prune, const std::vector<int>& vec,
FILE: test/src/test-prune.hpp
type TestPrune (line 8) | namespace TestPrune
FILE: test/src/test-tree.cpp
type Foo (line 11) | struct Foo
method Foo (line 15) | Foo (int v)
FILE: test/src/test-tree.hpp
type TestTree (line 8) | namespace TestTree
Condensed preview — 232 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (942K chars).
[
{
"path": ".clang-format",
"chars": 2085,
"preview": "Language: Cpp\nAccessModifierOffset: -2\nAlignAfterOpenBracket: Align\nAlignConsecutiveAssignments: false\nAlignConsecutiveD"
},
{
"path": ".gitignore",
"chars": 304,
"preview": "obj/\nmoc/\ndilay\ndilay_debug\nMakefile\narchive/\ni18n/*.qm\nrun-tests\nlib/Makefile\nlib/Makefile.Release\nlib/Makefile.Debug\nl"
},
{
"path": "LICENSE.txt",
"chars": 35147,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "README.md",
"chars": 156,
"preview": "# Dilay - a 3D sculpting application\n\n**Project website:** https://abau.org/dilay\n\n**Building instructions:** https://ab"
},
{
"path": "app/app.pro",
"chars": 2039,
"preview": "include (../common.pri)\n\nTEMPLATE = app\nDESTDIR = $$OUT_PWD/..\nDEPENDPATH += src \nINCLUDEPATH += s"
},
{
"path": "app/src/main.cpp",
"chars": 2238,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "common.pri",
"chars": 578,
"preview": "VERSION = 1.9.0\nCONFIG += debug_and_release warn_on object_parallel_to_source ordered c+"
},
{
"path": "dilay.pro",
"chars": 849,
"preview": "CONFIG += debug_and_release\nTEMPLATE = subdirs\nSUBDIRS = lib app test\n\napp.depends = lib\ntest.depends = l"
},
{
"path": "icon.tex",
"chars": 1975,
"preview": "\\documentclass[crop,tikz,convert={size=512x512,outext=.png}]{standalone}\n\\usetikzlibrary{shapes.geometric}\n\\begin{docume"
},
{
"path": "lib/lib.pro",
"chars": 7018,
"preview": "include (../common.pri)\n\nTEMPLATE = lib\nTARGET = dilay\nDEPENDPATH += src \nINCLUDEPATH += src \nCONFIG += "
},
{
"path": "lib/src/IsosurfaceExtractionConfigurations.hs",
"chars": 5316,
"preview": "{- This file is part of Dilay\n - Copyright © 2015-2018 Alexander Bau\n - Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/bitset.hpp",
"chars": 1308,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/cache.hpp",
"chars": 1303,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/camera.cpp",
"chars": 8193,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/camera.hpp",
"chars": 1599,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/color.cpp",
"chars": 2138,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/color.hpp",
"chars": 1070,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/config.cpp",
"chars": 4769,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/config.hpp",
"chars": 1452,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/configurable.cpp",
"chars": 341,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/configurable.hpp",
"chars": 514,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/dimension.cpp",
"chars": 733,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/dimension.hpp",
"chars": 366,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/distance.cpp",
"chars": 8038,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/distance.hpp",
"chars": 632,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/dynamic/faces.cpp",
"chars": 1561,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/dynamic/faces.hpp",
"chars": 1189,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/dynamic/mesh-intersection.cpp",
"chars": 935,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/dynamic/mesh-intersection.hpp",
"chars": 600,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/dynamic/mesh.cpp",
"chars": 33160,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/dynamic/mesh.hpp",
"chars": 4989,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/dynamic/octree.cpp",
"chars": 21062,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/dynamic/octree.hpp",
"chars": 1595,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/hash.hpp",
"chars": 785,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/history.cpp",
"chars": 4879,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/history.hpp",
"chars": 843,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/import-export.cpp",
"chars": 9737,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/import-export.hpp",
"chars": 529,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/intersection.cpp",
"chars": 15299,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/intersection.hpp",
"chars": 1820,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/isosurface-extraction/IsosurfaceExtractionConfigurations.hs",
"chars": 5316,
"preview": "{- This file is part of Dilay\n - Copyright © 2015-2018 Alexander Bau\n - Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/isosurface-extraction/grid.cpp",
"chars": 34104,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/isosurface-extraction/grid.hpp",
"chars": 1082,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/isosurface-extraction.cpp",
"chars": 8911,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/isosurface-extraction.hpp",
"chars": 845,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/kvstore.cpp",
"chars": 9929,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/kvstore.hpp",
"chars": 674,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/log.cpp",
"chars": 1875,
"preview": "#include <cstdarg>\n#include <cstdio>\n#include <ctime>\n#include <string>\n#include \"log.hpp\"\n#include \"util.hpp\"\n\nnamespac"
},
{
"path": "lib/src/log.hpp",
"chars": 396,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/macro.hpp",
"chars": 29989,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/maybe.hpp",
"chars": 2225,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/mesh-util.cpp",
"chars": 25430,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/mesh-util.hpp",
"chars": 769,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/mesh.cpp",
"chars": 14569,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/mesh.hpp",
"chars": 2684,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/mirror.cpp",
"chars": 4094,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/mirror.hpp",
"chars": 697,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/opengl-buffer-id.cpp",
"chars": 1066,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/opengl-buffer-id.hpp",
"chars": 436,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/opengl.cpp",
"chars": 11474,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/opengl.hpp",
"chars": 3588,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/primitive/aabox.cpp",
"chars": 1083,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/primitive/aabox.hpp",
"chars": 807,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/primitive/cone-sphere.cpp",
"chars": 1781,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/primitive/cone-sphere.hpp",
"chars": 1166,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/primitive/cone.cpp",
"chars": 1580,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/primitive/cone.hpp",
"chars": 1508,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/primitive/cylinder.cpp",
"chars": 814,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/primitive/cylinder.hpp",
"chars": 922,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/primitive/plane.cpp",
"chars": 1640,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/primitive/plane.hpp",
"chars": 951,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/primitive/ray.cpp",
"chars": 940,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/primitive/ray.hpp",
"chars": 835,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/primitive/sphere.cpp",
"chars": 846,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/primitive/sphere.hpp",
"chars": 761,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/primitive/triangle.cpp",
"chars": 1936,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/primitive/triangle.hpp",
"chars": 927,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/render-mode.cpp",
"chars": 2595,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/render-mode.hpp",
"chars": 842,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/renderer.cpp",
"chars": 8563,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/renderer.hpp",
"chars": 986,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/scene.cpp",
"chars": 11988,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/scene.hpp",
"chars": 2748,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/shader.cpp",
"chars": 14365,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/shader.hpp",
"chars": 627,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/sketch/bone-intersection.cpp",
"chars": 1129,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/sketch/bone-intersection.hpp",
"chars": 731,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/sketch/fwd.hpp",
"chars": 538,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/sketch/mesh-intersection.cpp",
"chars": 700,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/sketch/mesh-intersection.hpp",
"chars": 522,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/sketch/mesh.cpp",
"chars": 28294,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/sketch/mesh.hpp",
"chars": 2237,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/sketch/node-intersection.cpp",
"chars": 734,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/sketch/node-intersection.hpp",
"chars": 557,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/sketch/path-intersection.cpp",
"chars": 734,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/sketch/path-intersection.hpp",
"chars": 557,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/sketch/path.cpp",
"chars": 7629,
"preview": "#include \"../mesh.hpp\"\n#include \"intersection.hpp\"\n#include \"primitive/aabox.hpp\"\n#include \"primitive/plane.hpp\"\n#includ"
},
{
"path": "lib/src/sketch/path.hpp",
"chars": 1471,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/state.cpp",
"chars": 10937,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/state.hpp",
"chars": 1222,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/time-delta.cpp",
"chars": 2279,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/time-delta.hpp",
"chars": 434,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/convert-sketch.cpp",
"chars": 3413,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/delete-mesh.cpp",
"chars": 1189,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/delete-sketch.cpp",
"chars": 5053,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/edit-sketch.cpp",
"chars": 11814,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/key.hpp",
"chars": 651,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/move-camera.cpp",
"chars": 6856,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/move-camera.hpp",
"chars": 754,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/new-mesh.cpp",
"chars": 2814,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/remesh.cpp",
"chars": 13061,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/sculpt/crease.cpp",
"chars": 1966,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/sculpt/draw.cpp",
"chars": 2421,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/sculpt/flatten.cpp",
"chars": 2766,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/sculpt/grab.cpp",
"chars": 1624,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/sculpt/pinch.cpp",
"chars": 1480,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/sculpt/reduce.cpp",
"chars": 1484,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/sculpt/smooth.cpp",
"chars": 1505,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/sculpt/util/action.cpp",
"chars": 22736,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/sculpt/util/action.hpp",
"chars": 413,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/sculpt/util/brush.cpp",
"chars": 9858,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/sculpt/util/brush.hpp",
"chars": 4545,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/sculpt/util/edge-collection.cpp",
"chars": 1446,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/sculpt/util/edge-collection.hpp",
"chars": 1101,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/sculpt.cpp",
"chars": 13961,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/sculpt.hpp",
"chars": 2833,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/sketch-spheres.cpp",
"chars": 9330,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/transform-mesh.cpp",
"chars": 7407,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/trim-mesh/action.cpp",
"chars": 34475,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/trim-mesh/action.hpp",
"chars": 327,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/trim-mesh/border.cpp",
"chars": 3619,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/trim-mesh/border.hpp",
"chars": 1060,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/trim-mesh/split-mesh.cpp",
"chars": 5517,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/trim-mesh/split-mesh.hpp",
"chars": 339,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/trim-mesh.cpp",
"chars": 8566,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/util/movement.cpp",
"chars": 2932,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/util/movement.hpp",
"chars": 752,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/util/rotation.cpp",
"chars": 2568,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/util/rotation.hpp",
"chars": 709,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/util/scaling.cpp",
"chars": 3161,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/util/scaling.hpp",
"chars": 591,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/util/step.cpp",
"chars": 1193,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool/util/step.hpp",
"chars": 585,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool.cpp",
"chars": 12295,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tool.hpp",
"chars": 5614,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tools.hpp",
"chars": 1736,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/tree.hpp",
"chars": 4699,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/util.cpp",
"chars": 6697,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/util.hpp",
"chars": 4865,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/variant.hpp",
"chars": 10815,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/axis.cpp",
"chars": 6091,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/axis.hpp",
"chars": 518,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/color-button.cpp",
"chars": 1738,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/color-button.hpp",
"chars": 536,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/configuration.cpp",
"chars": 11142,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/configuration.hpp",
"chars": 343,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/context-menu.cpp",
"chars": 3796,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/context-menu.hpp",
"chars": 528,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/cursor.cpp",
"chars": 2821,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/cursor.hpp",
"chars": 668,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/double-slider.cpp",
"chars": 4350,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/double-slider.hpp",
"chars": 999,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/floor-plane.cpp",
"chars": 2496,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/floor-plane.hpp",
"chars": 614,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/gl-widget.cpp",
"chars": 7867,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/gl-widget.hpp",
"chars": 1141,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/info-pane/scene.cpp",
"chars": 4081,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/info-pane/scene.hpp",
"chars": 466,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/info-pane.cpp",
"chars": 2362,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/info-pane.hpp",
"chars": 628,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/input.cpp",
"chars": 5821,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/input.hpp",
"chars": 783,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/key-event.cpp",
"chars": 355,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/key-event.hpp",
"chars": 570,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/light.cpp",
"chars": 766,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/light.hpp",
"chars": 595,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/log.cpp",
"chars": 2286,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/log.hpp",
"chars": 350,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/main-window.cpp",
"chars": 1707,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/main-window.hpp",
"chars": 672,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/menu-bar.cpp",
"chars": 8347,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/menu-bar.hpp",
"chars": 328,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/pointing-event.cpp",
"chars": 2453,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/pointing-event.hpp",
"chars": 1410,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/resolution-slider.cpp",
"chars": 617,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/resolution-slider.hpp",
"chars": 466,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/shortcut.cpp",
"chars": 1524,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/shortcut.hpp",
"chars": 824,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/tool-pane.cpp",
"chars": 5767,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/tool-pane.hpp",
"chars": 778,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/tool-tip.cpp",
"chars": 1389,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/tool-tip.hpp",
"chars": 604,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/two-column-grid.cpp",
"chars": 3936,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/two-column-grid.hpp",
"chars": 931,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/util.cpp",
"chars": 9340,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/util.hpp",
"chars": 3554,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/vector-edit.cpp",
"chars": 1672,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/view/vector-edit.hpp",
"chars": 580,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/xml-conversion.cpp",
"chars": 4387,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
},
{
"path": "lib/src/xml-conversion.hpp",
"chars": 1046,
"preview": "/* This file is part of Dilay\n * Copyright © 2015-2018 Alexander Bau\n * Use and redistribute under the terms of the GNU "
}
]
// ... and 32 more files (download for full content)
About this extraction
This page contains the full source code of the abau/dilay GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 232 files (874.3 KB), approximately 251.1k tokens, and a symbol index with 1570 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.