NDEVR
API Documentation
ColorChannelCombo.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: NDEVR
28File: ColorChannelCombo
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/QTDesignObject.h>
34#include <NDEVR/QCustomComboBox.h>
35
36namespace NDEVR
37{
41 class ColorChannelCombo : public QObject
42 {
43 Q_OBJECT
44 public:
67 void setUVType(const UVType& target);
72 void setHasDefault(bool has_default);
77 void setHasSolidColor(bool has_solid_color);
89 virtual bool eventFilter(QObject *watched, QEvent *event);
98 void refreshFromMaterial(const Material& mat);
103 void setAlwaysAllowImage(bool always_allow_image);
108 bool isSetToImage() const;
109 protected:
113 void init();
114 private slots:
118 void onTargetUpdatedSlot();
122 void onComboChanged();
126 void updateItems();
127 signals:
140 protected:
150 bool m_always_allow_image = false;
152 };
153}
DesignParameter currentParameter() const
Returns the currently selected design parameter for the color channel.
void refreshFromModel()
Refreshes the combo state from the current model data.
TimeSpan m_animation_time
Duration of color transition animations.
bool m_has_solid_color
Whether a solid color option is available.
UVType m_uv_type
The UV type being configured.
void setHasDefault(bool has_default)
Sets whether a default option is available in the combo.
ColorChannelCombo(const DynamicPointer< QTDesignObject > &target, QCustomComboBox *combo)
Constructs a ColorChannelCombo with a target design object and combo box.
void setHasSolidColor(bool has_solid_color)
Sets whether a solid color option is available in the combo.
void init()
Initializes the combo box items and signal connections.
bool m_has_contrast_color
Whether a contrast color option is available.
bool m_has_default
Whether a default option is available.
void setUVType(const UVType &target)
Sets the UV type for color channel configuration.
bool m_has_image
Whether an image coloring option is available.
void refreshFromMaterial(const Material &mat)
Refreshes the combo state from the given material.
void computedColorChosenSignal()
Emitted when computed color mode is chosen.
void setTarget(const DynamicPointer< QTDesignObject > &target)
Sets the target design object for color channel selection.
void setAlwaysAllowImage(bool always_allow_image)
Sets whether the image option is always available regardless of data.
bool m_has_color_by_model
Whether a color-by-model option is available.
void solidColorChosenSignal()
Emitted when solid color mode is chosen.
QCustomComboBox * m_combo
The combo box widget for selection.
ColorChannelCombo(const DynamicPointer< QTDesignObject > &target, UVType uv, QCustomComboBox *combo)
Constructs a ColorChannelCombo with a target, UV type, and combo box.
DynamicPointer< QTDesignObject > m_target
The target design object for color configuration.
void colorChannelChosenSignal()
Emitted when a specific color channel is chosen.
bool isSetToImage() const
Returns whether the current selection is set to image mode.
bool m_always_allow_image
Whether the image option is always shown.
bool m_needs_item_refresh
Whether the combo items need to be refreshed.
virtual bool eventFilter(QObject *watched, QEvent *event)
Filters events for the combo box to handle custom interactions.
A definition of data that is logically stored in the Model hierarchy.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
Definition Material.h:153
A compact way to present a list of options to the user.
Stores a time span, or difference between two times, with an optional start time.
Definition TimeSpan.h:46
The primary namespace for the NDEVR SDK.
UVType
Channels that describe how an object should interact with light.