本文整理汇总了C++中Dictionary函数的典型用法代码示例。如果您正苦于以下问题:C++ Dictionary函数的具体用法?C++ Dictionary怎么用?C++ Dictionary使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Dictionary函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Dictionary
void ILightingEngineFactory::add_common_params_metadata(
Dictionary& metadata,
const bool add_lighting_samples)
{
metadata.dictionaries().insert(
"enable_ibl",
Dictionary()
.insert("type", "bool")
.insert("default", "on")
.insert("label", "Enable IBL")
.insert("help", "Enable image-based lighting"));
if (add_lighting_samples)
{
metadata.dictionaries().insert(
"dl_light_samples",
Dictionary()
.insert("type", "float")
.insert("default", "1.0")
.insert("label", "Light Samples")
.insert("help", "Number of samples used to estimate direct lighting"));
metadata.dictionaries().insert(
"ibl_env_samples",
Dictionary()
.insert("type", "float")
.insert("default", "1.0")
.insert("label", "IBL Samples")
.insert("help", "Number of samples used to estimate environment lighting"));
}
}
示例2: Dictionary
DictionaryArray GradientEnvironmentEDFFactory::get_widget_definitions() const
{
DictionaryArray definitions;
definitions.push_back(
Dictionary()
.insert("name", "horizon_exitance")
.insert("label", "Horizon Exitance")
.insert("widget", "entity_picker")
.insert("entity_types",
Dictionary()
.insert("color", "Colors"))
.insert("use", "required")
.insert("default", ""));
definitions.push_back(
Dictionary()
.insert("name", "zenith_exitance")
.insert("label", "Zenith Exitance")
.insert("widget", "entity_picker")
.insert("entity_types",
Dictionary()
.insert("color", "Colors"))
.insert("use", "required")
.insert("default", ""));
return definitions;
}
示例3: Dictionary
DictionaryArray FisheyeLensCameraFactory::get_input_metadata() const
{
DictionaryArray metadata = CameraFactory::get_input_metadata();
CameraFactory::add_film_metadata(metadata);
CameraFactory::add_lens_metadata(metadata);
CameraFactory::add_clipping_metadata(metadata);
CameraFactory::add_shift_metadata(metadata);
metadata.push_back(
Dictionary()
.insert("name", "projection_type")
.insert("label", "Projection Type")
.insert("type", "enumeration")
.insert("items",
Dictionary()
.insert("Equisolid Angle", "equisolid_angle")
.insert("Equidistant", "equidistant")
.insert("Stereographic", "stereographic")
.insert("Thoby", "thoby"))
.insert("default", "equisolid_angle")
.insert("use", "required"));
return metadata;
}
示例4: TEST_F
TEST_F(AnimationAnimationV8Test, SpecifiedDurationGetter)
{
Vector<Dictionary, 0> jsKeyframes;
v8::Handle<v8::Object> timingInputWithDuration = v8::Object::New(m_isolate);
setV8ObjectPropertyAsNumber(timingInputWithDuration, "duration", 2.5);
Dictionary timingInputDictionaryWithDuration = Dictionary(v8::Handle<v8::Value>::Cast(timingInputWithDuration), m_isolate);
RefPtrWillBeRawPtr<Animation> animationWithDuration = createAnimation(element.get(), jsKeyframes, timingInputDictionaryWithDuration, exceptionState);
RefPtrWillBeRawPtr<AnimationNodeTiming> specifiedWithDuration = animationWithDuration->timing();
Nullable<double> numberDuration;
String stringDuration;
specifiedWithDuration->getDuration("duration", numberDuration, stringDuration);
EXPECT_FALSE(numberDuration.isNull());
EXPECT_EQ(2.5, numberDuration.get());
EXPECT_TRUE(stringDuration.isNull());
v8::Handle<v8::Object> timingInputNoDuration = v8::Object::New(m_isolate);
Dictionary timingInputDictionaryNoDuration = Dictionary(v8::Handle<v8::Value>::Cast(timingInputNoDuration), m_isolate);
RefPtrWillBeRawPtr<Animation> animationNoDuration = createAnimation(element.get(), jsKeyframes, timingInputDictionaryNoDuration, exceptionState);
RefPtrWillBeRawPtr<AnimationNodeTiming> specifiedNoDuration = animationNoDuration->timing();
Nullable<double> numberDuration2;
String stringDuration2;
specifiedNoDuration->getDuration("duration", numberDuration2, stringDuration2);
EXPECT_TRUE(numberDuration2.isNull());
EXPECT_FALSE(stringDuration2.isNull());
EXPECT_EQ("auto", stringDuration2);
}
示例5: Dictionary
DictionaryArray LambertianBRDFFactory::get_widget_definitions() const
{
DictionaryArray definitions;
definitions.push_back(
Dictionary()
.insert("name", "reflectance")
.insert("label", "Reflectance")
.insert("widget", "entity_picker")
.insert("entity_types",
Dictionary()
.insert("color", "Colors")
.insert("texture_instance", "Textures"))
.insert("use", "required")
.insert("default", ""));
definitions.push_back(
Dictionary()
.insert("name", "reflectance_multiplier")
.insert("label", "Reflectance Multiplier")
.insert("widget", "entity_picker")
.insert("entity_types",
Dictionary().insert("texture_instance", "Textures"))
.insert("use", "optional")
.insert("default", "1.0"));
return definitions;
}
示例6: Dictionary
PassRefPtr<EntrySync> WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemSyncURL(WorkerGlobalScope* worker, const String& url, ExceptionCode& ec)
{
ec = 0;
KURL completedURL = worker->completeURL(url);
ScriptExecutionContext* secureContext = worker->scriptExecutionContext();
if (!AsyncFileSystem::isAvailable() || !secureContext->securityOrigin()->canAccessFileSystem() || !secureContext->securityOrigin()->canRequest(completedURL)) {
ec = FileException::SECURITY_ERR;
return 0;
}
FileSystemType type;
String filePath;
if (!completedURL.isValid() || !DOMFileSystemBase::crackFileSystemURL(completedURL, type, filePath)) {
ec = FileException::ENCODING_ERR;
return 0;
}
FileSystemSyncCallbackHelper readFileSystemHelper;
LocalFileSystem::localFileSystem().readFileSystem(worker, type, FileSystemCallbacks::create(readFileSystemHelper.successCallback(), readFileSystemHelper.errorCallback(), worker, type), SynchronousFileSystem);
RefPtr<DOMFileSystemSync> fileSystem = readFileSystemHelper.getResult(ec);
if (!fileSystem)
return 0;
RefPtr<EntrySync> entry = fileSystem->root()->getDirectory(filePath, Dictionary(), ec);
if (ec == FileException::TYPE_MISMATCH_ERR)
return fileSystem->root()->getFile(filePath, Dictionary(), ec);
return entry.release();
}
示例7: Dictionary
DictionaryArray ObjectInstanceFactory::get_input_metadata()
{
DictionaryArray metadata;
metadata.push_back(
Dictionary()
.insert("name", "ray_bias_method")
.insert("label", "Ray Bias Method")
.insert("type", "enumeration")
.insert("items",
Dictionary()
.insert("No Ray Bias", "none")
.insert("Shift Along Surface Normal", "normal")
.insert("Shift Along Incoming Direction", "incoming_direction")
.insert("Shift Along Outgoing Direction", "outgoing_direction"))
.insert("use", "optional")
.insert("default", "none"));
metadata.push_back(
Dictionary()
.insert("name", "ray_bias_distance")
.insert("label", "Ray Bias Distance")
.insert("type", "text")
.insert("use", "optional")
.insert("default", "0.0"));
return metadata;
}
示例8: Dictionary
DictionaryArray SheenBRDFFactory::get_input_metadata() const
{
DictionaryArray metadata;
metadata.push_back(
Dictionary()
.insert("name", "reflectance")
.insert("label", "Reflectance")
.insert("type", "colormap")
.insert("entity_types",
Dictionary()
.insert("color", "Colors")
.insert("texture_instance", "Texture Instances"))
.insert("use", "required")
.insert("default", "0.5"));
metadata.push_back(
Dictionary()
.insert("name", "reflectance_multiplier")
.insert("label", "Reflectance Multiplier")
.insert("type", "colormap")
.insert("entity_types",
Dictionary().insert("texture_instance", "Texture Instances"))
.insert("use", "optional")
.insert("default", "1.0"));
return metadata;
}
示例9: Dictionary
DictionaryArray ConstantHemisphereEnvironmentEDFFactory::get_input_metadata() const
{
DictionaryArray metadata;
metadata.push_back(
Dictionary()
.insert("name", "upper_hemi_radiance")
.insert("label", "Upper Hemisphere Radiance")
.insert("type", "colormap")
.insert("entity_types",
Dictionary().insert("color", "Colors"))
.insert("use", "required")
.insert("default", "0.7")
.insert("help", "Upper hemisphere radiance"));
metadata.push_back(
Dictionary()
.insert("name", "lower_hemi_radiance")
.insert("label", "Lower Hemisphere Radiance")
.insert("type", "colormap")
.insert("entity_types",
Dictionary().insert("color", "Colors"))
.insert("use", "required")
.insert("default", "0.3")
.insert("help", "Lower hemisphere radiance"));
return metadata;
}
示例10: godot_variant_as_dictionary
godot_dictionary GDAPI godot_variant_as_dictionary(const godot_variant *p_self) {
godot_dictionary raw_dest;
const Variant *self = (const Variant *)p_self;
Dictionary *dest = (Dictionary *)&raw_dest;
memnew_placement(dest, Dictionary(self->operator Dictionary())); // operator = is overloaded by Dictionary
return raw_dest;
}
示例11: ERR_FAIL_COND
void ConnectionsDialog::_connect() {
TreeItem *it = tree->get_selected();
ERR_FAIL_COND(!it);
String signal=it->get_metadata(0).operator Dictionary()["name"];
NodePath dst_path=connect_dialog->get_dst_path();
Node *target = node->get_node(dst_path);
ERR_FAIL_COND(!target);
StringName dst_method=connect_dialog->get_dst_method();
bool defer=connect_dialog->get_deferred();
Vector<Variant> binds = connect_dialog->get_binds();
StringArray args = it->get_metadata(0).operator Dictionary()["args"];
undo_redo->create_action("Connect '"+signal+"' to '"+String(dst_method)+"'");
undo_redo->add_do_method(node,"connect",signal,target,dst_method,binds,CONNECT_PERSIST | (defer?CONNECT_DEFERRED:0));
undo_redo->add_undo_method(node,"disconnect",signal,target,dst_method);
undo_redo->add_do_method(this,"update_tree");
undo_redo->add_undo_method(this,"update_tree");
undo_redo->commit_action();
if (connect_dialog->get_make_callback()) {
print_line("request connect");
editor->emit_signal("script_add_function_request",target,dst_method,args);
hide();
}
update_tree();
}
示例12: Dictionary
DictionaryArray ConstantHemisphereEnvironmentEDFFactory::get_widget_definitions() const
{
DictionaryArray definitions;
definitions.push_back(
Dictionary()
.insert("name", "upper_hemi_exitance")
.insert("label", "Upper Hemisphere Exitance")
.insert("widget", "entity_picker")
.insert("entity_types",
Dictionary().insert("color", "Colors"))
.insert("use", "required")
.insert("default", ""));
definitions.push_back(
Dictionary()
.insert("name", "lower_hemi_exitance")
.insert("label", "Lower Hemisphere Exitance")
.insert("widget", "entity_picker")
.insert("entity_types",
Dictionary().insert("color", "Colors"))
.insert("use", "required")
.insert("default", ""));
return definitions;
}
示例13: Dictionary
void IEDFFactory::add_common_input_metadata(DictionaryArray& metadata)
{
metadata.push_back(
Dictionary()
.insert("name", "cast_indirect_light")
.insert("label", "Cast Indirect Light")
.insert("type", "boolean")
.insert("use", "optional")
.insert("default", "true"));
metadata.push_back(
Dictionary()
.insert("name", "importance_multiplier")
.insert("label", "Importance Multiplier")
.insert("type", "numeric")
.insert("min_value", "0.0")
.insert("max_value", "10.0")
.insert("use", "optional")
.insert("default", "1.0"));
metadata.push_back(
Dictionary()
.insert("name", "light_near_start")
.insert("label", "Light Near Start")
.insert("type", "numeric")
.insert("min_value", "0.0")
.insert("max_value", "10.0")
.insert("use", "optional")
.insert("default", "0.0"));
}
示例14: a
namespace casadi {
/**
\ingroup expression_tools
@{
*/
/** \brief Solve a system of equations: A*x = b
The solve routine works similar to Matlab's backslash when A is square and nonsingular.
The algorithm used is the following:
1. A simple forward or backward substitution if A is upper or lower triangular
2. If the linear system is at most 3-by-3, form the inverse via minor expansion and multiply
3. Permute the variables and equations as to get a (structurally) nonzero diagonal,
then perform a QR factorization without pivoting and solve the factorized system.
Note 1: If there are entries of the linear system known to be zero, these will be removed.
Elements that are very small, or will evaluate to be zero, can still cause numerical errors,
due to the lack of pivoting (which is not possible since cannot compare the size of entries)
Note 2: When permuting the linear system, a BLT (block lower triangular) transformation is
formed. Only the permutation part of this is however used. An improvement would be to solve
block-by-block if there are multiple BLT blocks.
*/
template<typename DataType>
Matrix<DataType> solve(const Matrix<DataType>& A, const Matrix<DataType>& b) {
return A.zz_solve(b);
}
/** \brief Computes the Moore-Penrose pseudo-inverse
*
* If the matrix A is fat (size2>size1), mul(A, pinv(A)) is unity.
* If the matrix A is slender (size1<size2), mul(pinv(A), A) is unity.
*
*/
template<typename DataType>
Matrix<DataType> pinv(const Matrix<DataType>& A) { return A.zz_pinv();}
/** \brief Solve a system of equations: A*x = b
*/
CASADI_EXPORT Matrix<double> solve(const Matrix<double>& A, const Matrix<double>& b,
const std::string& lsolver,
const Dictionary& dict = Dictionary());
/** \brief Computes the Moore-Penrose pseudo-inverse
*
* If the matrix A is fat (size1>size2), mul(A, pinv(A)) is unity.
* If the matrix A is slender (size2<size1), mul(pinv(A), A) is unity.
*
*/
CASADI_EXPORT Matrix<double> pinv(const Matrix<double>& A, const std::string& lsolver,
const Dictionary& dict = Dictionary());
/*
@}
*/
} // namespace casadi
示例15: TEST_F
TEST_F(AnimationAnimationTest, CanCreateAnAnimation)
{
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope scope(isolate);
v8::Local<v8::Context> context = v8::Context::New(isolate);
v8::Context::Scope contextScope(context);
Vector<Dictionary> jsKeyframes;
v8::Handle<v8::Object> keyframe1 = v8::Object::New(isolate);
v8::Handle<v8::Object> keyframe2 = v8::Object::New(isolate);
setV8ObjectPropertyAsString(keyframe1, "width", "100px");
setV8ObjectPropertyAsString(keyframe1, "offset", "0");
setV8ObjectPropertyAsString(keyframe1, "easing", "ease-in-out");
setV8ObjectPropertyAsString(keyframe2, "width", "0px");
setV8ObjectPropertyAsString(keyframe2, "offset", "1");
setV8ObjectPropertyAsString(keyframe2, "easing", "cubic-bezier(1, 1, 0.3, 0.3)");
jsKeyframes.append(Dictionary(keyframe1, isolate));
jsKeyframes.append(Dictionary(keyframe2, isolate));
String value1;
ASSERT_TRUE(jsKeyframes[0].get("width", value1));
ASSERT_EQ("100px", value1);
String value2;
ASSERT_TRUE(jsKeyframes[1].get("width", value2));
ASSERT_EQ("0px", value2);
RefPtr<Animation> animation = createAnimation(element.get(), jsKeyframes, 0);
Element* target = animation->target();
EXPECT_EQ(*element.get(), *target);
const KeyframeEffectModel::KeyframeVector keyframes =
toKeyframeEffectModel(animation->effect())->getFrames();
EXPECT_EQ(0, keyframes[0]->offset());
EXPECT_EQ(1, keyframes[1]->offset());
const AnimatableValue* keyframe1Width = keyframes[0]->propertyValue(CSSPropertyWidth);
const AnimatableValue* keyframe2Width = keyframes[1]->propertyValue(CSSPropertyWidth);
ASSERT(keyframe1Width);
ASSERT(keyframe2Width);
EXPECT_TRUE(keyframe1Width->isLength());
EXPECT_TRUE(keyframe2Width->isLength());
EXPECT_EQ("100px", toAnimatableLength(keyframe1Width)->toCSSValue()->cssText());
EXPECT_EQ("0px", toAnimatableLength(keyframe2Width)->toCSSValue()->cssText());
EXPECT_EQ(*(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseInOut)), *keyframes[0]->easing());
EXPECT_EQ(*(CubicBezierTimingFunction::create(1, 1, 0.3, 0.3).get()), *keyframes[1]->easing());
}