hexsha stringlengths 40 40 | size int64 7 1.05M | ext stringclasses 13 values | lang stringclasses 1 value | max_stars_repo_path stringlengths 4 269 | max_stars_repo_name stringlengths 5 109 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 9 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 269 | max_issues_repo_name stringlengths 5 116 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 9 | max_issues_count int64 1 48.5k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 269 | max_forks_repo_name stringlengths 5 116 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 9 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 7 1.05M | avg_line_length float64 1.21 330k | max_line_length int64 6 990k | alphanum_fraction float64 0.01 0.99 | author_id stringlengths 2 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4b78a561e47fe37063b4d7b32c57d9033532bfb0 | 1,415 | cpp | C++ | examples/EnsembledCrash.cpp | acpaquette/deepstate | 6acf07ad5dd95c9e8b970ca516ab93aa2620ea6e | [
"Apache-2.0"
] | 684 | 2018-02-18T18:04:23.000Z | 2022-03-26T06:18:39.000Z | examples/EnsembledCrash.cpp | acpaquette/deepstate | 6acf07ad5dd95c9e8b970ca516ab93aa2620ea6e | [
"Apache-2.0"
] | 273 | 2018-02-18T04:01:36.000Z | 2022-02-09T16:07:38.000Z | examples/EnsembledCrash.cpp | acpaquette/deepstate | 6acf07ad5dd95c9e8b970ca516ab93aa2620ea6e | [
"Apache-2.0"
] | 77 | 2018-02-19T00:18:33.000Z | 2022-03-16T04:12:09.000Z | /*
* Copyright (c) 2019 Trail of Bits, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <deepstate/DeepState.hpp>
using namespace deepstate;
DEEPSTATE_NOINLINE static void segfault(char *first, char* second) {
std::size_t hashed = std::hash<std::string>{}(first);
std::size_t hashed2 = std::hash<std::string>{}(second);
unsigned *p = NULL;
if (hashed == 7169420828666634849U) {
if (hashed2 == 10753164746288518855U) {
*(p+2) = 0xdeadbeef; /* crash */
}
printf("BOM\n");
}
}
TEST(SimpleCrash, SegFault) {
char *first = (char*)DeepState_CStr_C(9, 0);
char *second = (char*)DeepState_CStr_C(9, 0);
for (int i = 0; i < 9; ++i)
printf("%02x", (unsigned char)first[i]);
printf("\n");
for (int i = 0; i < 9; ++i)
printf("%02x", (unsigned char)second[i]);
segfault(first, second);
ASSERT_EQ(first, first);
ASSERT_NE(first, second);
}
| 28.877551 | 75 | 0.671378 | acpaquette |
4b7dbe4c07d1aea493805c6e9c7c0557ee55ed6c | 1,898 | hpp | C++ | src/bindings/cpp/include/kdbplugin.hpp | pinotree/libelektra | 77696c82bea2ca58ac1636df58f3dcb06b028228 | [
"BSD-3-Clause"
] | null | null | null | src/bindings/cpp/include/kdbplugin.hpp | pinotree/libelektra | 77696c82bea2ca58ac1636df58f3dcb06b028228 | [
"BSD-3-Clause"
] | null | null | null | src/bindings/cpp/include/kdbplugin.hpp | pinotree/libelektra | 77696c82bea2ca58ac1636df58f3dcb06b028228 | [
"BSD-3-Clause"
] | null | null | null | /**
* @file
*
* @brief Helpers for creating plugins
*
* Make sure to include kdberrors.h before including this file if you want
* warnings/errors to be added.
*
* Proper usage:
* @code
using namespace ckdb;
#include <kdberrors.h>
#include <kdbplugin.hpp>
typedef Delegator<elektra::YourPluginClass> YPC;
// then e.g. YPC::open(handle, errorKey);
* @endcode
*
* @copyright BSD License (see doc/COPYING or http://www.libelektra.org)
*
*/
#ifndef KDBPLUGIN_HPP
#define KDBPLUGIN_HPP
#include <kdbplugin.h>
#include <key.hpp>
#include <keyset.hpp>
template <typename Delegated>
class Delegator
{
public:
typedef Delegated * (*Builder) (kdb::KeySet config);
inline static Delegated * defaultBuilder (kdb::KeySet config)
{
return new Delegated (config);
}
inline static int open (ckdb::Plugin * handle, ckdb::Key * errorKey, Builder builder = defaultBuilder)
{
kdb::KeySet config (elektraPluginGetConfig (handle));
int ret = openHelper (handle, config, errorKey, builder);
config.release ();
return ret;
}
inline static int close (ckdb::Plugin * handle, ckdb::Key *)
{
delete get (handle);
return 1; // always successfully
}
inline static Delegated * get (ckdb::Plugin * handle)
{
return static_cast<Delegated *> (elektraPluginGetData (handle));
}
private:
/**This function avoid that every return path need to release the
* configuration. */
inline static int openHelper (ckdb::Plugin * handle, kdb::KeySet & config, ckdb::Key * errorKey, Builder builder)
{
if (config.lookup ("/module"))
{
// suppress warnings if it is just a module
// don't buildup the Delegated then
return 0;
}
try
{
elektraPluginSetData (handle, (*builder) (config));
}
catch (const char * msg)
{
#ifdef KDBERRORS_H
ELEKTRA_ADD_WARNING (69, errorKey, msg);
#endif
return -1;
}
return get (handle) != nullptr ? 1 : -1;
}
};
#endif
| 21.325843 | 114 | 0.689146 | pinotree |
4b7ede277a45c884ce5e14d1107c6e531948d4ab | 371 | cpp | C++ | C++ Contribution/Possible Combination Problem.cpp | katsuNakajima/Hacktoberfest | ecd09627c5ca2defd08d048d11b5660a78df481c | [
"MIT"
] | 1 | 2021-10-31T11:28:29.000Z | 2021-10-31T11:28:29.000Z | C++ Contribution/Possible Combination Problem.cpp | katsuNakajima/Hacktoberfest | ecd09627c5ca2defd08d048d11b5660a78df481c | [
"MIT"
] | 1 | 2021-11-13T18:27:21.000Z | 2021-11-13T18:27:21.000Z | C++ Contribution/Possible Combination Problem.cpp | katsuNakajima/Hacktoberfest | ecd09627c5ca2defd08d048d11b5660a78df481c | [
"MIT"
] | 1 | 2021-10-31T11:28:31.000Z | 2021-10-31T11:28:31.000Z | #include <iostream>
using namespace std;
int main()
{
int factorial = 1;
int num1,num2,arrangements,i;
cout<<"Enter Number of Guests: ";
cin>>num1;
cout<<"Enter Number of Chairs: ";
cin>>num2;
for (i = 1; i<=num1; i++)
{
factorial = factorial*i;
}
arrangements = factorial/(num1-num2);
cout<<"Possible Arrangments : "<<arrangements;
return 0;
}
| 19.526316 | 51 | 0.638814 | katsuNakajima |
4b8a4fcb6b3238e3a5ba1d952f252cdb7c03851a | 33,701 | cpp | C++ | export/release/macos/obj/src/FirstBootState.cpp | BushsHaxs/DOKIDOKI-MAC | 22729124a0b7b637d56ff3b18acb555ec05934f1 | [
"Apache-2.0"
] | null | null | null | export/release/macos/obj/src/FirstBootState.cpp | BushsHaxs/DOKIDOKI-MAC | 22729124a0b7b637d56ff3b18acb555ec05934f1 | [
"Apache-2.0"
] | null | null | null | export/release/macos/obj/src/FirstBootState.cpp | BushsHaxs/DOKIDOKI-MAC | 22729124a0b7b637d56ff3b18acb555ec05934f1 | [
"Apache-2.0"
] | 1 | 2021-12-11T09:19:29.000Z | 2021-12-11T09:19:29.000Z | #include <hxcpp.h>
#ifndef INCLUDED_Controls
#include <Controls.h>
#endif
#ifndef INCLUDED_CoolUtil
#include <CoolUtil.h>
#endif
#ifndef INCLUDED_FirstBootState
#include <FirstBootState.h>
#endif
#ifndef INCLUDED_LangUtil
#include <LangUtil.h>
#endif
#ifndef INCLUDED_MusicBeatState
#include <MusicBeatState.h>
#endif
#ifndef INCLUDED_Paths
#include <Paths.h>
#endif
#ifndef INCLUDED_PlayerSettings
#include <PlayerSettings.h>
#endif
#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_TitleState
#include <TitleState.h>
#endif
#ifndef INCLUDED_flixel_FlxBasic
#include <flixel/FlxBasic.h>
#endif
#ifndef INCLUDED_flixel_FlxG
#include <flixel/FlxG.h>
#endif
#ifndef INCLUDED_flixel_FlxGame
#include <flixel/FlxGame.h>
#endif
#ifndef INCLUDED_flixel_FlxObject
#include <flixel/FlxObject.h>
#endif
#ifndef INCLUDED_flixel_FlxSprite
#include <flixel/FlxSprite.h>
#endif
#ifndef INCLUDED_flixel_FlxState
#include <flixel/FlxState.h>
#endif
#ifndef INCLUDED_flixel_addons_display_FlxBackdrop
#include <flixel/addons/display/FlxBackdrop.h>
#endif
#ifndef INCLUDED_flixel_addons_transition_FlxTransitionableState
#include <flixel/addons/transition/FlxTransitionableState.h>
#endif
#ifndef INCLUDED_flixel_addons_transition_TransitionData
#include <flixel/addons/transition/TransitionData.h>
#endif
#ifndef INCLUDED_flixel_addons_ui_FlxUIState
#include <flixel/addons/ui/FlxUIState.h>
#endif
#ifndef INCLUDED_flixel_addons_ui_interfaces_IEventGetter
#include <flixel/addons/ui/interfaces/IEventGetter.h>
#endif
#ifndef INCLUDED_flixel_addons_ui_interfaces_IFlxUIState
#include <flixel/addons/ui/interfaces/IFlxUIState.h>
#endif
#ifndef INCLUDED_flixel_effects_FlxFlicker
#include <flixel/effects/FlxFlicker.h>
#endif
#ifndef INCLUDED_flixel_group_FlxTypedGroup
#include <flixel/group/FlxTypedGroup.h>
#endif
#ifndef INCLUDED_flixel_input_actions_FlxAction
#include <flixel/input/actions/FlxAction.h>
#endif
#ifndef INCLUDED_flixel_input_actions_FlxActionDigital
#include <flixel/input/actions/FlxActionDigital.h>
#endif
#ifndef INCLUDED_flixel_input_actions_FlxActionSet
#include <flixel/input/actions/FlxActionSet.h>
#endif
#ifndef INCLUDED_flixel_system_FlxSound
#include <flixel/system/FlxSound.h>
#endif
#ifndef INCLUDED_flixel_system_FlxSoundGroup
#include <flixel/system/FlxSoundGroup.h>
#endif
#ifndef INCLUDED_flixel_system_frontEnds_SoundFrontEnd
#include <flixel/system/frontEnds/SoundFrontEnd.h>
#endif
#ifndef INCLUDED_flixel_text_FlxText
#include <flixel/text/FlxText.h>
#endif
#ifndef INCLUDED_flixel_text_FlxTextBorderStyle
#include <flixel/text/FlxTextBorderStyle.h>
#endif
#ifndef INCLUDED_flixel_tweens_FlxEase
#include <flixel/tweens/FlxEase.h>
#endif
#ifndef INCLUDED_flixel_tweens_FlxTween
#include <flixel/tweens/FlxTween.h>
#endif
#ifndef INCLUDED_flixel_tweens_misc_VarTween
#include <flixel/tweens/misc/VarTween.h>
#endif
#ifndef INCLUDED_flixel_util_FlxAxes
#include <flixel/util/FlxAxes.h>
#endif
#ifndef INCLUDED_flixel_util_FlxSave
#include <flixel/util/FlxSave.h>
#endif
#ifndef INCLUDED_flixel_util_FlxTimer
#include <flixel/util/FlxTimer.h>
#endif
#ifndef INCLUDED_flixel_util_FlxTimerManager
#include <flixel/util/FlxTimerManager.h>
#endif
#ifndef INCLUDED_flixel_util_IFlxDestroyable
#include <flixel/util/IFlxDestroyable.h>
#endif
#ifndef INCLUDED_haxe_Log
#include <haxe/Log.h>
#endif
#ifndef INCLUDED_openfl_display_DisplayObject
#include <openfl/display/DisplayObject.h>
#endif
#ifndef INCLUDED_openfl_display_DisplayObjectContainer
#include <openfl/display/DisplayObjectContainer.h>
#endif
#ifndef INCLUDED_openfl_display_IBitmapDrawable
#include <openfl/display/IBitmapDrawable.h>
#endif
#ifndef INCLUDED_openfl_display_InteractiveObject
#include <openfl/display/InteractiveObject.h>
#endif
#ifndef INCLUDED_openfl_display_Sprite
#include <openfl/display/Sprite.h>
#endif
#ifndef INCLUDED_openfl_events_EventDispatcher
#include <openfl/events/EventDispatcher.h>
#endif
#ifndef INCLUDED_openfl_events_IEventDispatcher
#include <openfl/events/IEventDispatcher.h>
#endif
#ifndef INCLUDED_openfl_utils_Assets
#include <openfl/utils/Assets.h>
#endif
HX_DEFINE_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_14_new,"FirstBootState","new",0xcc85d6c1,"FirstBootState.new","FirstBootState.hx",14,0xeb1afbcf)
HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_30_create,"FirstBootState","create",0x1282d33b,"FirstBootState.create","FirstBootState.hx",30,0xeb1afbcf)
HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_68_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",68,0xeb1afbcf)
HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_79_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",79,0xeb1afbcf)
HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_111_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",111,0xeb1afbcf)
HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_125_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",125,0xeb1afbcf)
HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_130_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",130,0xeb1afbcf)
HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_137_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",137,0xeb1afbcf)
HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_151_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",151,0xeb1afbcf)
HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_146_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",146,0xeb1afbcf)
HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_165_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",165,0xeb1afbcf)
HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_160_update,"FirstBootState","update",0x1d78f248,"FirstBootState.update","FirstBootState.hx",160,0xeb1afbcf)
HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_187_bringinthenote,"FirstBootState","bringinthenote",0xc451778b,"FirstBootState.bringinthenote","FirstBootState.hx",187,0xeb1afbcf)
HX_LOCAL_STACK_FRAME(_hx_pos_58e96fb3db9ff2e7_178_bringinthenote,"FirstBootState","bringinthenote",0xc451778b,"FirstBootState.bringinthenote","FirstBootState.hx",178,0xeb1afbcf)
void FirstBootState_obj::__construct( ::flixel::addons::transition::TransitionData TransIn, ::flixel::addons::transition::TransitionData TransOut){
HX_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_14_new)
HXLINE( 65) this->selectedSomethin = false;
HXLINE( 21) this->curSelected = 0;
HXLINE( 19) this->selectedsomething = false;
HXLINE( 17) this->localeList = ::Array_obj< ::String >::__new(0);
HXLINE( 16) this->textMenuItems = ::Array_obj< ::String >::__new(0);
HXLINE( 14) super::__construct(TransIn,TransOut);
}
Dynamic FirstBootState_obj::__CreateEmpty() { return new FirstBootState_obj; }
void *FirstBootState_obj::_hx_vtable = 0;
Dynamic FirstBootState_obj::__Create(::hx::DynamicArray inArgs)
{
::hx::ObjectPtr< FirstBootState_obj > _hx_result = new FirstBootState_obj();
_hx_result->__construct(inArgs[0],inArgs[1]);
return _hx_result;
}
bool FirstBootState_obj::_hx_isInstanceOf(int inClassId) {
if (inClassId<=(int)0x3f706236) {
if (inClassId<=(int)0x23a57bae) {
if (inClassId<=(int)0x0430f5d7) {
return inClassId==(int)0x00000001 || inClassId==(int)0x0430f5d7;
} else {
return inClassId==(int)0x23a57bae;
}
} else {
return inClassId==(int)0x2f064378 || inClassId==(int)0x3f706236;
}
} else {
if (inClassId<=(int)0x7c795c9f) {
return inClassId==(int)0x62817b24 || inClassId==(int)0x7c795c9f;
} else {
return inClassId==(int)0x7ccf8994;
}
}
}
void FirstBootState_obj::create(){
HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_30_create)
HXLINE( 31) this->persistentUpdate = (this->persistentDraw = true);
HXLINE( 33) ::String library = null();
HXDLIN( 33) ::String languageList = ::Paths_obj::getPath((HX_("locale/languageList",ab,12,e4,2d) + HX_(".txt",02,3f,c0,1e)),HX_("TEXT",ad,94,ba,37),library);
HXDLIN( 33) ::Array< ::String > languageList1 = ::CoolUtil_obj::coolTextFile(languageList);
HXLINE( 35) {
HXLINE( 35) int _g = 0;
HXDLIN( 35) int _g1 = languageList1->length;
HXDLIN( 35) while((_g < _g1)){
HXLINE( 35) _g = (_g + 1);
HXDLIN( 35) int i = (_g - 1);
HXLINE( 37) ::Array< ::String > data = languageList1->__get(i).split(HX_(":",3a,00,00,00));
HXLINE( 38) this->textMenuItems->push(data->__get(0));
HXLINE( 39) this->localeList->push(data->__get(1));
}
}
HXLINE( 42) ::flixel::FlxSprite _hx_tmp = ::flixel::FlxSprite_obj::__alloc( HX_CTX ,-80,null(),null());
HXDLIN( 42) ::String library1 = null();
HXDLIN( 42) ::String _hx_tmp1 = ::Paths_obj::getPath(((HX_("images/",77,50,74,c1) + HX_("menuBG",24,65,6d,05)) + HX_(".png",3b,2d,bd,1e)),HX_("IMAGE",3b,57,57,3b),library1);
HXDLIN( 42) this->bg = _hx_tmp->loadGraphic(_hx_tmp1,null(),null(),null(),null(),null());
HXLINE( 43) ::flixel::FlxSprite _hx_tmp2 = this->bg;
HXDLIN( 43) _hx_tmp2->setGraphicSize(::Std_obj::_hx_int((this->bg->get_width() * ((Float)1.1))),null());
HXLINE( 44) this->bg->updateHitbox();
HXLINE( 45) this->bg->screenCenter(null());
HXLINE( 46) this->bg->set_antialiasing(true);
HXLINE( 47) this->add(this->bg);
HXLINE( 49) this->grpOptionsTexts = ::flixel::group::FlxTypedGroup_obj::__alloc( HX_CTX ,null());
HXLINE( 50) this->add(this->grpOptionsTexts);
HXLINE( 52) {
HXLINE( 52) int _g2 = 0;
HXDLIN( 52) int _g3 = this->textMenuItems->length;
HXDLIN( 52) while((_g2 < _g3)){
HXLINE( 52) _g2 = (_g2 + 1);
HXDLIN( 52) int i = (_g2 - 1);
HXLINE( 54) ::flixel::text::FlxText optionText = ::flixel::text::FlxText_obj::__alloc( HX_CTX ,0,(50 + (i * 50)),0,this->textMenuItems->__get(i),null(),null());
HXLINE( 55) optionText->setFormat(::LangUtil_obj::getFont(HX_("riffic",51,90,7b,4d)),32,-1,HX_("center",d5,25,db,05),null(),null(),null());
HXLINE( 56) optionText->screenCenter(::flixel::util::FlxAxes_obj::X_dyn());
HXLINE( 57) optionText->set_antialiasing(true);
HXLINE( 58) optionText->ID = i;
HXLINE( 59) this->grpOptionsTexts->add(optionText).StaticCast< ::flixel::text::FlxText >();
}
}
HXLINE( 62) this->super::create();
}
void FirstBootState_obj::update(Float elapsed){
HX_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_68_update)
HXDLIN( 68) ::FirstBootState _gthis = ::hx::ObjectPtr<OBJ_>(this);
HXLINE( 69) bool _hx_tmp;
HXDLIN( 69) if (::hx::IsNotNull( ::flixel::FlxG_obj::sound->music )) {
HXLINE( 69) _hx_tmp = (::flixel::FlxG_obj::sound->music->_volume > 0);
}
else {
HXLINE( 69) _hx_tmp = false;
}
HXDLIN( 69) if (_hx_tmp) {
HXLINE( 70) ::flixel::_hx_system::FlxSound fh = ::flixel::FlxG_obj::sound->music;
HXDLIN( 70) fh->set_volume((fh->_volume - (((Float)0.25) * ::flixel::FlxG_obj::elapsed)));
}
HXLINE( 72) this->super::update(elapsed);
HXLINE( 74) bool _hx_tmp1;
HXDLIN( 74) bool _hx_tmp2;
HXDLIN( 74) if (::PlayerSettings_obj::player1->controls->_accept->check()) {
HXLINE( 74) _hx_tmp2 = this->selectedSomethin;
}
else {
HXLINE( 74) _hx_tmp2 = false;
}
HXDLIN( 74) if (_hx_tmp2) {
HXLINE( 74) _hx_tmp1 = !(this->selectedsomething);
}
else {
HXLINE( 74) _hx_tmp1 = false;
}
HXDLIN( 74) if (_hx_tmp1) {
HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_0, ::FirstBootState,_gthis) HXARGC(1)
void _hx_run( ::flixel::tweens::FlxTween twn){
HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_79_update)
HXLINE( 80) _gthis->funnynote->kill();
HXLINE( 82) {
HXLINE( 82) ::flixel::FlxState nextState = ::TitleState_obj::__alloc( HX_CTX ,null(),null());
HXDLIN( 82) if (::flixel::FlxG_obj::game->_state->switchTo(nextState)) {
HXLINE( 82) ::flixel::FlxG_obj::game->_requestedState = nextState;
}
}
}
HX_END_LOCAL_FUNC1((void))
HXLINE( 76) ::flixel::tweens::FlxTween_obj::tween(this->funnynote, ::Dynamic(::hx::Anon_obj::Create(1)
->setFixed(0,HX_("alpha",5e,a7,96,21),0)),2, ::Dynamic(::hx::Anon_obj::Create(2)
->setFixed(0,HX_("ease",ee,8b,0c,43),::flixel::tweens::FlxEase_obj::quadOut_dyn())
->setFixed(1,HX_("onComplete",f8,d4,7e,5d), ::Dynamic(new _hx_Closure_0(_gthis)))));
}
HXLINE( 90) if (!(this->selectedSomethin)) {
HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_1, ::FirstBootState,_gthis) HXARGC(1)
void _hx_run( ::flixel::text::FlxText txt){
HX_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_111_update)
HXLINE( 112) {
HXLINE( 112) txt->set_borderStyle(::flixel::text::FlxTextBorderStyle_obj::OUTLINE_dyn());
HXDLIN( 112) txt->set_borderColor(-33537);
HXDLIN( 112) txt->set_borderSize(( (Float)(2) ));
HXDLIN( 112) txt->set_borderQuality(( (Float)(1) ));
}
HXLINE( 114) if ((txt->ID == _gthis->curSelected)) {
HXLINE( 115) txt->set_borderStyle(::flixel::text::FlxTextBorderStyle_obj::OUTLINE_dyn());
HXDLIN( 115) txt->set_borderColor(-12289);
HXDLIN( 115) txt->set_borderSize(( (Float)(2) ));
HXDLIN( 115) txt->set_borderQuality(( (Float)(1) ));
}
}
HX_END_LOCAL_FUNC1((void))
HXLINE( 92) if (::PlayerSettings_obj::player1->controls->_upP->check()) {
HXLINE( 94) ::flixel::_hx_system::frontEnds::SoundFrontEnd _hx_tmp = ::flixel::FlxG_obj::sound;
HXDLIN( 94) _hx_tmp->play(::Paths_obj::sound(HX_("scrollMenu",4c,d4,18,06),null()),null(),null(),null(),null(),null());
HXLINE( 95) ::FirstBootState _hx_tmp1 = ::hx::ObjectPtr<OBJ_>(this);
HXDLIN( 95) _hx_tmp1->curSelected = (_hx_tmp1->curSelected - 1);
}
HXLINE( 98) if (::PlayerSettings_obj::player1->controls->_downP->check()) {
HXLINE( 100) ::flixel::_hx_system::frontEnds::SoundFrontEnd _hx_tmp = ::flixel::FlxG_obj::sound;
HXDLIN( 100) _hx_tmp->play(::Paths_obj::sound(HX_("scrollMenu",4c,d4,18,06),null()),null(),null(),null(),null(),null());
HXLINE( 101) ::FirstBootState _hx_tmp1 = ::hx::ObjectPtr<OBJ_>(this);
HXDLIN( 101) _hx_tmp1->curSelected = (_hx_tmp1->curSelected + 1);
}
HXLINE( 104) if ((this->curSelected < 0)) {
HXLINE( 105) this->curSelected = (this->textMenuItems->length - 1);
}
HXLINE( 107) if ((this->curSelected >= this->textMenuItems->length)) {
HXLINE( 108) this->curSelected = 0;
}
HXLINE( 110) this->grpOptionsTexts->forEach( ::Dynamic(new _hx_Closure_1(_gthis)),null());
HXLINE( 118) if (::PlayerSettings_obj::player1->controls->_accept->check()) {
HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_8, ::FirstBootState,_gthis) HXARGC(1)
void _hx_run( ::flixel::text::FlxText txt){
HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_125_update)
HXLINE( 125) if ((_gthis->curSelected != txt->ID)) {
HX_BEGIN_LOCAL_FUNC_S0(::hx::LocalFunc,_hx_Closure_2) HXARGC(1)
void _hx_run( ::flixel::tweens::FlxTween twn){
HX_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_130_update)
}
HX_END_LOCAL_FUNC1((void))
HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_3, ::flixel::text::FlxText,txt) HXARGC(1)
void _hx_run( ::flixel::tweens::FlxTween twn){
HX_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_137_update)
HXLINE( 137) txt->kill();
}
HX_END_LOCAL_FUNC1((void))
HXLINE( 127) ::flixel::tweens::FlxTween_obj::tween(_gthis->bg, ::Dynamic(::hx::Anon_obj::Create(1)
->setFixed(0,HX_("alpha",5e,a7,96,21),0)),((Float)1.3), ::Dynamic(::hx::Anon_obj::Create(2)
->setFixed(0,HX_("ease",ee,8b,0c,43),::flixel::tweens::FlxEase_obj::quadOut_dyn())
->setFixed(1,HX_("onComplete",f8,d4,7e,5d), ::Dynamic(new _hx_Closure_2()))));
HXLINE( 133) ::flixel::tweens::FlxTween_obj::tween(txt, ::Dynamic(::hx::Anon_obj::Create(1)
->setFixed(0,HX_("alpha",5e,a7,96,21),0)),((Float)1.3), ::Dynamic(::hx::Anon_obj::Create(2)
->setFixed(0,HX_("ease",ee,8b,0c,43),::flixel::tweens::FlxEase_obj::quadOut_dyn())
->setFixed(1,HX_("onComplete",f8,d4,7e,5d), ::Dynamic(new _hx_Closure_3(txt)))));
}
else {
HXLINE( 143) if (( (bool)(::flixel::FlxG_obj::save->data->__Field(HX_("flashing",32,85,e8,99),::hx::paccDynamic)) )) {
HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_5, ::FirstBootState,_gthis) HXARGC(1)
void _hx_run( ::flixel::effects::FlxFlicker flick){
HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_4, ::FirstBootState,_gthis) HXARGC(1)
void _hx_run( ::flixel::util::FlxTimer tmr){
HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_151_update)
HXLINE( 152) ::flixel::_hx_system::frontEnds::SoundFrontEnd _hx_tmp = ::flixel::FlxG_obj::sound;
HXDLIN( 152) _hx_tmp->play(::Paths_obj::sound(HX_("flip_page",61,10,21,01),HX_("shared",a5,5e,2b,1d)),null(),null(),null(),null(),null());
HXLINE( 153) _gthis->bringinthenote();
}
HX_END_LOCAL_FUNC1((void))
HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_146_update)
HXLINE( 147) ::flixel::FlxG_obj::save->data->__SetField(HX_("language",58,80,11,7a),_gthis->localeList->__get(_gthis->curSelected),::hx::paccDynamic);
HXLINE( 148) ::Dynamic _hx_tmp = ::haxe::Log_obj::trace;
HXDLIN( 148) ::String _hx_tmp1 = (HX_("langauge set to ",a7,fb,71,af) + ::Std_obj::string( ::Dynamic(::flixel::FlxG_obj::save->data->__Field(HX_("language",58,80,11,7a),::hx::paccDynamic))));
HXDLIN( 148) _hx_tmp(_hx_tmp1,::hx::SourceInfo(HX_("source/FirstBootState.hx",5b,da,01,2e),148,HX_("FirstBootState",4f,62,c9,d3),HX_("update",09,86,05,87)));
HXLINE( 149) ::String _hx_tmp2;
HXDLIN( 149) if (::openfl::utils::Assets_obj::exists(::Paths_obj::getPath(((HX_("locale/",55,92,c6,2d) + ::Std_obj::string( ::Dynamic(::flixel::FlxG_obj::save->data->__Field(HX_("language",58,80,11,7a),::hx::paccDynamic)))) + ((HX_("/",2f,00,00,00) + HX_("data/textData",3c,85,6a,69)) + HX_(".txt",02,3f,c0,1e))),HX_("TEXT",ad,94,ba,37),HX_("preload",c9,47,43,35)),null())) {
HXLINE( 149) _hx_tmp2 = ::Paths_obj::getPath(((HX_("locale/",55,92,c6,2d) + ::Std_obj::string( ::Dynamic(::flixel::FlxG_obj::save->data->__Field(HX_("language",58,80,11,7a),::hx::paccDynamic)))) + ((HX_("/",2f,00,00,00) + HX_("data/textData",3c,85,6a,69)) + HX_(".txt",02,3f,c0,1e))),HX_("TEXT",ad,94,ba,37),HX_("preload",c9,47,43,35));
}
else {
HXLINE( 149) _hx_tmp2 = ::Paths_obj::getPath(((HX_("locale/en-US/",02,23,bf,a8) + HX_("data/textData",3c,85,6a,69)) + HX_(".txt",02,3f,c0,1e)),HX_("TEXT",ad,94,ba,37),HX_("preload",c9,47,43,35));
}
HXDLIN( 149) ::LangUtil_obj::localeList = ::CoolUtil_obj::coolTextFile(_hx_tmp2);
HXLINE( 150) ::flixel::util::FlxTimer_obj::__alloc( HX_CTX ,null())->start(2, ::Dynamic(new _hx_Closure_4(_gthis)),null());
}
HX_END_LOCAL_FUNC1((void))
HXLINE( 145) ::flixel::effects::FlxFlicker_obj::flicker(txt,1,((Float)0.06),false,false, ::Dynamic(new _hx_Closure_5(_gthis)),null());
}
else {
HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_7, ::FirstBootState,_gthis) HXARGC(1)
void _hx_run( ::flixel::util::FlxTimer tmr){
HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_6, ::FirstBootState,_gthis) HXARGC(1)
void _hx_run( ::flixel::util::FlxTimer tmr){
HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_165_update)
HXLINE( 166) ::flixel::_hx_system::frontEnds::SoundFrontEnd _hx_tmp = ::flixel::FlxG_obj::sound;
HXDLIN( 166) _hx_tmp->play(::Paths_obj::sound(HX_("flip_page",61,10,21,01),HX_("shared",a5,5e,2b,1d)),null(),null(),null(),null(),null());
HXLINE( 167) _gthis->bringinthenote();
}
HX_END_LOCAL_FUNC1((void))
HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_160_update)
HXLINE( 161) ::flixel::FlxG_obj::save->data->__SetField(HX_("language",58,80,11,7a),_gthis->localeList->__get(_gthis->curSelected),::hx::paccDynamic);
HXLINE( 162) ::Dynamic _hx_tmp = ::haxe::Log_obj::trace;
HXDLIN( 162) ::String _hx_tmp1 = (HX_("langauge set to ",a7,fb,71,af) + ::Std_obj::string( ::Dynamic(::flixel::FlxG_obj::save->data->__Field(HX_("language",58,80,11,7a),::hx::paccDynamic))));
HXDLIN( 162) _hx_tmp(_hx_tmp1,::hx::SourceInfo(HX_("source/FirstBootState.hx",5b,da,01,2e),162,HX_("FirstBootState",4f,62,c9,d3),HX_("update",09,86,05,87)));
HXLINE( 163) ::String _hx_tmp2;
HXDLIN( 163) if (::openfl::utils::Assets_obj::exists(::Paths_obj::getPath(((HX_("locale/",55,92,c6,2d) + ::Std_obj::string( ::Dynamic(::flixel::FlxG_obj::save->data->__Field(HX_("language",58,80,11,7a),::hx::paccDynamic)))) + ((HX_("/",2f,00,00,00) + HX_("data/textData",3c,85,6a,69)) + HX_(".txt",02,3f,c0,1e))),HX_("TEXT",ad,94,ba,37),HX_("preload",c9,47,43,35)),null())) {
HXLINE( 163) _hx_tmp2 = ::Paths_obj::getPath(((HX_("locale/",55,92,c6,2d) + ::Std_obj::string( ::Dynamic(::flixel::FlxG_obj::save->data->__Field(HX_("language",58,80,11,7a),::hx::paccDynamic)))) + ((HX_("/",2f,00,00,00) + HX_("data/textData",3c,85,6a,69)) + HX_(".txt",02,3f,c0,1e))),HX_("TEXT",ad,94,ba,37),HX_("preload",c9,47,43,35));
}
else {
HXLINE( 163) _hx_tmp2 = ::Paths_obj::getPath(((HX_("locale/en-US/",02,23,bf,a8) + HX_("data/textData",3c,85,6a,69)) + HX_(".txt",02,3f,c0,1e)),HX_("TEXT",ad,94,ba,37),HX_("preload",c9,47,43,35));
}
HXDLIN( 163) ::LangUtil_obj::localeList = ::CoolUtil_obj::coolTextFile(_hx_tmp2);
HXLINE( 164) ::flixel::util::FlxTimer_obj::__alloc( HX_CTX ,null())->start(2, ::Dynamic(new _hx_Closure_6(_gthis)),null());
}
HX_END_LOCAL_FUNC1((void))
HXLINE( 159) ::flixel::util::FlxTimer_obj::__alloc( HX_CTX ,null())->start(1, ::Dynamic(new _hx_Closure_7(_gthis)),null());
}
}
}
HX_END_LOCAL_FUNC1((void))
HXLINE( 120) this->selectedsomething = true;
HXLINE( 121) this->selectedSomethin = true;
HXLINE( 122) ::flixel::_hx_system::frontEnds::SoundFrontEnd _hx_tmp = ::flixel::FlxG_obj::sound;
HXDLIN( 122) _hx_tmp->play(::Paths_obj::sound(HX_("confirmMenu",bf,8e,fe,3c),null()),null(),null(),null(),null(),null());
HXLINE( 123) this->grpOptionsTexts->forEach( ::Dynamic(new _hx_Closure_8(_gthis)),null());
}
}
}
void FirstBootState_obj::bringinthenote(){
HX_BEGIN_LOCAL_FUNC_S1(::hx::LocalFunc,_hx_Closure_0, ::FirstBootState,_gthis) HXARGC(1)
void _hx_run( ::flixel::tweens::FlxTween twn){
HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_187_bringinthenote)
HXLINE( 187) _gthis->selectedsomething = false;
}
HX_END_LOCAL_FUNC1((void))
HX_GC_STACKFRAME(&_hx_pos_58e96fb3db9ff2e7_178_bringinthenote)
HXDLIN( 178) ::FirstBootState _gthis = ::hx::ObjectPtr<OBJ_>(this);
HXLINE( 179) ::flixel::FlxSprite _hx_tmp = ::flixel::FlxSprite_obj::__alloc( HX_CTX ,0,0,null());
HXDLIN( 179) ::String _hx_tmp1;
HXDLIN( 179) if (::openfl::utils::Assets_obj::exists(::Paths_obj::getPath(((HX_("locale/",55,92,c6,2d) + ::Std_obj::string( ::Dynamic(::flixel::FlxG_obj::save->data->__Field(HX_("language",58,80,11,7a),::hx::paccDynamic)))) + ((HX_("/images/",28,44,b7,41) + HX_("DDLCIntroWarning",e7,dd,da,5c)) + HX_(".png",3b,2d,bd,1e))),HX_("IMAGE",3b,57,57,3b),HX_("preload",c9,47,43,35)),null())) {
HXLINE( 179) _hx_tmp1 = ::Paths_obj::getPath(((HX_("locale/",55,92,c6,2d) + ::Std_obj::string( ::Dynamic(::flixel::FlxG_obj::save->data->__Field(HX_("language",58,80,11,7a),::hx::paccDynamic)))) + ((HX_("/images/",28,44,b7,41) + HX_("DDLCIntroWarning",e7,dd,da,5c)) + HX_(".png",3b,2d,bd,1e))),HX_("IMAGE",3b,57,57,3b),HX_("preload",c9,47,43,35));
}
else {
HXLINE( 179) _hx_tmp1 = ::Paths_obj::getPath(((HX_("locale/en-US/images/",b5,71,94,96) + HX_("DDLCIntroWarning",e7,dd,da,5c)) + HX_(".png",3b,2d,bd,1e)),HX_("IMAGE",3b,57,57,3b),HX_("preload",c9,47,43,35));
}
HXDLIN( 179) this->funnynote = _hx_tmp->loadGraphic(_hx_tmp1,null(),null(),null(),null(),null());
HXLINE( 180) this->funnynote->set_alpha(( (Float)(0) ));
HXLINE( 181) this->funnynote->screenCenter(::flixel::util::FlxAxes_obj::X_dyn());
HXLINE( 182) this->add(this->funnynote);
HXLINE( 183) ::flixel::tweens::FlxTween_obj::tween(this->funnynote, ::Dynamic(::hx::Anon_obj::Create(1)
->setFixed(0,HX_("alpha",5e,a7,96,21),1)),1, ::Dynamic(::hx::Anon_obj::Create(2)
->setFixed(0,HX_("ease",ee,8b,0c,43),::flixel::tweens::FlxEase_obj::quadOut_dyn())
->setFixed(1,HX_("onComplete",f8,d4,7e,5d), ::Dynamic(new _hx_Closure_0(_gthis)))));
}
HX_DEFINE_DYNAMIC_FUNC0(FirstBootState_obj,bringinthenote,(void))
::hx::ObjectPtr< FirstBootState_obj > FirstBootState_obj::__new( ::flixel::addons::transition::TransitionData TransIn, ::flixel::addons::transition::TransitionData TransOut) {
::hx::ObjectPtr< FirstBootState_obj > __this = new FirstBootState_obj();
__this->__construct(TransIn,TransOut);
return __this;
}
::hx::ObjectPtr< FirstBootState_obj > FirstBootState_obj::__alloc(::hx::Ctx *_hx_ctx, ::flixel::addons::transition::TransitionData TransIn, ::flixel::addons::transition::TransitionData TransOut) {
FirstBootState_obj *__this = (FirstBootState_obj*)(::hx::Ctx::alloc(_hx_ctx, sizeof(FirstBootState_obj), true, "FirstBootState"));
*(void **)__this = FirstBootState_obj::_hx_vtable;
__this->__construct(TransIn,TransOut);
return __this;
}
FirstBootState_obj::FirstBootState_obj()
{
}
void FirstBootState_obj::__Mark(HX_MARK_PARAMS)
{
HX_MARK_BEGIN_CLASS(FirstBootState);
HX_MARK_MEMBER_NAME(textMenuItems,"textMenuItems");
HX_MARK_MEMBER_NAME(localeList,"localeList");
HX_MARK_MEMBER_NAME(selectedsomething,"selectedsomething");
HX_MARK_MEMBER_NAME(curSelected,"curSelected");
HX_MARK_MEMBER_NAME(backdrop,"backdrop");
HX_MARK_MEMBER_NAME(bg,"bg");
HX_MARK_MEMBER_NAME(funnynote,"funnynote");
HX_MARK_MEMBER_NAME(grpOptionsTexts,"grpOptionsTexts");
HX_MARK_MEMBER_NAME(selectedSomethin,"selectedSomethin");
::MusicBeatState_obj::__Mark(HX_MARK_ARG);
HX_MARK_END_CLASS();
}
void FirstBootState_obj::__Visit(HX_VISIT_PARAMS)
{
HX_VISIT_MEMBER_NAME(textMenuItems,"textMenuItems");
HX_VISIT_MEMBER_NAME(localeList,"localeList");
HX_VISIT_MEMBER_NAME(selectedsomething,"selectedsomething");
HX_VISIT_MEMBER_NAME(curSelected,"curSelected");
HX_VISIT_MEMBER_NAME(backdrop,"backdrop");
HX_VISIT_MEMBER_NAME(bg,"bg");
HX_VISIT_MEMBER_NAME(funnynote,"funnynote");
HX_VISIT_MEMBER_NAME(grpOptionsTexts,"grpOptionsTexts");
HX_VISIT_MEMBER_NAME(selectedSomethin,"selectedSomethin");
::MusicBeatState_obj::__Visit(HX_VISIT_ARG);
}
::hx::Val FirstBootState_obj::__Field(const ::String &inName,::hx::PropertyAccess inCallProp)
{
switch(inName.length) {
case 2:
if (HX_FIELD_EQ(inName,"bg") ) { return ::hx::Val( bg ); }
break;
case 6:
if (HX_FIELD_EQ(inName,"create") ) { return ::hx::Val( create_dyn() ); }
if (HX_FIELD_EQ(inName,"update") ) { return ::hx::Val( update_dyn() ); }
break;
case 8:
if (HX_FIELD_EQ(inName,"backdrop") ) { return ::hx::Val( backdrop ); }
break;
case 9:
if (HX_FIELD_EQ(inName,"funnynote") ) { return ::hx::Val( funnynote ); }
break;
case 10:
if (HX_FIELD_EQ(inName,"localeList") ) { return ::hx::Val( localeList ); }
break;
case 11:
if (HX_FIELD_EQ(inName,"curSelected") ) { return ::hx::Val( curSelected ); }
break;
case 13:
if (HX_FIELD_EQ(inName,"textMenuItems") ) { return ::hx::Val( textMenuItems ); }
break;
case 14:
if (HX_FIELD_EQ(inName,"bringinthenote") ) { return ::hx::Val( bringinthenote_dyn() ); }
break;
case 15:
if (HX_FIELD_EQ(inName,"grpOptionsTexts") ) { return ::hx::Val( grpOptionsTexts ); }
break;
case 16:
if (HX_FIELD_EQ(inName,"selectedSomethin") ) { return ::hx::Val( selectedSomethin ); }
break;
case 17:
if (HX_FIELD_EQ(inName,"selectedsomething") ) { return ::hx::Val( selectedsomething ); }
}
return super::__Field(inName,inCallProp);
}
::hx::Val FirstBootState_obj::__SetField(const ::String &inName,const ::hx::Val &inValue,::hx::PropertyAccess inCallProp)
{
switch(inName.length) {
case 2:
if (HX_FIELD_EQ(inName,"bg") ) { bg=inValue.Cast< ::flixel::FlxSprite >(); return inValue; }
break;
case 8:
if (HX_FIELD_EQ(inName,"backdrop") ) { backdrop=inValue.Cast< ::flixel::addons::display::FlxBackdrop >(); return inValue; }
break;
case 9:
if (HX_FIELD_EQ(inName,"funnynote") ) { funnynote=inValue.Cast< ::flixel::FlxSprite >(); return inValue; }
break;
case 10:
if (HX_FIELD_EQ(inName,"localeList") ) { localeList=inValue.Cast< ::Array< ::String > >(); return inValue; }
break;
case 11:
if (HX_FIELD_EQ(inName,"curSelected") ) { curSelected=inValue.Cast< int >(); return inValue; }
break;
case 13:
if (HX_FIELD_EQ(inName,"textMenuItems") ) { textMenuItems=inValue.Cast< ::Array< ::String > >(); return inValue; }
break;
case 15:
if (HX_FIELD_EQ(inName,"grpOptionsTexts") ) { grpOptionsTexts=inValue.Cast< ::flixel::group::FlxTypedGroup >(); return inValue; }
break;
case 16:
if (HX_FIELD_EQ(inName,"selectedSomethin") ) { selectedSomethin=inValue.Cast< bool >(); return inValue; }
break;
case 17:
if (HX_FIELD_EQ(inName,"selectedsomething") ) { selectedsomething=inValue.Cast< bool >(); return inValue; }
}
return super::__SetField(inName,inValue,inCallProp);
}
void FirstBootState_obj::__GetFields(Array< ::String> &outFields)
{
outFields->push(HX_("textMenuItems",74,ab,77,14));
outFields->push(HX_("localeList",18,12,cb,fe));
outFields->push(HX_("selectedsomething",bf,62,a0,80));
outFields->push(HX_("curSelected",fb,eb,ab,32));
outFields->push(HX_("backdrop",d6,b1,96,1a));
outFields->push(HX_("bg",c5,55,00,00));
outFields->push(HX_("funnynote",3c,ff,3e,fe));
outFields->push(HX_("grpOptionsTexts",6d,2e,b1,bf));
outFields->push(HX_("selectedSomethin",c8,ec,fb,99));
super::__GetFields(outFields);
};
#ifdef HXCPP_SCRIPTABLE
static ::hx::StorageInfo FirstBootState_obj_sMemberStorageInfo[] = {
{::hx::fsObject /* ::Array< ::String > */ ,(int)offsetof(FirstBootState_obj,textMenuItems),HX_("textMenuItems",74,ab,77,14)},
{::hx::fsObject /* ::Array< ::String > */ ,(int)offsetof(FirstBootState_obj,localeList),HX_("localeList",18,12,cb,fe)},
{::hx::fsBool,(int)offsetof(FirstBootState_obj,selectedsomething),HX_("selectedsomething",bf,62,a0,80)},
{::hx::fsInt,(int)offsetof(FirstBootState_obj,curSelected),HX_("curSelected",fb,eb,ab,32)},
{::hx::fsObject /* ::flixel::addons::display::FlxBackdrop */ ,(int)offsetof(FirstBootState_obj,backdrop),HX_("backdrop",d6,b1,96,1a)},
{::hx::fsObject /* ::flixel::FlxSprite */ ,(int)offsetof(FirstBootState_obj,bg),HX_("bg",c5,55,00,00)},
{::hx::fsObject /* ::flixel::FlxSprite */ ,(int)offsetof(FirstBootState_obj,funnynote),HX_("funnynote",3c,ff,3e,fe)},
{::hx::fsObject /* ::flixel::group::FlxTypedGroup */ ,(int)offsetof(FirstBootState_obj,grpOptionsTexts),HX_("grpOptionsTexts",6d,2e,b1,bf)},
{::hx::fsBool,(int)offsetof(FirstBootState_obj,selectedSomethin),HX_("selectedSomethin",c8,ec,fb,99)},
{ ::hx::fsUnknown, 0, null()}
};
static ::hx::StaticInfo *FirstBootState_obj_sStaticStorageInfo = 0;
#endif
static ::String FirstBootState_obj_sMemberFields[] = {
HX_("textMenuItems",74,ab,77,14),
HX_("localeList",18,12,cb,fe),
HX_("selectedsomething",bf,62,a0,80),
HX_("curSelected",fb,eb,ab,32),
HX_("backdrop",d6,b1,96,1a),
HX_("bg",c5,55,00,00),
HX_("funnynote",3c,ff,3e,fe),
HX_("grpOptionsTexts",6d,2e,b1,bf),
HX_("create",fc,66,0f,7c),
HX_("selectedSomethin",c8,ec,fb,99),
HX_("update",09,86,05,87),
HX_("bringinthenote",4c,34,29,41),
::String(null()) };
::hx::Class FirstBootState_obj::__mClass;
void FirstBootState_obj::__register()
{
FirstBootState_obj _hx_dummy;
FirstBootState_obj::_hx_vtable = *(void **)&_hx_dummy;
::hx::Static(__mClass) = new ::hx::Class_obj();
__mClass->mName = HX_("FirstBootState",4f,62,c9,d3);
__mClass->mSuper = &super::__SGetClass();
__mClass->mConstructEmpty = &__CreateEmpty;
__mClass->mConstructArgs = &__Create;
__mClass->mGetStaticField = &::hx::Class_obj::GetNoStaticField;
__mClass->mSetStaticField = &::hx::Class_obj::SetNoStaticField;
__mClass->mStatics = ::hx::Class_obj::dupFunctions(0 /* sStaticFields */);
__mClass->mMembers = ::hx::Class_obj::dupFunctions(FirstBootState_obj_sMemberFields);
__mClass->mCanCast = ::hx::TCanCast< FirstBootState_obj >;
#ifdef HXCPP_SCRIPTABLE
__mClass->mMemberStorageInfo = FirstBootState_obj_sMemberStorageInfo;
#endif
#ifdef HXCPP_SCRIPTABLE
__mClass->mStaticStorageInfo = FirstBootState_obj_sStaticStorageInfo;
#endif
::hx::_hx_RegisterClass(__mClass->mName, __mClass);
}
| 50.831071 | 387 | 0.68722 | BushsHaxs |
4b91b0f9fe178a22024479cf967d1b16dc4dbe2e | 6,467 | cpp | C++ | OpenSimRoot/src/modules/WaterModule/WaterUptakeByRoots.cpp | nb-e/OpenRootSim | aaa1cd18e94ebf613c28737842401daba3b8d5ef | [
"BSD-3-Clause"
] | 1 | 2021-08-03T00:52:58.000Z | 2021-08-03T00:52:58.000Z | OpenSimRoot/src/modules/WaterModule/WaterUptakeByRoots.cpp | nb-e/OpenRootSim | aaa1cd18e94ebf613c28737842401daba3b8d5ef | [
"BSD-3-Clause"
] | null | null | null | OpenSimRoot/src/modules/WaterModule/WaterUptakeByRoots.cpp | nb-e/OpenRootSim | aaa1cd18e94ebf613c28737842401daba3b8d5ef | [
"BSD-3-Clause"
] | 1 | 2021-08-03T00:52:59.000Z | 2021-08-03T00:52:59.000Z | /*
Copyright © 2016, The Pennsylvania State University
All rights reserved.
Copyright © 2016 Forschungszentrum Jülich GmbH
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted under the GNU General Public License v3 and provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
Disclaimer
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
You should have received the GNU GENERAL PUBLIC LICENSE v3 with this file in license.txt but can also be found at http://www.gnu.org/licenses/gpl-3.0.en.html
NOTE: The GPL.v3 license requires that all derivative work is distributed under the same license. That means that if you use this source code in any other program, you can only distribute that program with the full source code included and licensed under a GPL license.
*/
#include "WaterUptakeByRoots.hpp"
#include "../PlantType.hpp"
WaterUptakeFromHopmans::WaterUptakeFromHopmans(SimulaDynamic* pSD):DerivativeBase(pSD)
{
//Check the units
if(pSD->getUnit()=="cm3") {
mode=1;
}else if (pSD->getUnit()=="cm3/cm"){
mode=0;
}else{
msg::error("WaterUptakeFromHopmans: expected unit cm3");
}
//pointer to total transpiration of this plant
SimulaBase *plant(pSD);
PLANTTOP(plant)
potentialTranspiration=plant->getChild("plantPosition")->getChild("shoot")->getChild("potentialTranspiration","cm3");
//pointer to segment length
segmentLength=pSD->getSibling("rootSegmentLength","cm");
//check position of the root
Coordinate pos;
pSD->getAbsolute(pSD->getStartTime(),pos);
if(pos.y>=0) mode=-1;
//pointer to total root length
totalRootLength=plant->existingChild("rootLengthBelowTheSurface",segmentLength->getUnit());
if(!totalRootLength){
totalRootLength=plant->getChild("rootLongitudinalGrowth",segmentLength->getUnit());
if(mode<0) msg::warning("WaterUptakeFromHopmans: rootsegment is above ground, but averaging potential transpiration over total root length. Consider adding rootLenthBelowTheSurface to your plant template.");
}
}
void WaterUptakeFromHopmans::calculate(const Time &t,double &total){
if(mode==-1){
//root is above ground, set uptake to 0
total=0;
return;
}
//get the total transpiration
double tr;
potentialTranspiration->getRate(t,tr);
//get fraction
double tl;
totalRootLength->get(t,tl);
if(tl!=0){
if(mode){
double sl;
segmentLength->get(t,sl);
total=tr*(sl/tl);
}else{
total=tr/tl;
}
}else{
if (tr!=0)msg::warning("WaterUptakeFromHopmans: Transpiration but zero root length.");
total=0;
}
}
std::string WaterUptakeFromHopmans::getName()const{
return "waterUptakeFromHopmans";
}
DerivativeBase * newInstantiationWaterUptakeFromHopmans(SimulaDynamic* const pSD){
return new WaterUptakeFromHopmans(pSD);
}
ScaledWaterUptake::ScaledWaterUptake(SimulaDynamic* pSD):DerivativeBase(pSD)
{
//Check the units
if(pSD->getUnit()=="cm3") {
length=nullptr;
}else if (pSD->getUnit()=="cm3/cm"){
length=pSD->getSibling("rootSegmentLength","cm");;
}else{
msg::error("ScaledWaterUptake: expected unit cm3");
}
//pointer to total transpiration of this plant
SimulaBase *plant(pSD);
PLANTTOP(plant)
actualTranspiration=plant->getChild("plantPosition")->getChild("shoot")->getChild("actualTranspiration","cm3");;
total=plant->getChild("rootPotentialWaterUptake","cm3");
fraction=pSD->getSibling("rootSegmentPotentialWaterUptake","cm3");
}
void ScaledWaterUptake::calculate(const Time &t,double &uptake){
//get the total transpiration
actualTranspiration->getRate(t,uptake);
//get fraction
double tl;
total->getRate(t,tl);
if(tl!=0){
double sl;
fraction->getRate(t,sl);
uptake*=(sl/tl);
if(length){
length->get(t,sl);
if(sl>0){
uptake/=sl;
}else{
uptake=0;
}
}
}else{
uptake=0;
}
if(std::isnan(uptake))
msg::error("ScaledWaterUptake: value is nan");
}
std::string ScaledWaterUptake::getName()const{
return "scaledWaterUptake";
}
DerivativeBase * newInstantiationScaledWaterUptake(SimulaDynamic* const pSD){
return new ScaledWaterUptake(pSD);
}
GetValuesFromPlantWaterUptake::GetValuesFromPlantWaterUptake(SimulaDynamic* pSD):DerivativeBase(pSD){
SimulaBase * top=pSD->getParent();
if(!top->existingChild("plantPosition") ) {
PLANTTOP(top);
}
wu=top->getChild("rootWaterUptakeCheck");
}
std::string GetValuesFromPlantWaterUptake::getName()const{
return "getValuesFromPlantWaterUptake";
}
void GetValuesFromPlantWaterUptake::calculate(const Time &t,double &var){
wu->get(t,var);
}
DerivativeBase * newInstantiationGetValuesFromPlantWaterUptake(SimulaDynamic* const pSD) {
return new GetValuesFromPlantWaterUptake(pSD);
}
//Register the module
class AutoRegisterWaterUptakeInstantiationFunctions {
public:
AutoRegisterWaterUptakeInstantiationFunctions() {
BaseClassesMap::getDerivativeBaseClasses()["waterUptakeFromHopmans"] = newInstantiationWaterUptakeFromHopmans;
BaseClassesMap::getDerivativeBaseClasses()["scaledWaterUptake"] = newInstantiationScaledWaterUptake;
BaseClassesMap::getDerivativeBaseClasses()["getValuesFromPlantWaterUptake"] = newInstantiationGetValuesFromPlantWaterUptake;
}
};
// our one instance of the proxy
static AutoRegisterWaterUptakeInstantiationFunctions l654645648435135753;
| 37.381503 | 755 | 0.772692 | nb-e |
4b9572f3d61de9388831bfdd40a78ae7f07c14db | 3,409 | hpp | C++ | external/boost_1_60_0/qsboost/smart_ptr/detail/sp_counted_base.hpp | wouterboomsma/quickstep | a33447562eca1350c626883f21c68125bd9f776c | [
"MIT"
] | 1 | 2019-06-27T17:54:13.000Z | 2019-06-27T17:54:13.000Z | external/boost_1_60_0/qsboost/smart_ptr/detail/sp_counted_base.hpp | wouterboomsma/quickstep | a33447562eca1350c626883f21c68125bd9f776c | [
"MIT"
] | null | null | null | external/boost_1_60_0/qsboost/smart_ptr/detail/sp_counted_base.hpp | wouterboomsma/quickstep | a33447562eca1350c626883f21c68125bd9f776c | [
"MIT"
] | null | null | null | #ifndef QSBOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED
#define QSBOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
//
// detail/sp_counted_base.hpp
//
// Copyright 2005-2013 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#include <qsboost/config.hpp>
#include <qsboost/smart_ptr/detail/sp_has_sync.hpp>
#if defined( __clang__ ) && defined( __has_extension )
# if __has_extension( __c_atomic__ )
# define QSBOOST_SP_HAS_CLANG_C11_ATOMICS
# endif
#endif
#if defined( QSBOOST_SP_DISABLE_THREADS )
# include <qsboost/smart_ptr/detail/sp_counted_base_nt.hpp>
#elif defined( QSBOOST_SP_USE_STD_ATOMIC )
# include <qsboost/smart_ptr/detail/sp_counted_base_std_atomic.hpp>
#elif defined( QSBOOST_SP_USE_SPINLOCK )
# include <qsboost/smart_ptr/detail/sp_counted_base_spin.hpp>
#elif defined( QSBOOST_SP_USE_PTHREADS )
# include <qsboost/smart_ptr/detail/sp_counted_base_pt.hpp>
#elif defined( QSBOOST_DISABLE_THREADS ) && !defined( QSBOOST_SP_ENABLE_THREADS ) && !defined( QSBOOST_DISABLE_WIN32 )
# include <qsboost/smart_ptr/detail/sp_counted_base_nt.hpp>
#elif defined( QSBOOST_SP_HAS_CLANG_C11_ATOMICS )
# include <qsboost/smart_ptr/detail/sp_counted_base_clang.hpp>
#elif defined( __SNC__ )
# include <qsboost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp>
#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) && !defined(__PATHSCALE__)
# include <qsboost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp>
#elif defined(__HP_aCC) && defined(__ia64)
# include <qsboost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp>
#elif defined( __GNUC__ ) && defined( __ia64__ ) && !defined( __INTEL_COMPILER ) && !defined(__PATHSCALE__)
# include <qsboost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp>
#elif defined( __IBMCPP__ ) && defined( __powerpc )
# include <qsboost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp>
#elif defined( __MWERKS__ ) && defined( __POWERPC__ )
# include <qsboost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp>
#elif defined( __GNUC__ ) && ( defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc ) ) && !defined(__PATHSCALE__) && !defined( _AIX )
# include <qsboost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp>
#elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__)
# include <qsboost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp>
#elif defined( QSBOOST_SP_HAS_SYNC )
# include <qsboost/smart_ptr/detail/sp_counted_base_sync.hpp>
#elif defined(__GNUC__) && ( defined( __sparcv9 ) || ( defined( __sparcv8 ) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 402 ) ) )
# include <qsboost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp>
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__)
# include <qsboost/smart_ptr/detail/sp_counted_base_w32.hpp>
#elif defined( _AIX )
# include <qsboost/smart_ptr/detail/sp_counted_base_aix.hpp>
#elif !defined( QSBOOST_HAS_THREADS )
# include <qsboost/smart_ptr/detail/sp_counted_base_nt.hpp>
#else
# include <qsboost/smart_ptr/detail/sp_counted_base_spin.hpp>
#endif
#undef QSBOOST_SP_HAS_CLANG_C11_ATOMICS
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED
| 36.265957 | 144 | 0.779114 | wouterboomsma |
4b9e620559db53c441cff1aeaaf21b598bec79e3 | 13,715 | cpp | C++ | Code/Components/PlayerComponent.cpp | Battledrake/CryShooter | 42184444606e1dfd41c963c87f8d16bfef8656a1 | [
"MIT"
] | 1 | 2021-10-11T12:46:59.000Z | 2021-10-11T12:46:59.000Z | Code/Components/PlayerComponent.cpp | Battledrake/CryShooter | 42184444606e1dfd41c963c87f8d16bfef8656a1 | [
"MIT"
] | null | null | null | Code/Components/PlayerComponent.cpp | Battledrake/CryShooter | 42184444606e1dfd41c963c87f8d16bfef8656a1 | [
"MIT"
] | null | null | null | #include "StdAfx.h"
#include "PlayerComponent.h"
#include <CrySchematyc/Env/IEnvRegistrar.h>
#include <CrySchematyc/Env/Elements/EnvComponent.h>
#include <CryCore/StaticInstanceList.h>
#include "Components/CharacterComponent.h"
namespace
{
static void RegisterPlayerComponent(Schematyc::IEnvRegistrar& registrar)
{
Schematyc::CEnvRegistrationScope scope = registrar.Scope(IEntity::GetEntityScopeGUID());
{
Schematyc::CEnvRegistrationScope componentScope = scope.Register(SCHEMATYC_MAKE_ENV_COMPONENT(CPlayerComponent));
}
}
CRY_STATIC_AUTO_REGISTER_FUNCTION(&RegisterPlayerComponent);
}
void CPlayerComponent::Initialize()
{
m_inputFlags.Clear();
m_mouseDeltaRotation = ZERO;
m_pCameraComponent = m_pEntity->GetOrCreateComponent<Cry::DefaultComponents::CCameraComponent>();
m_pCameraComponent->SetNearPlane(0.01f);
m_pAudioListenerComponent = m_pEntity->GetOrCreateComponent<Cry::Audio::DefaultComponents::CListenerComponent>();
m_pInputComponent = m_pEntity->GetOrCreateComponent<Cry::DefaultComponents::CInputComponent>();
m_currentViewMode = EViewMode::ThirdPerson;
m_viewBeforeSpectate = m_currentViewMode;
RegisterInputs();
}
Cry::Entity::EventFlags CPlayerComponent::GetEventMask() const
{
return
Cry::Entity::EEvent::GameplayStarted |
Cry::Entity::EEvent::Update |
Cry::Entity::EEvent::Reset;
}
void CPlayerComponent::ProcessEvent(const SEntityEvent& event)
{
switch (event.event)
{
case Cry::Entity::EEvent::GameplayStarted:
{
m_pUIComponent = m_pEntity->GetOrCreateComponent<CUIComponent>();
m_lookOrientation = IDENTITY;
}
break;
case Cry::Entity::EEvent::Update:
{
const float frameTime = event.fParam[0];
float travelSpeed = 0;
float travelAngle = 0;
// Check input to calculate local space velocity
if (m_inputFlags & EInputFlag::MoveLeft)
{
travelAngle -= 1.0f;
}
if (m_inputFlags & EInputFlag::MoveRight)
{
travelAngle += 1.0f;
}
if (m_inputFlags & EInputFlag::MoveForward)
{
travelSpeed += 1.0f;
}
if (m_inputFlags & EInputFlag::MoveBack)
{
travelSpeed -= 1.0f;
}
const float rotationSpeed = 0.002f;
const float rotationLimitsMinPitch = m_currentViewMode == EViewMode::ThirdPerson ? -0.8f : -1.3f;
const float rotationLimitsMaxPitch = 1.5f;
m_mouseDeltaRotation = m_mouseDeltaSmoothingFilter.Push(m_mouseDeltaRotation).Get();
Ang3 playerYPR = CCamera::CreateAnglesYPR(Matrix33(m_pEntity->GetLocalTM()));
playerYPR.y = CLAMP(playerYPR.y + m_mouseDeltaRotation.y * rotationSpeed, rotationLimitsMinPitch, rotationLimitsMaxPitch);
playerYPR.x += m_currentViewMode == EViewMode::Spectator ? m_mouseDeltaRotation.x * rotationSpeed : 0.0f;
playerYPR.z = 0;
Quat camOrientation = Quat(CCamera::CreateOrientationYPR(playerYPR));
m_pEntity->SetRotation(camOrientation);
if (!m_pCharacter || m_currentViewMode == EViewMode::Spectator)
{
FreeMovement(travelSpeed, travelAngle, frameTime);
}
if (m_pCharacter && m_currentViewMode != EViewMode::Spectator)
{
UpdateCharacter(travelSpeed, travelAngle, rotationSpeed, frameTime);
}
m_mouseDeltaRotation = ZERO;
CheckInteractables();
}
break;
case Cry::Entity::EEvent::Reset:
{
}
break;
}
}
void CPlayerComponent::FreeMovement(float travelSpeed, float travelAngle, float frameTime)
{
const float spectatorSpeed = 20.5f;
Vec3 velocity = Vec3(travelAngle, travelSpeed, 0).normalized();
velocity.z = 0;
Matrix34 transformation = m_pEntity->GetWorldTM();
transformation.AddTranslation(transformation.TransformVector(velocity * spectatorSpeed * frameTime));
m_pEntity->SetWorldTM(transformation);
}
void CPlayerComponent::UpdateCharacter(float travelSpeed, float travelAngle, float rotationSpeed, float frameTime)
{
Ang3 characterYPR = CCamera::CreateAnglesYPR(Matrix33(m_lookOrientation));
characterYPR.x += m_mouseDeltaRotation.x * rotationSpeed;
characterYPR.z = 0;
characterYPR.y = 0;
m_lookOrientation = Quat(CCamera::CreateOrientationYPR(characterYPR));
m_pCharacter->UpdateRotation(m_lookOrientation);
m_pCharacter->UpdateMovement(travelSpeed, travelAngle);
m_pCharacter->UpdateLookOrientation(GetDirectionForIK());
const QuatT& entityOrientation = m_pCharacter->GetAnimComp()->GetCharacter()->GetISkeletonPose()->GetAbsJointByID(m_attachJointId);
m_pEntity->SetPos(LERP(m_pEntity->GetPos(), entityOrientation.t + m_activePos, 5.0f * frameTime));
}
Vec3 CPlayerComponent::GetDirectionForIK()
{
Vec3 finalLookDirection = m_pEntity->GetForwardDir();
if (m_currentViewMode == EViewMode::ThirdPerson)
{
finalLookDirection *= 2.0f; //We move the position out a bit to make 3rd person follow better
}
return finalLookDirection;
}
void CPlayerComponent::SetPosOnAttach()
{
const QuatT& entityOrientation = m_pCharacter->GetAnimComp()->GetCharacter()->GetISkeletonPose()->GetAbsJointByID(m_attachJointId);
m_pEntity->SetLocalTM(Matrix34::Create(Vec3(1.0f), IDENTITY, entityOrientation.t + m_activePos));
m_currentViewMode = m_viewBeforeSpectate;
}
void CPlayerComponent::SetCharacter(CCharacterComponent* character)
{
m_pCharacter = character;
m_attachJointId = m_pCharacter->GetAnimComp()->GetCharacter()->GetIDefaultSkeleton().GetJointIDByName("mixamorig:head");
m_activePos = m_thirdPersonPos;
m_currentViewMode = EViewMode::ThirdPerson;
}
void CPlayerComponent::CheckInteractables()
{
Vec3 origin = m_pEntity->GetWorldPos();
Vec3 direction = m_pEntity->GetForwardDir();
float distance = m_currentViewMode == EViewMode::FirstPerson ? 1.5f : 3.0f;
const unsigned int rayFlags = rwi_stop_at_pierceable | rwi_colltype_any;
ray_hit hitInfo;
if (gEnv->pPhysicalWorld->RayWorldIntersection(origin, direction * distance, ent_all, rayFlags, &hitInfo, 1, m_pCharacter->GetEntity()->GetPhysicalEntity()))
{
if (IEntity* pHitEntity = gEnv->pEntitySystem->GetEntityFromPhysics(hitInfo.pCollider))
{
if (pHitEntity == m_pInteractEntity)
return;
if (CInterfaceComponent* pInterfaceComp = pHitEntity->GetComponent<CInterfaceComponent>())
{
if (IInteractable* pInteractable = pInterfaceComp->GetInterface<IInteractable>())
{
if (m_pInteractEntity)
{
if (IRenderNode* pRenderNode = m_pInteractEntity->GetRenderNode())
{
pRenderNode->m_nHUDSilhouettesParam = RGBA8(0.0f, 0.0f, 0.0f, 0.0f);
}
}
m_pInteractEntity = pHitEntity;
if (IRenderNode* pRenderNode = pHitEntity->GetRenderNode())
{
//RGBA8 for Silhouette is actually ABGR instead of RGBA
pRenderNode->m_nHUDSilhouettesParam = RGBA8(1.0f, 0.0f, 0.0f, 255.0f);
}
SObjectData objData;
pInteractable->Observe(m_pCharacter, objData);
m_interactEvent.Invoke(objData, true);
return;
}
}
}
}
if (m_pInteractEntity)
{
m_interactEvent.Invoke(SObjectData(), false);
if (IRenderNode* pRenderNode = m_pInteractEntity->GetRenderNode())
{
pRenderNode->m_nHUDSilhouettesParam = RGBA8(0.0f, 0.0f, 0.0f, 0.0f);
}
m_pInteractEntity = nullptr;
}
}
void CPlayerComponent::RegisterInputs()
{
m_pInputComponent->RegisterAction("player", "moveleft", [this](int activationMode, float value) { HandleInputFlagChange(EInputFlag::MoveLeft, (EActionActivationMode)activationMode); });
m_pInputComponent->BindAction("player", "moveleft", eAID_KeyboardMouse, EKeyId::eKI_A);
m_pInputComponent->RegisterAction("player", "moveright", [this](int activationMode, float value) { HandleInputFlagChange(EInputFlag::MoveRight, (EActionActivationMode)activationMode); });
m_pInputComponent->BindAction("player", "moveright", eAID_KeyboardMouse, EKeyId::eKI_D);
m_pInputComponent->RegisterAction("player", "moveforward", [this](int activationMode, float value) { HandleInputFlagChange(EInputFlag::MoveForward, (EActionActivationMode)activationMode); });
m_pInputComponent->BindAction("player", "moveforward", eAID_KeyboardMouse, EKeyId::eKI_W);
m_pInputComponent->RegisterAction("player", "moveback", [this](int activationMode, float value) { HandleInputFlagChange(EInputFlag::MoveBack, (EActionActivationMode)activationMode); });
m_pInputComponent->BindAction("player", "moveback", eAID_KeyboardMouse, EKeyId::eKI_S);
m_pInputComponent->RegisterAction("player", "mouse_rotateyaw", [this](int activationMode, float value) { m_mouseDeltaRotation.x -= value; });
m_pInputComponent->BindAction("player", "mouse_rotateyaw", eAID_KeyboardMouse, EKeyId::eKI_MouseX);
m_pInputComponent->RegisterAction("player", "mouse_rotatepitch", [this](int activationMode, float value) { m_mouseDeltaRotation.y -= value; });
m_pInputComponent->BindAction("player", "mouse_rotatepitch", eAID_KeyboardMouse, EKeyId::eKI_MouseY);
m_pInputComponent->RegisterAction("player", "jump", [this](int activationMode, float value)
{
if (m_pCharacter)
m_pCharacter->ProcessJump();
});
m_pInputComponent->BindAction("player", "jump", eAID_KeyboardMouse, eKI_Space, true, false, false);
m_pInputComponent->RegisterAction("player", "changeviewmode", [this](int activationMode, float value)
{
if (m_currentViewMode == EViewMode::Spectator)
return;
m_currentViewMode = m_currentViewMode == EViewMode::ThirdPerson ? EViewMode::FirstPerson : EViewMode::ThirdPerson;
switch (m_currentViewMode)
{
case EViewMode::FirstPerson:
{
m_pCharacter->ChangeCharacter("Objects/Characters/exo_swat/exo_swat_1p.cdf", "FirstPersonCharacter");
m_activePos = m_firstPersonPos;
m_attachJointId = m_pCharacter->GetAnimComp()->GetCharacter()->GetIDefaultSkeleton().GetJointIDByName("mixamorig:head");
}
break;
case EViewMode::ThirdPerson:
{
m_pCharacter->ChangeCharacter("Objects/Characters/exo_swat/exo_swat_3p.cdf", "ThirdPersonCharacter");
m_activePos = m_thirdPersonPos;
m_attachJointId = m_pCharacter->GetAnimComp()->GetCharacter()->GetIDefaultSkeleton().GetJointIDByName("mixamorig:head");
}
break;
}
});
m_pInputComponent->BindAction("player", "changeviewmode", eAID_KeyboardMouse, eKI_F, true, false, false);
m_pInputComponent->RegisterAction("player", "interact", [this](int activationMode, float value)
{
if (!m_pCharacter || m_currentViewMode == EViewMode::Spectator)
return;
if (m_pInteractEntity)
{
if (CInterfaceComponent* pInterfaceComp = m_pInteractEntity->GetComponent<CInterfaceComponent>())
{
if (IInteractable* pInteract = pInterfaceComp->GetInterface<IInteractable>())
{
pInteract->Interact(m_pCharacter);
}
}
}
});
m_pInputComponent->BindAction("player", "interact", eAID_KeyboardMouse, eKI_E, true, false, false);
m_pInputComponent->RegisterAction("player", "firebutton", [this](int activationMode, float value)
{
if (m_currentViewMode == EViewMode::Spectator)
return;
if (m_pCharacter)
{
switch (activationMode)
{
case EActionActivationMode::eAAM_OnPress:
m_pCharacter->ProcessFire(true);
break;
case EActionActivationMode::eAAM_OnRelease:
m_pCharacter->ProcessFire(false);
break;
default:
break;
}
}
});
m_pInputComponent->BindAction("player", "fireButton", eAID_KeyboardMouse, eKI_Mouse1, true, true, false);
m_pInputComponent->RegisterAction("player", "reloadweapon", [this](int activationMode, float value)
{
if (m_currentViewMode == EViewMode::Spectator)
return;
if (m_pCharacter)
{
m_pCharacter->ProcessReload();
}
});
m_pInputComponent->BindAction("player", "reloadweapon", eAID_KeyboardMouse, eKI_R, true, false, false);
m_pInputComponent->RegisterAction("player", "switchfiremode", [this](int activationMode, float value)
{
if (m_currentViewMode == EViewMode::Spectator)
return;
if (m_pCharacter)
{
m_pCharacter->SwitchFireMode();
}
});
m_pInputComponent->BindAction("player", "switchfiremode", eAID_KeyboardMouse, eKI_X, true, false, false);
m_pInputComponent->RegisterAction("player", "swapweapons", [this](int activationMode, float value)
{
m_pCharacter->GetEquipmentComponent()->SwapWeapons();
});
m_pInputComponent->BindAction("player", "swapweapons", eAID_KeyboardMouse, eKI_Q, true, false, false);
m_pInputComponent->RegisterAction("player", "sprint", [this](int activationMode, float value)
{
if (m_currentViewMode == EViewMode::Spectator)
return;
switch (activationMode)
{
case EActionActivationMode::eAAM_OnPress:
if (m_pCharacter)
{
m_pCharacter->ProcessSprinting(true);
}
break;
case EActionActivationMode::eAAM_OnRelease:
if (m_pCharacter)
{
m_pCharacter->ProcessSprinting(false);
}
break;
default:
break;
}
});
m_pInputComponent->BindAction("player", "sprint", eAID_KeyboardMouse, eKI_LShift, true, true, false);
m_pInputComponent->RegisterAction("player", "spectate", [this](int activationMode, float value)
{
if (m_currentViewMode == EViewMode::Spectator)
{
if (m_pCharacter)
{
m_pCharacter->GetEntity()->AttachChild(m_pEntity);
SetPosOnAttach();
}
}
else
{
if (m_pCharacter)
m_pEntity->DetachThis();
m_viewBeforeSpectate = m_currentViewMode;
m_currentViewMode = EViewMode::Spectator;
}
});
m_pInputComponent->BindAction("player", "spectate", eAID_KeyboardMouse, eKI_F1, true, false, false);
}
void CPlayerComponent::HandleInputFlagChange(const CEnumFlags<EInputFlag> flags, const CEnumFlags<EActionActivationMode> activationMode, const EInputFlagType type)
{
switch (type)
{
case EInputFlagType::Hold:
{
if (activationMode == eAAM_OnRelease)
{
m_inputFlags &= ~flags;
}
else
{
m_inputFlags |= flags;
}
}
break;
case EInputFlagType::Toggle:
{
if (activationMode == eAAM_OnRelease)
{
// Toggle the bit(s)
m_inputFlags ^= flags;
}
}
break;
}
} | 32.732697 | 192 | 0.741816 | Battledrake |
4b9f3cea2d12514a0b68770f7c965e39c90e1a91 | 2,838 | cpp | C++ | src/Adafruit_I2CRegister.cpp | nrobinson2000/Adafruit_VEML7700 | ad29bfb331ad08ed6e40de68abae6455f99760bf | [
"BSD-3-Clause"
] | 3 | 2019-07-19T23:47:53.000Z | 2019-07-22T03:45:10.000Z | src/Adafruit_I2CRegister.cpp | nrobinson2000/Adafruit_VEML7700 | ad29bfb331ad08ed6e40de68abae6455f99760bf | [
"BSD-3-Clause"
] | 1 | 2019-11-15T22:59:55.000Z | 2019-11-15T22:59:55.000Z | src/Adafruit_I2CRegister.cpp | nrobinson2000/Adafruit_VEML7700 | ad29bfb331ad08ed6e40de68abae6455f99760bf | [
"BSD-3-Clause"
] | null | null | null | #include "Adafruit_I2CRegister.h"
Adafruit_I2CRegister::Adafruit_I2CRegister(Adafruit_I2CDevice *device, uint16_t reg_addr, uint8_t width, uint8_t bitorder, uint8_t address_width) {
_device = device;
_addrwidth = address_width;
_address = reg_addr;
_bitorder = bitorder;
_width = width;
}
bool Adafruit_I2CRegister::write(uint8_t *buffer, uint8_t len) {
uint8_t addrbuffer[2] = {(uint8_t)(_address & 0xFF), (uint8_t)(_address>>8)};
if (! _device->write(buffer, len, true, addrbuffer, _addrwidth)) {
return false;
}
return true;
}
bool Adafruit_I2CRegister::write(uint32_t value, uint8_t numbytes) {
if (numbytes == 0) {
numbytes = _width;
}
if (numbytes > 4) {
return false;
}
for (int i=0; i<numbytes; i++) {
if (_bitorder == LSBFIRST) {
_buffer[i] = value & 0xFF;
} else {
_buffer[numbytes-i-1] = value & 0xFF;
}
value >>= 8;
}
return write(_buffer, numbytes);
}
// This does not do any error checking! returns 0xFFFFFFFF on failure
uint32_t Adafruit_I2CRegister::read(void) {
if (! read(_buffer, _width)) {
return -1;
}
uint32_t value = 0;
for (int i=0; i < _width; i++) {
value <<= 8;
if (_bitorder == LSBFIRST) {
value |= _buffer[_width-i-1];
} else {
value |= _buffer[i];
}
}
return value;
}
bool Adafruit_I2CRegister::read(uint8_t *buffer, uint8_t len) {
_buffer[0] = _address;
if (! _device->write_then_read(_buffer, 1, buffer, len)) {
return false;
}
return true;
}
bool Adafruit_I2CRegister::read(uint16_t *value) {
if (! read(_buffer, 2)) {
return false;
}
if (_bitorder == LSBFIRST) {
*value = _buffer[1];
*value <<= 8;
*value |= _buffer[0];
} else {
*value = _buffer[0];
*value <<= 8;
*value |= _buffer[1];
}
return true;
}
bool Adafruit_I2CRegister::read(uint8_t *value) {
if (! read(_buffer, 1)) {
return false;
}
*value = _buffer[0];
return true;
}
void Adafruit_I2CRegister::print(Stream *s) {
uint32_t val = read();
s->print("0x"); s->print(val, HEX);
}
void Adafruit_I2CRegister::println(Stream *s) {
print(s);
s->println();
}
Adafruit_I2CRegisterBits::Adafruit_I2CRegisterBits(Adafruit_I2CRegister *reg, uint8_t bits, uint8_t shift) {
_register = reg;
_bits = bits;
_shift = shift;
}
uint32_t Adafruit_I2CRegisterBits::read(void) {
uint32_t val = _register->read();
val >>= _shift;
return val & ((1 << (_bits+1)) - 1);
}
void Adafruit_I2CRegisterBits::write(uint32_t data) {
uint32_t val = _register->read();
// mask off the data before writing
uint32_t mask = (1 << (_bits+1)) - 1;
data &= mask;
mask <<= _shift;
val &= ~mask; // remove the current data at that spot
val |= data << _shift; // and add in the new data
_register->write(val, _register->width());
} | 22 | 147 | 0.634249 | nrobinson2000 |
4ba1b62c5c53e99eaca43b4436efb9366426c299 | 4,566 | cpp | C++ | share/crts/plugins/Filters/readline.cpp | xywzwd/VT-Wireless | ec42e742e2be26310df4b25cef9cea873896890b | [
"MIT"
] | 6 | 2019-01-05T08:30:32.000Z | 2022-03-10T08:19:57.000Z | share/crts/plugins/Filters/readline.cpp | xywzwd/VT-Wireless | ec42e742e2be26310df4b25cef9cea873896890b | [
"MIT"
] | 4 | 2019-10-18T14:31:04.000Z | 2020-10-16T16:52:30.000Z | share/crts/plugins/Filters/readline.cpp | xywzwd/VT-Wireless | ec42e742e2be26310df4b25cef9cea873896890b | [
"MIT"
] | 5 | 2017-05-12T21:24:18.000Z | 2022-03-10T08:20:02.000Z | #include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <readline/readline.h>
#include <readline/history.h>
#include "crts/debug.h"
#include "crts/Filter.hpp"
#include "crts/crts.hpp" // for: FILE *crtsOut
#define BUFLEN 1024
class Readline : public CRTSFilter
{
public:
Readline(int argc, const char **argv);
~Readline(void);
ssize_t write(void *buffer, size_t len, uint32_t channelNum);
private:
void run(void);
const char *prompt;
const char *sendPrefix;
size_t sendPrefixLen;
char *line; // last line read buffer
};
static void usage(const char *arg = 0)
{
char name[64];
if(arg)
fprintf(stderr, "module: %s: unknown option arg=\"%s\"\n",
CRTS_BASENAME(name, 64), arg);
fprintf(stderr,
"\n"
"\n"
"Usage: %s [ OPTIONS ]\n"
"\n"
" OPTIONS are optional.\n"
"\n"
" As an example you can run something like this:\n"
"\n"
" crts_radio -f rx [ --uhd addr=192.168.10.3 --freq 932 ] -f stdout\n"
"\n"
"\n"
" ---------------------------------------------------------------------------\n"
" OPTIONS\n"
" ---------------------------------------------------------------------------\n"
"\n"
"\n"
" --prompt PROMPT \n"
"\n"
"\n"
"\n --send-prefix PREFIX \n"
"\n"
"\n"
"\n"
"\n",
CRTS_BASENAME(name, 64));
errno = 0;
throw "usage help"; // This is how return an error from a C++ constructor
// the module loader will catch this throw.
}
Readline::Readline(int argc, const char **argv):
prompt("> "),
sendPrefix("received: "),
sendPrefixLen(strlen(sendPrefix)),
line(0)
{
int i = 0;
while(i<argc)
{
// TODO: Keep argument option parsing simple??
//
// argv[0] is the first argument
//
if(!strcmp("--prompt", argv[i]) && i+1 < argc)
{
prompt = argv[++i];
++i;
continue;
}
if(!strcmp("--send-prefix", argv[i]) && i+1 < argc)
{
sendPrefix = argv[++i];
sendPrefixLen = strlen(sendPrefix);
if(sendPrefixLen > BUFLEN/2)
{
fprintf(stderr,"argument: \"%s\" is to long\n\n",
argv[i-1]);
usage();
}
++i;
continue;
}
usage(argv[i]);
}
// Because libuhd pollutes stdout we must use a different readline
// prompt stream:
rl_outstream = crtsOut;
DSPEW();
}
Readline::~Readline(void)
{
if(line)
{
free(line);
line = 0;
}
// TODO: cleanup readline?
}
#define IS_WHITE(x) ((x) < '!' || (x) > '~')
//#define IS_WHITE(x) ((x) == '\n')
void Readline::run(void)
{
// get a line
line = readline(prompt);
if(!line)
{
stream->isRunning = false;
return;
}
#if 0
fprintf(stderr, "%s:%d: GOT: \"%s\" prompt=\"%s\"\n",
__BASE_FILE__, __LINE__, line, prompt);
#endif
// Strip off trailing white chars:
size_t len = strlen(line);
while(len && IS_WHITE(line[len -1]))
line[--len] = '\0';
//fprintf(stderr, "\n\nline=\"%s\"\n\n", line);
if(len < 1)
{
free(line);
line = 0;
return; // continue to next loop readline()
}
// TODO: add tab help, history saving, and other readline user
// interface stuff.
if(!strcmp(line, "exit") || !strcmp(line, "quit"))
{
stream->isRunning = false;
return;
}
ssize_t bufLen = len + sendPrefixLen + 2;
char *buffer = (char *) getBuffer(bufLen);
memcpy(buffer, sendPrefix, sendPrefixLen);
memcpy(&buffer[sendPrefixLen], line, len);
buffer[bufLen-2] = '\n';
buffer[bufLen-1] = '\0';
// We do not add the sendPrefix to the history. Note: buffer was
// '\0' terminated just above, so the history string is cool.
add_history(line);
free(line); // reset readline().
line = 0;
writePush((void *) buffer, bufLen, CRTSFilter::ALL_CHANNELS);
}
// This call will block until we get input.
//
// We write to crtsOut
//
ssize_t Readline::write(void *buffer_in, size_t bufferLen_in, uint32_t channelNum)
{
// This module is a source.
DASSERT(!buffer_in, "");
// Source filters loop like this, regular filters do not.
while(stream->isRunning)
run();
return 0; // done
}
// Define the module loader stuff to make one of these class objects.
CRTSFILTER_MAKE_MODULE(Readline)
| 21.041475 | 82 | 0.529566 | xywzwd |
4baa902f1c857f5cf35594d184ad7999702e3e25 | 1,043 | cpp | C++ | terminal/connimpls/TextCodecsDialog.cpp | chivstyle/comxd | d3eb006f866faf22cc8e1524afa0d99ae2049f79 | [
"MIT"
] | null | null | null | terminal/connimpls/TextCodecsDialog.cpp | chivstyle/comxd | d3eb006f866faf22cc8e1524afa0d99ae2049f79 | [
"MIT"
] | null | null | null | terminal/connimpls/TextCodecsDialog.cpp | chivstyle/comxd | d3eb006f866faf22cc8e1524afa0d99ae2049f79 | [
"MIT"
] | null | null | null | //
// (c) 2020 chiv
//
#include "terminal_rc.h"
#include "TextCodecsDialog.h"
#include "CodecFactory.h"
TextCodecsDialog::TextCodecsDialog(const char* name)
{
CtrlLayout(*this);
//
this->Title(t_("Select a text codec"));
this->Icon(terminal::text_codec());
//
auto codec_names = CodecFactory::Inst()->GetSupportedCodecNames();
for (size_t k = 0; k < codec_names.size(); ++k) {
mCodecs.Add(codec_names[k]);
}
mCodecs.SetData(name);
//
this->Acceptor(mOk, IDOK).Rejector(mCancel, IDCANCEL);
}
bool TextCodecsDialog::Key(Upp::dword key, int count)
{
dword flags = K_CTRL | K_ALT | K_SHIFT;
dword d_key = key & ~(flags | K_KEYUP); // key with delta
flags = key & flags;
if (key & Upp::K_KEYUP) {
if (flags == 0 && d_key == Upp::K_ESCAPE) {
Close();
return true;
}
}
return TopWindow::Key(key, count);
}
TextCodecsDialog::~TextCodecsDialog()
{
}
Upp::String TextCodecsDialog::GetCodecName() const
{
return mCodecs.Get();
}
| 22.191489 | 70 | 0.610738 | chivstyle |
4baecd5806579f89491db2fd56bdba15f2b80c43 | 398 | cc | C++ | src/rpcz/singleton_service_factory.cc | jinq0123/rpcz | d273dc1a8de770cb4c2ddee98c17ce60c657d6ca | [
"Apache-2.0"
] | 4 | 2015-06-14T13:38:40.000Z | 2020-11-07T02:29:59.000Z | src/rpcz/singleton_service_factory.cc | jinq0123/rpcz | d273dc1a8de770cb4c2ddee98c17ce60c657d6ca | [
"Apache-2.0"
] | 1 | 2015-06-19T07:54:53.000Z | 2015-11-12T10:38:21.000Z | src/rpcz/singleton_service_factory.cc | jinq0123/rpcz | d273dc1a8de770cb4c2ddee98c17ce60c657d6ca | [
"Apache-2.0"
] | 3 | 2015-06-15T02:28:39.000Z | 2018-10-18T11:02:59.000Z | // Author: Jin Qing (http://blog.csdn.net/jq0123)
#include <rpcz/singleton_service_factory.hpp>
#include <boost/make_shared.hpp>
#include <rpcz/mono_state_service.hpp>
namespace rpcz {
singleton_service_factory::singleton_service_factory(iservice& svc)
: service_(svc) {
}
iservice* singleton_service_factory::create()
{
return new mono_state_service(service_);
}
} // namespace rpcz
| 18.952381 | 67 | 0.761307 | jinq0123 |
4bb42b810567dbe097568b23e35fd8026be52179 | 332 | hpp | C++ | dynamic/wrappers/cell_based/AbstractCellPopulationBoundaryCondition3_3.cppwg.hpp | jmsgrogan/PyChaste | 48a9863d2c941c71e47ecb72e917b477ba5c1413 | [
"FTL"
] | 6 | 2017-02-04T16:10:53.000Z | 2021-07-01T08:03:16.000Z | dynamic/wrappers/cell_based/AbstractCellPopulationBoundaryCondition3_3.cppwg.hpp | jmsgrogan/PyChaste | 48a9863d2c941c71e47ecb72e917b477ba5c1413 | [
"FTL"
] | 6 | 2017-06-22T08:50:41.000Z | 2019-12-15T20:17:29.000Z | dynamic/wrappers/cell_based/AbstractCellPopulationBoundaryCondition3_3.cppwg.hpp | jmsgrogan/PyChaste | 48a9863d2c941c71e47ecb72e917b477ba5c1413 | [
"FTL"
] | 3 | 2017-05-15T21:33:58.000Z | 2019-10-27T21:43:07.000Z | #ifndef AbstractCellPopulationBoundaryCondition3_3_hpp__pyplusplus_wrapper
#define AbstractCellPopulationBoundaryCondition3_3_hpp__pyplusplus_wrapper
namespace py = pybind11;
void register_AbstractCellPopulationBoundaryCondition3_3_class(py::module &m);
#endif // AbstractCellPopulationBoundaryCondition3_3_hpp__pyplusplus_wrapper
| 47.428571 | 78 | 0.915663 | jmsgrogan |
4bb4d54b0dff96d9c2763aae213775de552d7c5c | 4,830 | cxx | C++ | plugins/examples/noise.cxx | kahlertfr/cgv | a48139eb8af777ab63c78c09fc6aa44592908bc7 | [
"BSD-3-Clause"
] | null | null | null | plugins/examples/noise.cxx | kahlertfr/cgv | a48139eb8af777ab63c78c09fc6aa44592908bc7 | [
"BSD-3-Clause"
] | null | null | null | plugins/examples/noise.cxx | kahlertfr/cgv | a48139eb8af777ab63c78c09fc6aa44592908bc7 | [
"BSD-3-Clause"
] | null | null | null | #include <cgv/gui/provider.h>
#include <cgv/gui/dialog.h>
#include <cgv/gui/file_dialog.h>
#include <cgv/data/data_format.h>
#include <cgv/os/clipboard.h>
#include <cgv/data/data_view.h>
#include <cgv/media/image/image_writer.h>
#include <cgv/render/drawable.h>
#include <cgv/render/context.h>
#include <cgv/render/texture.h>
#include <cgv/render/attribute_array_binding.h>
#include <cgv/render/frame_buffer.h>
#include <cgv/render/shader_program.h>
#include <cgv_gl/gl/gl.h>
#include <cgv/math/ftransform.h>
#include <random>
using namespace cgv::base;
using namespace cgv::gui;
using namespace cgv::data;
using namespace cgv::render;
using namespace cgv::utils;
using namespace cgv::type;
class noise : public node, public drawable, public provider
{
bool recreate_texture;
protected:
bool interpolate;
float density;
int w, h;
int mode;
texture T;
public:
noise()
{
set_name("noise");
w = 256;
h = 128;
mode = 0;
recreate_texture = true;
density = 0.5f;
interpolate = false;
T.set_mag_filter(TF_NEAREST);
T.set_wrap_s(cgv::render::TW_REPEAT);
T.set_wrap_t(cgv::render::TW_REPEAT);
}
void on_set(void* member_ptr)
{
if (member_ptr == &interpolate) {
T.set_mag_filter(interpolate ? TF_LINEAR : TF_NEAREST);
}
if (member_ptr == &w || member_ptr == &h || member_ptr == &mode || member_ptr == &density) {
recreate_texture = true;
}
update_member(member_ptr);
post_redraw();
}
void save()
{
std::string file_name = file_save_dialog("save noise to file",
"Image Files (bmp,png,jpg,tif):*.bmp;*.png;*.jpg;*.tif|All Files:*.*");
if (file_name.empty())
return;
std::vector<rgba8> data(w*h);
create_texture_data(data);
cgv::data::data_format df(w, h, cgv::type::info::TI_UINT8, cgv::data::CF_RGBA);
cgv::data::data_view dv(&df, &data.front());
cgv::media::image::image_writer ir(file_name);
ir.write_image(dv);
}
void copy()
{
std::vector<rgba8> data(w*h);
create_texture_data(data);
std::vector<rgb8> rgb_data(w*h);
for (size_t i = 0; i < data.size(); ++i)
rgb_data[i] = data[i];
cgv::os::copy_rgb_image_to_clipboard(w, h, &rgb_data.front()[0]);
cgv::gui::message("copied image to clipboard");
}
void create_gui()
{
add_member_control(this, "w", (cgv::type::DummyEnum&)w, "dropdown", "enums='4=4,8=8,16=16,32=32,64=64,128=128,256=256,512=512'");
add_member_control(this, "h", (cgv::type::DummyEnum&)h, "dropdown", "enums='4=4,8=8,16=16,32=32,64=64,128=128,256=256,512=512'");
add_member_control(this, "mode", (DummyEnum&)mode, "dropdown", "enums='grey=0;white,brown'");
add_member_control(this, "density", density, "value_slider", "min=0;max=1;ticks=true");
add_member_control(this, "interpolate", interpolate, "toggle");
connect_copy(add_button("save to file")->click, cgv::signal::rebind(this, &noise::save));
connect_copy(add_button("copy to clipboard")->click, cgv::signal::rebind(this, &noise::copy));
}
bool init(context& ctx)
{
return true;
}
void draw_quad(context& ctx)
{
const vec2 P[4] = { vec2(-1,1), vec2(-1,-1), vec2(1,1), vec2(1,-1) };
const vec2 T[4] = { vec2(0,1), vec2(0.0f,0.0f), vec2(1,1), vec2(1.0f,0.0f) };
attribute_array_binding::set_global_attribute_array(ctx, 0, P, 4);
attribute_array_binding::enable_global_array(ctx, 0);
attribute_array_binding::set_global_attribute_array(ctx, 3, T, 4);
attribute_array_binding::enable_global_array(ctx, 3);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
attribute_array_binding::disable_global_array(ctx, 3);
attribute_array_binding::disable_global_array(ctx, 0);
}
void create_texture_data(std::vector<rgba8>& data)
{
std::default_random_engine g;
std::uniform_int_distribution<cgv::type::uint32_type> d(0,255);
for (auto& c : data) {
cgv::type::uint8_type v = d(g);
if (mode == 1)
v = v < density*255 ? 0 : 255;
else if (mode == 2)
v = (v + d(g) + d(g) + d(g))/4;
c[0] = c[1] = c[2] = v;
c[3] = 255;
}
}
void init_frame(context& ctx)
{
if (!recreate_texture)
return;
std::vector<rgba8> data(w*h);
create_texture_data(data);
cgv::data::data_format df(w, h, cgv::type::info::TI_UINT8, cgv::data::CF_RGBA);
cgv::data::data_view dv(&df, &data.front());
T.create(ctx, dv);
recreate_texture = false;
}
void draw(context& ctx)
{
glDisable(GL_CULL_FACE);
ctx.push_modelview_matrix();
ctx.mul_modelview_matrix(cgv::math::scale4<double>(double(w) / h, -1.0, 1.0));
ctx.ref_default_shader_program(true).enable(ctx);
ctx.set_color(rgb(1, 1, 1));
T.enable(ctx);
draw_quad(ctx);
T.disable(ctx);
ctx.ref_default_shader_program(true).disable(ctx);
ctx.pop_modelview_matrix();
glEnable(GL_CULL_FACE);
}
};
#include <cgv/base/register.h>
/// register a factory to create new cubes
extern cgv::base::factory_registration<noise> noise_fac("new/algorithms/noise", 'N');
| 30.764331 | 131 | 0.68323 | kahlertfr |
4bb9ead4e506077a4414a01d0d8c39b7458eb9d3 | 1,508 | cpp | C++ | src/tests/src/loader/token-test.cpp | Penguin-Guru/imgbrd-grabber | 69bdd5566dc2b2cb3a67456bf1a159d544699bc9 | [
"Apache-2.0"
] | 1,449 | 2015-03-16T02:21:41.000Z | 2022-03-31T22:49:10.000Z | src/tests/src/loader/token-test.cpp | sisco0/imgbrd-grabber | 89bf97ccab3df62286784baac242f00bf006d562 | [
"Apache-2.0"
] | 2,325 | 2015-03-16T02:23:30.000Z | 2022-03-31T21:38:26.000Z | src/tests/src/loader/token-test.cpp | evanjs/imgbrd-grabber | 491f8f3c05be3fc02bc10007735c5afa19d47449 | [
"Apache-2.0"
] | 242 | 2015-03-22T11:00:54.000Z | 2022-03-31T12:37:15.000Z | #include "loader/token.h"
#include "catch.h"
TEST_CASE("Token")
{
SECTION("LazyNotCalled")
{
int callCount = 0;
Token token([&callCount]() { return ++callCount; });
REQUIRE(callCount == 0);
}
SECTION("LazyWithCaching")
{
int callCount = 0;
Token token([&callCount]() { return ++callCount; }, true);
token.value();
int val = token.value().toInt();
REQUIRE(callCount == 1);
REQUIRE(val == 1);
}
SECTION("LazyWithoutCaching")
{
int callCount = 0;
Token token([&callCount]() { return ++callCount; }, false);
token.value();
int val = token.value().toInt();
REQUIRE(callCount == 2);
REQUIRE(val == 2);
}
SECTION("Compare")
{
REQUIRE(Token(13) == Token(13));
REQUIRE(Token(13) != Token(17));
REQUIRE(Token("test") == Token("test"));
REQUIRE(Token("test") != Token("not_test"));
REQUIRE(Token(QStringList() << "1" << "2") == Token(QStringList() << "1" << "2"));
REQUIRE(Token(QStringList() << "1" << "2") != Token(QStringList() << "1" << "2" << "3"));
}
SECTION("Value")
{
Token token(13);
QVariant val = token.value();
REQUIRE(val.toInt() == 13);
const QVariant &valRef = token.value();
REQUIRE(valRef.toInt() == 13);
}
SECTION("Value template")
{
REQUIRE(Token(13).value<int>() == 13);
Token token("test");
REQUIRE(token.value<QString>() == "test");
QString val = token.value<QString>();
REQUIRE(val.toUpper() == "TEST");
const QString &valRef = token.value<QString>();
REQUIRE(valRef.toUpper() == "TEST");
}
}
| 19.842105 | 91 | 0.596154 | Penguin-Guru |
4bbedc44c3bc6733c71401f63541e7b6d10c51c7 | 7,795 | cpp | C++ | test/readme-example.cpp | gabrielheinrich/pure-cpp | c774b135745bbb8b47a5bdfd728063e4ea0268fb | [
"BSL-1.0"
] | 8 | 2019-06-27T02:28:03.000Z | 2021-12-16T17:57:22.000Z | test/readme-example.cpp | gabrielheinrich/pure-cpp | c774b135745bbb8b47a5bdfd728063e4ea0268fb | [
"BSL-1.0"
] | null | null | null | test/readme-example.cpp | gabrielheinrich/pure-cpp | c774b135745bbb8b47a5bdfd728063e4ea0268fb | [
"BSL-1.0"
] | null | null | null | #if defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wunused-comparison"
#pragma GCC diagnostic ignored "-Wunused-variable"
#endif
#if defined (_MSC_VER)
#pragma warning (disable : 4553 4834 4521)
#endif
#include <pure/core.hpp>
// Not strictly necessary but highly recommended
using namespace pure;
int main() {
// ******************************************************
// # Builtin Categories
// ******************************************************
// Nil
auto n = nullptr;
// Bool
auto b = true;
// Int
auto i = 0;
// Double
auto d = 0.0;
// Character
auto c = 'a';
// String
auto s = "String";
auto s_id = STR ("String"); // Compile-time constexpr
// Vector
auto v = VEC (1, true, "Hello World");
// Function
auto f = [] (auto&& name) { return concat ("Hello ", FORWARD(name)); };
auto m = MAP (STR ("a"), 1, STR ("b"), 2, STR ("c"), 3);
// Set
auto S = [] (const auto& x) -> bool { return x < 10 && (x % 2 == 0); };
// Error
auto e = operation_not_supported(); // Error
// Object
auto o = IO::fopen ("test.txt", "w");
// ******************************************************
// # Sets
// ******************************************************
// Sets are named in uppercase by convention
// They are called like functions
Nil (nullptr);
Nil (0) == false;
Bool (true);
Int (123);
// Range of Integers 0, 1, .. 10
Ints <0, 10> (7);
Double (123.0);
Character (U'\u00DF');
String ("Hello World");
String (STR ("ns::name"));
Vector<Ints <1, 3>> (VEC (1, 2, 3));
Vector<Any> (VEC (1, "2", '3'));
Tuple<Int, String, Character> (VEC (1, "2", '3'));
Function<String, Int> (MAP ("a", 1, "b", 2, "c", 3));
Record<STR ("name"), String, STR ("age"), Int> (MAP (STR ("name"), "Albert",
STR ("age"), 99));
Set<Any> (Set<Any>);
// Every boolean function is a set
Set<Any> ([] (int x) -> bool {return x % 2 == 0;});
Error (operation_not_supported());
Object (stdout);
Any (nullptr);
None (nullptr) == false;
// ******************************************************
// # Gradual typesystem
// ******************************************************
// var is the most basic type to hold arbitrary values
var x = "Hello World";
var x_1 = 42;
var x_2 = VEC ("Hello", "World");
var x_3 = stdout;
// There are multiple other types, which all inherit from var, but add
// further restrictions
// uniquely owned heap allocated Object of unknown type
unique<> x_unique = "Hello World";
// ref counted heap allocated Object of unknown type
shared<> x_shared = "Hello World";
// Object of type Basic::String with dynamically handled ownership
some<Basic::String> x_string = "Hello World";
// Some Basic::String or nullptr
maybe<Basic::String> x_maybe_string = nullptr;
// Allocated on the stack
immediate<Boxed<const char*>> x_cstring = "Hello World";
// 'fully' typed string
unique<Basic::String> x_unique_string = "Hello World";
// ******************************************************
// # Domains
// ******************************************************
// Every type has a domain, which is a constexpr set
domain<unique<Basic::String>> ("Hello World"); // true
// A type's domain can be restricted
restrict<var, String> x_restricted = "Hello World"; // Ok
// Domains can be used for static and dynamic checking
// This wouldn't compile because domain<int> and String don't overlap
// restrict <var, String> x_restricted = 42; Static Error
// This will compile, but throw an exception at runtime
try {
restrict<var, Ints<0, 10>> x_dyn_restricted = 42; // Dynamic Error
}
catch (...) { }
// ******************************************************
// # Basic Operations
// ******************************************************
// operators == != < > <= >= + - * / % work as known from C++
true == 1.0; // true
// equal checks strict value equality
equal (true, 1.0) == false;
// Vectors and strings are also comparable
VEC (1, 2, 3) < VEC (1, 2, 4);
compare (VEC (1, 2, 3), VEC (1, 2, 4)) == -1;
// Comparison operators can be used accross categories
VEC (1, 2, 3) != "1, 2, 3";
// ******************************************************
// # Functional
// ******************************************************
// All strings, vectors, functions and sets are functional values
// apply applies some arguments to a functional value
apply (Int, 1) == true;
apply (compare, 3, 5) == -1;
apply (MAP ("a", 1, "b", 2), "b") == 2;
pure::apply (VEC (1, 2, 3), 1) == 2;
apply ("Hello", 2) == 'l';
// Functions, sets (and some vectors) also forward the call operator to
// apply
Int (1) == true;
compare (3, 5) == -1;
MAP ("a", 1, "b", 2) ("b") == 2;
// set (f, key, value) returns a new value in which key is mapped to value
set (MAP (), "a", 1) == MAP ("a", 1);
set (VEC (nullptr, 2, 3), 0, 1) == VEC (1, 2, 3);
set ("Hello", 4, U'\u00F8') == u8"Hellø";
// ******************************************************
// # Enumerable
// ******************************************************
// All strings and vectors and some functions and sets are enumerable
Enumerable ("Hello World");
Enumerable (VEC (1, 2, 3));
Enumerable (MAP ("a", 1, "b", 2));
Enumerable ([] (const auto& x) {return x + 1;}) == false;
Enumerable (Any) == false;
// Elements of enumerable values can be accessed through nth
nth (VEC (1, 2, 3), 0) == 1;
first (VEC (1, 2, 3)) == 1;
second (VEC (1, 2, 3)) == 2;
// count returns the number of elements in an enumerable value
count (VEC (1, 2, 3)) == 3;
count (MAP ("a", 1, "b", 2)) == 2;
Empty (VEC());
// append (v, element) returns a vector with element added to v
append (VEC (1, 2), 3) == VEC (1, 2, 3);
append (VEC (1, 2, 3), "End") == VEC (1, 2, 3, "End");
// concat (v1, v2) returns a vector that is the concatenation of v1 and v2
concat (VEC (1, 2), VEC (3, 4)) == VEC (1, 2, 3, 4);
// Functional style iteration
map ([] (auto&& x) {return x * 2;}, VEC (1, 2, 3)) == VEC (2, 4, 6);
filter (Int, VEC (1, 1.0, 2, "Hello World", 3)) == VEC (1, 2, 3);
reduce ([] (int result, int next) {return result + next;}, 0, VEC(1, 2, 3)) == 6;
// There's also support for traditional style iteration through the
// enumerator interface
auto accumulate = [] (const auto& vec, auto result) {
for (auto e = enumerate (vec); !e.empty(); e.next()) {
result += e.read();
}
return result;
};
accumulate (VEC (1, 2, 3), 0) == 6;
// ******************************************************
// # Formatting
// ******************************************************
// Values are printed in a JSON style
to_string (VEC (1, 2, 3)) == "[1, 2, 3]";
to_string (MAP (STR ("a"), 1, STR("b"), 2)) == "{\"a\" : 1, \"b\" : 2}";
// ******************************************************
// # Records
// ******************************************************
// Enumerable functions, which only have strings as keys are called
// records.
// If MAP is called with compile-time strings as keys, it returns an
// efficient tuple-like struct.
// Here the memory layout of the return value is equivalent to
// struct {double x; double y;}
auto point = MAP (STR ("x"), 1.0, STR ("y"), 2.0);
point ("x") == 1.0;
point (STR ("y")) == 2.0; // Compile-time lookup through type of STR ("y")
// Sets can be used to check 'type'
auto Point_2D = Record <STR ("x"), Double, STR ("y"), Double>;
Point_2D (point);
// ******************************************************
// # IO
// ******************************************************
// By convention all functions, which 'do' something, i.e. have
// side-effects, should be in the namespace IO
IO::print ("Hello World!");
IO::print_to (IO::fopen("test_tmp_file.txt", "w"), "Hello temporary file!");
return 0;
} | 28.658088 | 82 | 0.515202 | gabrielheinrich |
4bbfdcd60fab0aa46b4517c697884bd31f954f5d | 7,617 | cpp | C++ | gloom/src/Stars.cpp | DennisNTNU/TDT4230-Project | be84beb61c9e7dadf27b4b4752fa157e6843cf14 | [
"MIT"
] | null | null | null | gloom/src/Stars.cpp | DennisNTNU/TDT4230-Project | be84beb61c9e7dadf27b4b4752fa157e6843cf14 | [
"MIT"
] | null | null | null | gloom/src/Stars.cpp | DennisNTNU/TDT4230-Project | be84beb61c9e7dadf27b4b4752fa157e6843cf14 | [
"MIT"
] | null | null | null | #include "Stars.h"
#include <iostream>
#include "Asterism.h"
Stars::Stars(Gloom::Shader * shader, std::string starChartPath)
{
_shader = shader;
_modelMatrix = glm::mat4(1.0f);
if (readStarChart(starChartPath))
{
std::cout << "Failed to read starchart file!" << std::endl;
}
initVAO_Stars();
initVAO_Asterisms();
}
Stars::~Stars()
{
}
void Stars::draw(glm::mat4 * perspView)
{
_shader->activate();
glPointSize(2.0f);
glBindVertexArray(_vaoID_stars);
glUniformMatrix4fv(2, 1, GL_FALSE, &(_modelMatrix[0][0]));
glUniformMatrix4fv(3, 1, GL_FALSE, &((*perspView)[0][0]));
glDrawArrays(GL_POINTS, 0, _vertexCount_stars);
//glDrawArrays(GL_LINE_STRIP, 0, _vertexCount_stars);
//glDrawArrays(GL_LINES, 0, _vertexCount_stars);
//glDrawArrays(GL_TRIANGLES, 0, _vertexCount_stars);
//glDrawArrays(GL_TRIANGLE_FAN, 0, _vertexCount_stars);
glPointSize(1.0f);
glBindVertexArray(_vaoID_asterisms);
glUniformMatrix4fv(2, 1, GL_FALSE, &(_modelMatrix[0][0]));
glUniformMatrix4fv(3, 1, GL_FALSE, &((*perspView)[0][0]));
glDrawArrays(GL_LINES, 0, _vertexCount_asterisms);
_shader->deactivate();
}
void Stars::initVAO_Stars()
{
glGenVertexArrays(1, &_vaoID_stars);
glBindVertexArray(_vaoID_stars);
unsigned int _vboID[2];
glGenBuffers(2, _vboID);
// one vertex per star
_vertexCount_stars = int(stars.size());
int numDoubles = 3 * _vertexCount_stars; // positions
int numFloats = 4 * _vertexCount_stars; // colors
double* vertexPoses = new double[numDoubles];
float* vertexColors = new float[numFloats];
int k = 0;
int j = 0;
double dist = 0.0;
for (unsigned int i = 0; i < _vertexCount_stars; i++) {
dist = (600.0 + stars[i].dist) * 6378.0/8.0;
vertexPoses[k++] = dist * cos(stars[i].ra*3.141592653589793238462 / 12.0) * cos(stars[i].dec*3.141592653589793238462 / 180.0);
vertexPoses[k++] = dist * sin(stars[i].ra*3.141592653589793238462 / 12.0) * cos(stars[i].dec*3.141592653589793238462 / 180.0);
vertexPoses[k++] = dist * sin(stars[i].dec*3.141592653589793238462 / 180.0);
//float factor = 0.9f - 0.9f * (*stars)[i].mag / 8.0f;
float factor = float(1.0 / (1.0 + pow(2.718281828, stars[i].mag - 3.5)));
vertexColors[j++] = factor;
vertexColors[j++] = factor;
vertexColors[j++] = factor;
vertexColors[j++] = 1.0;
}
glBindBuffer(GL_ARRAY_BUFFER, _vboID[0]);
glBufferData(GL_ARRAY_BUFFER, numDoubles*sizeof(double), vertexPoses, GL_STATIC_DRAW);
glVertexAttribPointer(0, 3, GL_DOUBLE, GL_FALSE, 3 * sizeof(double), 0);
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, _vboID[1]);
glBufferData(GL_ARRAY_BUFFER, numFloats*sizeof(float), vertexColors, GL_STATIC_DRAW);
glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(float), 0);
glEnableVertexAttribArray(1);
delete[] vertexPoses;
delete[] vertexColors;
}
void Stars::initVAO_Asterisms()
{
glGenVertexArrays(1, &_vaoID_asterisms);
glBindVertexArray(_vaoID_asterisms);
unsigned int _vboID[2];
glGenBuffers(2, _vboID);
Asterism asterisms;
asterisms.init();
_vertexCount_asterisms = 2 * asterisms.edges.size();
//_vertexCount_asterisms = 2 * 2;
double* vertexPoses = new double[3 * _vertexCount_asterisms];
float* vertexColors = new float[4 * _vertexCount_asterisms];
for (unsigned int i = 0; i < _vertexCount_asterisms / 2; i++)
{
int indexStart = hip_to_index[asterisms.edges[i].star1];
int indexEnd = hip_to_index[asterisms.edges[i].star2];
//double distStart = (150.0 + stars[indexStart].dist) * 6378.0;
//double distEnd = (150.0 + stars[indexEnd].dist) * 6378.0;
double distStart = (600.0 + stars[indexStart].dist) * 6378.0/8.0;
double distEnd = (600.0 + stars[indexEnd].dist) * 6378.0/8.0;
vertexPoses[6 * i + 0] = distStart * cos(stars[indexStart].ra*3.141592653589793238462 / 12.0) * cos(stars[indexStart].dec*3.141592653589793238462 / 180.0);
vertexPoses[6 * i + 1] = distStart * sin(stars[indexStart].ra*3.141592653589793238462 / 12.0) * cos(stars[indexStart].dec*3.141592653589793238462 / 180.0);
vertexPoses[6 * i + 2] = distStart * sin(stars[indexStart].dec*3.141592653589793238462 / 180.0);
vertexPoses[6 * i + 3] = distEnd * cos(stars[indexEnd].ra*3.141592653589793238462 / 12.0) * cos(stars[indexEnd].dec*3.141592653589793238462 / 180.0);
vertexPoses[6 * i + 4] = distEnd * sin(stars[indexEnd].ra*3.141592653589793238462 / 12.0) * cos(stars[indexEnd].dec*3.141592653589793238462 / 180.0);
vertexPoses[6 * i + 5] = distEnd * sin(stars[indexEnd].dec*3.141592653589793238462 / 180.0);
vertexColors[8 * i + 0] = 0.7;
vertexColors[8 * i + 1] = 0.7;
vertexColors[8 * i + 2] = 0.9;
vertexColors[8 * i + 3] = 0.3;
vertexColors[8 * i + 4] = 0.7;
vertexColors[8 * i + 5] = 0.7;
vertexColors[8 * i + 6] = 0.9;
vertexColors[8 * i + 7] = 0.3;
}
glBindBuffer(GL_ARRAY_BUFFER, _vboID[0]);
glBufferData(GL_ARRAY_BUFFER, 3 * _vertexCount_asterisms * sizeof(double), vertexPoses, GL_STATIC_DRAW);
glVertexAttribPointer(0, 3, GL_DOUBLE, GL_FALSE, 3 * sizeof(double), 0);
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, _vboID[1]);
glBufferData(GL_ARRAY_BUFFER, 4 * _vertexCount_asterisms * sizeof(float), vertexColors, GL_STATIC_DRAW);
glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(float), 0);
glEnableVertexAttribArray(1);
delete[] vertexPoses;
delete[] vertexColors;
}
bool Stars::readStarChart(std::string path)
{
std::ifstream file(path, std::ios::in);
if (file.fail()) {
perror(path.c_str());
return true;
}
std::vector<std::string> rawData;
file.seekg(0, std::ios::beg);
char line[256];
while (!file.eof()) {
file.getline(line, 160);
rawData.emplace_back(std::string(line));
}
file.close();
int k = int(rawData.size());
Star star;
std::string temp;
int valueID;
int starIndex = 0;
double maxDist = 0.0;
double filterDist = 1200.0;
double filterMag = 7.0;
// Iterates through each line i.e. through stars
for (int i = 1; i < k; i++) {
temp = "";
valueID = 0;
// iterates through chars in line
for (unsigned int j = 0; j < rawData[i].size(); j++) {
if (rawData[i][j] == ',') {
switch (++valueID) {
case 1:
star.id = atoi(temp.c_str());
break;
case 2:
star.hip = atoi(temp.c_str());
break;
case 8: // right ascention
star.ra = atof(temp.c_str());
break;
case 9: // declination
star.dec = atof(temp.c_str());
break;
case 10: // distance
star.dist = atof(temp.c_str());
break;
case 11: // magnitude
star.mag = atof(temp.c_str());
break;
case 12: // absolute Magnitude
star.absMag = atof(temp.c_str());
j = 160;
break;
default:
break;
}
temp = "";
}
else {
temp = temp + rawData[i][j];
}
}
if (star.mag < filterMag && star.dist < filterDist) {
stars.emplace_back(star);
hip_to_index[star.hip] = starIndex++;
if (maxDist < star.dist) { maxDist = star.dist; }
}
if (i % 1500 == 0) {
std::cout << i << " ";
}
}
std::cout << " There are " << stars.size() << " stars with magnitude less than " << filterMag << " and nearer than " << filterDist << ". Maximal Distance of those is " << maxDist << std::endl;
//std::cout << "ID: " << stars[0].id << " RA: " << stars[0].ra << " Dec: " << stars[0].dec << " Dist: " << stars[0].dist << " AbsMag: " << stars[0].absMag << std::endl;
return false;
} | 29.183908 | 194 | 0.64251 | DennisNTNU |
4bc3323da969d2e0b764d6a19c6cf7cda8ac9f12 | 168 | cpp | C++ | demos/http_demo.cpp | nathanmullenax83/rhizome | e7410341fdc4d38ab5aaecc55c94d3ac6efd51da | [
"MIT"
] | 1 | 2020-07-11T14:53:38.000Z | 2020-07-11T14:53:38.000Z | demos/http_demo.cpp | nathanmullenax83/rhizome | e7410341fdc4d38ab5aaecc55c94d3ac6efd51da | [
"MIT"
] | 1 | 2020-07-04T16:45:49.000Z | 2020-07-04T16:45:49.000Z | demos/http_demo.cpp | nathanmullenax83/rhizome | e7410341fdc4d38ab5aaecc55c94d3ac6efd51da | [
"MIT"
] | null | null | null | #include "http_demo.hpp"
namespace rhizome {
namespace demo {
void http_demo() {
rn::HTTPServer server(8080,10);
}
}
} | 16.8 | 43 | 0.505952 | nathanmullenax83 |
4bc55f3f6bb87df6369b1e16fd70729bbd6073e9 | 782 | cpp | C++ | src/resource/MemoryResource.cpp | nanzifan/Umpire-edit | 990895b527bef0716aaa0fbb0c0f2017e8e15882 | [
"MIT"
] | null | null | null | src/resource/MemoryResource.cpp | nanzifan/Umpire-edit | 990895b527bef0716aaa0fbb0c0f2017e8e15882 | [
"MIT"
] | null | null | null | src/resource/MemoryResource.cpp | nanzifan/Umpire-edit | 990895b527bef0716aaa0fbb0c0f2017e8e15882 | [
"MIT"
] | null | null | null | //////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2018, Lawrence Livermore National Security, LLC.
// Produced at the Lawrence Livermore National Laboratory
//
// Created by David Beckingsale, [email protected]
// LLNL-CODE-747640
//
// All rights reserved.
//
// This file is part of Umpire.
//
// For details, see https://github.com/LLNL/Umpire
// Please also see the LICENSE file for MIT license.
//////////////////////////////////////////////////////////////////////////////
#include "umpire/resource/MemoryResource.hpp"
namespace umpire {
namespace resource {
MemoryResource::MemoryResource(const std::string& name, int id) :
strategy::AllocationStrategy(name, id)
{
}
} // end of namespace resource
} // end of namespace umpire
| 28.962963 | 78 | 0.588235 | nanzifan |
4bccfc4405c2707254a17efe77467f5d02c2b41d | 1,664 | cpp | C++ | leetcode/medianoftwosortedarray.cpp | WIZARD-CXY/pl | 22b7f5d81804f4e333d3cff6433364ba1a0ac7ef | [
"Apache-2.0"
] | 1 | 2016-01-20T08:26:34.000Z | 2016-01-20T08:26:34.000Z | leetcode/medianoftwosortedarray.cpp | WIZARD-CXY/pl | 22b7f5d81804f4e333d3cff6433364ba1a0ac7ef | [
"Apache-2.0"
] | 1 | 2015-10-21T05:38:17.000Z | 2015-11-02T07:42:55.000Z | leetcode/medianoftwosortedarray.cpp | WIZARD-CXY/pl | 22b7f5d81804f4e333d3cff6433364ba1a0ac7ef | [
"Apache-2.0"
] | null | null | null | class Solution {
public:
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
int m=nums1.size();
int n=nums2.size();
int total = m+n;
if(total & 0x1){
return find_kth(nums1,m,nums2,n,total/2+1);
}else{
return (find_kth(nums1,m,nums2,n,total/2)
+find_kth(nums1,m,nums2,n,total/2+1))/2.0;
}
}
private:
int find_kth(vector<int> nums1, int m, vector<int> nums2, int n, int k){
//always let nums1's size smaller or equal to nums2
if(m>n){
return find_kth(nums2,n,nums1,m,k);
}
if(m==0){
return nums2[k-1];
}
if(k==1){
return min(nums1[0],nums2[0]);
}
//divide k into two parts
int mid1=min(k/2,m),mid2=k-mid1;
vector<int>::iterator iter;
if(nums1[mid1-1]<nums2[mid2-1]){
//safely ignore the mid1 number of elements in num1
iter=nums1.begin();
for(int i=0; i<mid1; i++){
iter++;
}
nums1.assign(iter,nums1.end());
return find_kth(nums1,nums1.size(),nums2,nums2.size(),k-mid1);
}else if (nums1[mid1-1]>nums2[mid2-1]){
iter=nums2.begin();
for(int i=0; i<mid2;i++){
iter++;
}
//safely ignore the mid2 number of elements in num2
nums2.assign(iter,nums2.end());
return find_kth(nums1,nums1.size(),nums2,nums2.size(),k-mid2);
}else{
return nums1[mid1-1];
}
}
}; | 29.714286 | 79 | 0.484375 | WIZARD-CXY |
4bd04aa516001a5c045a170b82b15a96af0ac994 | 655 | hpp | C++ | EngineBuilder/PolluxEngineSolution.hpp | GabyForceQ/PolluxEngine | 2dbc84ed1d434f1b6d794f775f315758f0e8cc49 | [
"BSD-3-Clause"
] | 3 | 2020-05-19T20:24:28.000Z | 2020-09-27T11:28:42.000Z | EngineBuilder/PolluxEngineSolution.hpp | GabyForceQ/PolluxEngine | 2dbc84ed1d434f1b6d794f775f315758f0e8cc49 | [
"BSD-3-Clause"
] | 31 | 2020-05-27T11:01:27.000Z | 2020-08-08T15:53:23.000Z | EngineBuilder/PolluxEngineSolution.hpp | GabyForceQ/PolluxEngine | 2dbc84ed1d434f1b6d794f775f315758f0e8cc49 | [
"BSD-3-Clause"
] | null | null | null | /*****************************************************************************************************************************
* Copyright 2020 Gabriel Gheorghe. All rights reserved.
* This code is licensed under the BSD 3-Clause "New" or "Revised" License
* License url: https://github.com/GabyForceQ/PolluxEngine/blob/master/LICENSE
*****************************************************************************************************************************/
#pragma once
namespace Pollux::EngineBuilder
{
class PolluxEngineSolution final : public BuildSystem::Solution
{
public:
PolluxEngineSolution(const std::string& path) noexcept;
};
} | 40.9375 | 127 | 0.470229 | GabyForceQ |
4bd14f533a2faca521e7265842253784514442c5 | 1,517 | cc | C++ | src/file.cc | cloudcosmonaut/Browser | 4534b66266d73afdd8c80bea437a740b87e8c645 | [
"MIT"
] | null | null | null | src/file.cc | cloudcosmonaut/Browser | 4534b66266d73afdd8c80bea437a740b87e8c645 | [
"MIT"
] | null | null | null | src/file.cc | cloudcosmonaut/Browser | 4534b66266d73afdd8c80bea437a740b87e8c645 | [
"MIT"
] | null | null | null | #include "file.h"
#include <fstream>
#include <sstream>
#include <stdexcept>
#ifdef LEGACY_CXX
#include <experimental/filesystem>
namespace n_fs = ::std::experimental::filesystem;
#else
#include <filesystem>
namespace n_fs = ::std::filesystem;
#endif
/**
* \brief Read file from disk
* \param path File path location to read the file from
* \throw std::runtime_error exception when file is not found (or not a regular file),
* or std::ios_base::failure when file can't be read
* \return Contents as string
*/
std::string File::read(const std::string& path)
{
if (n_fs::exists(path) && n_fs::is_regular_file(path))
{
std::ifstream inFile;
inFile.open(path, std::ifstream::in);
std::stringstream strStream;
strStream << inFile.rdbuf();
return strStream.str();
}
else
{
// File doesn't exists or isn't a file
throw std::runtime_error("File does not exists or isn't a regular file.");
}
}
/**
* \brief Write file to disk
* \param path File path location for storing the file
* \param content Content that needs to be written to file
* \throw std::ios_base::failure when file can't be written to
*/
void File::write(const std::string& path, const std::string& content)
{
std::ofstream file;
file.open(path.c_str());
file << content;
file.close();
}
/**
* \brief Retrieve filename from file path
* \param path Full path
* \return filename
*/
std::string File::getFilename(const std::string& path)
{
return n_fs::path(path).filename().string();
}
| 24.467742 | 86 | 0.685564 | cloudcosmonaut |
4bd282131724cd9b6e178bef15c75c41aef3c691 | 1,515 | cpp | C++ | engine/XML/custom_maps/source/XMLMapCoordinateReader.cpp | sidav/shadow-of-the-wyrm | 747afdeebed885b1a4f7ab42f04f9f756afd3e52 | [
"MIT"
] | 60 | 2019-08-21T04:08:41.000Z | 2022-03-10T13:48:04.000Z | engine/XML/custom_maps/source/XMLMapCoordinateReader.cpp | cleancoindev/shadow-of-the-wyrm | 51b23e98285ecb8336324bfd41ebf00f67b30389 | [
"MIT"
] | 3 | 2021-03-18T15:11:14.000Z | 2021-10-20T12:13:07.000Z | engine/XML/custom_maps/source/XMLMapCoordinateReader.cpp | cleancoindev/shadow-of-the-wyrm | 51b23e98285ecb8336324bfd41ebf00f67b30389 | [
"MIT"
] | 8 | 2019-11-16T06:29:05.000Z | 2022-01-23T17:33:43.000Z | #include "RNG.hpp"
#include "XMLMapCoordinateReader.hpp"
using namespace std;
// Given a parent node, which may have either a Coord or a Random element (xs:choice),
// parse it and return an engine Coordinate.
Coordinate XMLMapCoordinateReader::parse_coordinate(const XMLNode& parent_node)
{
Coordinate c(0,0);
XMLNode child_node = XMLUtils::get_next_element_by_local_name(parent_node, "Coord");
if (!child_node.is_null())
{
c = parse_fixed_coordinate(child_node);
}
else
{
child_node = XMLUtils::get_next_element_by_local_name(parent_node, "Random");
if (!child_node.is_null())
{
c = parse_random_coordinate(child_node);
}
}
return c;
}
// Given a node of type Coord in the schema, return an engine Coordinate.
Coordinate XMLMapCoordinateReader::parse_fixed_coordinate(const XMLNode& coord_node)
{
Coordinate c(0,0);
if (!coord_node.is_null())
{
c.first = XMLUtils::get_child_node_int_value(coord_node, "Row");
c.second = XMLUtils::get_child_node_int_value(coord_node, "Col");
}
return c;
}
// Given a node of type Random in the schema, return an engine coordinate.
Coordinate XMLMapCoordinateReader::parse_random_coordinate(const XMLNode& random_coord_node)
{
Coordinate c(0,0);
vector<XMLNode> coord_nodes = XMLUtils::get_elements_by_local_name(random_coord_node, "Coord");
if (!coord_nodes.empty())
{
XMLNode node = coord_nodes.at(RNG::range(0, coord_nodes.size()-1));
c = parse_fixed_coordinate(node);
}
return c;
} | 25.677966 | 97 | 0.729373 | sidav |
4bd2b31960fe1d09770065136c147f3a38afa175 | 2,012 | cpp | C++ | the_concepts_and_practice_of_math_fin/Project5/ProjectB_7/test_framework/asian_ql.cpp | calvin456/intro_derivative_pricing | 0841fbc0344bee00044d67977faccfd2098b5887 | [
"MIT"
] | 5 | 2016-12-28T16:07:38.000Z | 2022-03-11T09:55:57.000Z | the_concepts_and_practice_of_math_fin/Project5/ProjectB_7/test_framework/asian_ql.cpp | calvin456/intro_derivative_pricing | 0841fbc0344bee00044d67977faccfd2098b5887 | [
"MIT"
] | null | null | null | the_concepts_and_practice_of_math_fin/Project5/ProjectB_7/test_framework/asian_ql.cpp | calvin456/intro_derivative_pricing | 0841fbc0344bee00044d67977faccfd2098b5887 | [
"MIT"
] | 5 | 2017-06-04T04:50:47.000Z | 2022-03-17T17:41:16.000Z | //asian_ql.cpp
//Wrapper function. Computes semi-analytical heston w/ QuantLib
//ref. quantlib asianoption.cpp
#include "asian_ql.h"
double asian_geo_call_ql(const Date& todaysDate_,
const Date& settlementDate_,
const Date& maturity_,
Real spot_,
Real strike,
Size m,
Spread dividendYield,
Rate riskFreeRate,
Volatility volatility
)
{
// set up dates
Calendar calendar = TARGET();
Date todaysDate = todaysDate_;
Date settlementDate = settlementDate_;
Date maturity = maturity_;
Settings::instance().evaluationDate() = todaysDate_;
DayCounter dc = Actual360();
Handle <Quote > spot(boost::shared_ptr<SimpleQuote>(new SimpleQuote(spot_)));
Handle<YieldTermStructure> qTS(boost::shared_ptr<YieldTermStructure>(
new FlatForward(settlementDate, dividendYield, dc)));
Handle<YieldTermStructure> rTS(boost::shared_ptr<YieldTermStructure>(
new FlatForward(settlementDate, riskFreeRate, dc)));
Handle<BlackVolTermStructure> volTS(boost::shared_ptr<BlackVolTermStructure>(
new BlackConstantVol(settlementDate, calendar, volatility, dc)));
boost::shared_ptr<BlackScholesMertonProcess> stochProcess(new BlackScholesMertonProcess(spot,qTS, rTS, volTS));
boost::shared_ptr<PricingEngine> engine(
new AnalyticDiscreteGeometricAveragePriceAsianEngine(stochProcess));
Average::Type averageType = Average::Geometric;
Real runningAccumulator = 1.0;
Size pastFixings = 0;
Size futureFixings = m;
Option::Type type = Option::Call;
boost::shared_ptr<StrikedTypePayoff> payoff(new PlainVanillaPayoff(type, strike));
boost::shared_ptr<Exercise> exercise(new EuropeanExercise(maturity));
std::vector<Date> fixingDates(futureFixings);
Integer dt = Integer(360 / futureFixings + 0.5);
fixingDates[0] = todaysDate + dt;
for (Size j = 1; j<futureFixings; j++)
fixingDates[j] = fixingDates[j - 1] + dt;
DiscreteAveragingAsianOption option(averageType, runningAccumulator,
pastFixings, fixingDates,
payoff, exercise);
option.setPricingEngine(engine);
return option.NPV();
}
| 28.742857 | 112 | 0.772366 | calvin456 |
4bd36c6e161394eb98a9dd0788b28ef2dc4012aa | 359 | cpp | C++ | src/Pizza/Americana.cpp | HugoPrat/Multi-process-threads-plazza-Cpp | ef97968a360e77ebeed69a96e44ed801c40e6509 | [
"0BSD"
] | 3 | 2019-12-01T10:18:12.000Z | 2020-02-22T10:54:36.000Z | src/Pizza/Americana.cpp | HugoPrat/Multi-process-threads-plazza-Cpp | ef97968a360e77ebeed69a96e44ed801c40e6509 | [
"0BSD"
] | null | null | null | src/Pizza/Americana.cpp | HugoPrat/Multi-process-threads-plazza-Cpp | ef97968a360e77ebeed69a96e44ed801c40e6509 | [
"0BSD"
] | null | null | null | /*
** EPITECH PROJECT, 2019
** CCP_plazza_2018
** File description:
** Americana
*/
#include "Pizza/Americana.hpp"
Americana_P::Americana_P(PizzaSize size, float multi) :
Pizza(Americana, size, 2 * multi)
{
this->_recipe.push_back(DOE);
this->_recipe.push_back(TOMATO);
this->_recipe.push_back(GRUYERE);
this->_recipe.push_back(STEAK);
} | 21.117647 | 55 | 0.699164 | HugoPrat |
4bd4766fdea5a1e9a5af3ed5e63601b099b16f0a | 695 | cpp | C++ | ALGO-5/main.cpp | codexvn/lanqiao | 16fbbecaa4e0f042dd2d402469aeda552149a1f7 | [
"MIT"
] | null | null | null | ALGO-5/main.cpp | codexvn/lanqiao | 16fbbecaa4e0f042dd2d402469aeda552149a1f7 | [
"MIT"
] | null | null | null | ALGO-5/main.cpp | codexvn/lanqiao | 16fbbecaa4e0f042dd2d402469aeda552149a1f7 | [
"MIT"
] | null | null | null | #include<iostream>
using namespace std;
int main() {
int MAX = 99999999;
int dis[20001] = {0}, u[200001] ,v[200001], l[200001];
fill(dis + 2, dis + 20001, MAX);
int n, m;
cin >> n >> m;
for(int i=1;i<=m;i++)
cin>>u[i]>>v[i]>>l[i];
for (int j = 1; j < n; j++) {
bool all_finished = true;
for (int i = 1; i <= m; i++) {
if (dis[v[i]] > dis[u[i]] + l[i]) {
dis[v[i]] = dis[u[i]] + l[i];
all_finished = false;
}
}
if (all_finished == true)
break;
}
for (int i = 2; i <= n; i++)
cout << dis[i]<<endl;
return 0;
}
| 23.965517 | 59 | 0.392806 | codexvn |
4bd8db499766c3075b65e8a612ce49e294ac3f58 | 1,465 | cpp | C++ | String/prefix_function/Codeforces_432D.Prefixes_and_Suffixes_prefix.cpp | sheikh-arman/icpc_2021_template | 2fc278576bb94ab3ee30a7e150b7b1f1b0e9c977 | [
"MIT"
] | null | null | null | String/prefix_function/Codeforces_432D.Prefixes_and_Suffixes_prefix.cpp | sheikh-arman/icpc_2021_template | 2fc278576bb94ab3ee30a7e150b7b1f1b0e9c977 | [
"MIT"
] | null | null | null | String/prefix_function/Codeforces_432D.Prefixes_and_Suffixes_prefix.cpp | sheikh-arman/icpc_2021_template | 2fc278576bb94ab3ee30a7e150b7b1f1b0e9c977 | [
"MIT"
] | null | null | null | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define PB push_back
#define VST(V) sort(V.begin(),V.end())
#define VSTrev(V) sort(V.begin(),V.end(),greater<long long int>())
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define base1 129
#define base2 137
#define MOD1 1479386893
#define MOD2 1928476349
#define MAX 2000010
ll cnt_ar[500010];
vector<ll> prefix_function(string s){
ll n=s.size();
vector<ll>prefix(n+1);
prefix[0]=0;
ll j=0;
for(ll i=1;i<n;i++){
while(j>0&&s[i]!=s[j]){
j=prefix[j-1];
}
if(s[i]==s[j]){
j++;
}
prefix[i]=j;
cnt_ar[j]++;
}
return prefix;
}
int main(){
//freopen("1input.txt","r",stdin);
fast;
ll tcase=1;
//cin>>tcase;
for(ll test=1;test<=tcase;test++){
string s;
cin>>s;
ll n=s.size();
for(ll i=0;i<=n;i++){
cnt_ar[i]=0;
}
vector<ll>V=prefix_function(s);vector<ll>ans;
for (int i = n-1; i > 0; i--)
cnt_ar[V[i-1]] += cnt_ar[i];
ll i=n-1;
ll j=V[n-1];
while(j>0){
if(s[j-1]==s[i]){
ans.PB(j);
}
j=V[j-1];
}
ans.PB(n);
VST(ans);
ll siz=ans.size();
cout<<siz<<"\n";
for(ll i=0;i<=n;i++){
cnt_ar[i]+=1;
}
for(ll i:ans){
cout<<i<<" ";
cout<<cnt_ar[i]<<"\n";
}
}
return 0;
}
| 21.544118 | 69 | 0.485324 | sheikh-arman |
4bd96fda5ba2095bb1cf532093b1ad7cd794cc04 | 518 | hpp | C++ | include/Utilities/TimeHelper.hpp | mmathys/blacksmith | 6735c10519a6e15b3490b7c7927b3652db9c9ecc | [
"MIT"
] | 1 | 2021-12-20T04:08:45.000Z | 2021-12-20T04:08:45.000Z | include/Utilities/TimeHelper.hpp | iwangjye/blacksmith | 01faacfaf9b619d5de9a8fcb9236f63510c7161d | [
"MIT"
] | null | null | null | include/Utilities/TimeHelper.hpp | iwangjye/blacksmith | 01faacfaf9b619d5de9a8fcb9236f63510c7161d | [
"MIT"
] | null | null | null | #ifndef BLACKSMITH_INCLUDE_UTILITIES_TIMEHELPER_HPP_
#define BLACKSMITH_INCLUDE_UTILITIES_TIMEHELPER_HPP_
#include <chrono>
inline int64_t get_timestamp_sec() {
return std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::system_clock::now().time_since_epoch()).count();
}
inline int64_t get_timestamp_us() {
return std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::system_clock::now().time_since_epoch()).count();
}
#endif //BLACKSMITH_INCLUDE_UTILITIES_TIMEHELPER_HPP_
| 30.470588 | 67 | 0.779923 | mmathys |
4bdc2aacd41ed2b2e6375f05dc56913a95edc115 | 18,710 | cpp | C++ | FaceRecognizer/seeta/FaceRecognizerPrivate.cpp | glcnzude126/SeetaFace2 | 1c8c20bf87e2d0a8f582a025869c184145a30b5d | [
"BSD-2-Clause"
] | null | null | null | FaceRecognizer/seeta/FaceRecognizerPrivate.cpp | glcnzude126/SeetaFace2 | 1c8c20bf87e2d0a8f582a025869c184145a30b5d | [
"BSD-2-Clause"
] | null | null | null | FaceRecognizer/seeta/FaceRecognizerPrivate.cpp | glcnzude126/SeetaFace2 | 1c8c20bf87e2d0a8f582a025869c184145a30b5d | [
"BSD-2-Clause"
] | null | null | null | #include "FaceRecognizerPrivate.h"
#include <cmath>
#include <string>
#include <memory>
#include <algorithm>
#include <functional>
#include <iostream>
#include <SeetaNetForward.h>
#include "SeetaModelHeader.h"
#include "seeta/common_alignment.h"
#include "seeta/ImageProcess.h"
class FaceRecognizerPrivate::Recognizer
{
public:
SeetaNet_Model *model = nullptr;
SeetaNet_Net *net = nullptr;
seeta::FRModelHeader header;
SeetaDevice device = SEETA_DEVICE_AUTO;
// for memory share
SeetaNet_SharedParam *param = nullptr;
std::string version;
std::string date;
std::string name;
std::function<float(float)> trans_func;
static int max_batch_global;
int max_batch_local;
// for YuLe setting
int sqrt_times = -1;
std::string default_method = "crop";
std::string method = "";
static int core_number_global;
int recognizer_number_threads = 2;
std::vector<SeetaNet_Net *> cores;
Recognizer()
{
header.width = 256;
header.height = 256;
header.channels = 3;
max_batch_local = max_batch_global;
recognizer_number_threads = core_number_global;
}
void free()
{
if (model)
SeetaReleaseModel(model);
model = nullptr;
if (net)
SeetaReleaseNet(net);
net = nullptr;
for (size_t i = 1; i < cores.size(); ++i)
{
SeetaReleaseNet(cores[i]);
}
cores.clear();
}
float trans(float similar) const
{
if (trans_func)
{
return trans_func(similar);
}
return similar;
}
int GetMaxBatch()
{
return max_batch_local;
}
int GetCoreNumber()
{
return 1;
}
~Recognizer()
{
Recognizer::free();
}
void fix()
{
if (this->sqrt_times < 0)
{
this->sqrt_times = this->header.feature_size >= 1024 ? 1 : 0;
}
if (this->method.empty())
{
this->method = this->header.feature_size >= 1024 ? this->default_method : "resize";
}
}
};
int FaceRecognizerPrivate::Recognizer::max_batch_global = 1;
int FaceRecognizerPrivate::Recognizer::core_number_global = 1;
float sigmoid(float x, float a = 0, float b = 1)
{
return 1 / (1 + exp(a - b * x));
}
float poly(float x, const std::vector<float> ¶ms)
{
if (params.empty())
return x;
float y = 0;
for (size_t i = 0; i < params.size(); ++i)
{
int p = static_cast<int>(params.size() - 1 - i);
y += params[i] * std::pow(x, p);
}
return std::max<float>(0, std::min<float>(1, y));
}
FaceRecognizerModel::FaceRecognizerModel(const char *model_path, int device)
: m_impl(new FaceRecognizerPrivate::Recognizer)
{
auto recognizer = reinterpret_cast<FaceRecognizerPrivate::Recognizer *>(m_impl);
if (!model_path)
{
std::cout << "Can not load empty model" << std::endl;
exit(-1);
}
int gpu_id = 0;
SeetaNet_DEVICE_TYPE type = SEETANET_CPU_DEVICE;
recognizer->device = SeetaDevice(device);
std::shared_ptr<char> sta_buffer;
char *buffer = nullptr;
int64_t buffer_len = 0;
std::ifstream inf(model_path, std::ios::binary);
if (!inf.is_open())
{
std::cout << "Can not access \"" << model_path << "\"" << std::endl;
exit(-1);
}
inf.seekg(0, std::ios::end);
auto sta_length = inf.tellg();
sta_buffer.reset(new char[size_t(sta_length)], std::default_delete<char[]>());
inf.seekg(0, std::ios::beg);
inf.read(sta_buffer.get(), sta_length);
buffer = sta_buffer.get();
buffer_len = sta_length;
inf.close();
// read header
size_t header_size = recognizer->header.read_ex(buffer, size_t(buffer_len));
// convert the model
if (SeetaReadModelFromBuffer(buffer + header_size, size_t(buffer_len - header_size), &recognizer->model))
{
std::cout << "Got an broken model file" << std::endl;
exit(-1);
}
// create the net
int err_code;
err_code = SeetaCreateNetSharedParam(recognizer->model, 1, type, &recognizer->net, &recognizer->param);
if (err_code)
{
SeetaReleaseModel(recognizer->model);
recognizer->model = nullptr;
std::cout << "Can not init net from broken model" << std::endl;
exit(-1);
}
recognizer->fix();
// here, we got model, net, and param
}
FaceRecognizerModel::~FaceRecognizerModel()
{
auto recognizer = reinterpret_cast<FaceRecognizerPrivate::Recognizer *>(m_impl);
delete recognizer;
}
const FaceRecognizerPrivate::Param *FaceRecognizerPrivate::GetParam() const
{
return reinterpret_cast<const Param *>(SeetaGetSharedParam(recognizer->net));
}
FaceRecognizerPrivate::FaceRecognizerPrivate(const Param *param) : recognizer(new Recognizer)
{
#ifdef SEETA_CHECK_INIT
SEETA_CHECK_INIT;
#endif
recognizer->param = const_cast<SeetaNet_SharedParam *>(reinterpret_cast<const SeetaNet_SharedParam *>(param));
}
FaceRecognizerPrivate::FaceRecognizerPrivate(const FaceRecognizerModel &model) : recognizer(new Recognizer)
{
#ifdef SEETA_CHECK_INIT
SEETA_CHECK_INIT;
#endif
auto other = reinterpret_cast<FaceRecognizerPrivate::Recognizer *>(model.m_impl);
auto device = other->device;
using self = FaceRecognizerPrivate;
SeetaNet_DEVICE_TYPE type = SEETANET_CPU_DEVICE;
*recognizer = *other;
recognizer->model = nullptr;
recognizer->net = nullptr;
int err_code;
err_code = SeetaCreateNetSharedParam(other->model, GetMaxBatch(), type, &recognizer->net, &other->param);
if (err_code)
{
std::cout << "Can not init net from unload model" << std::endl;
exit(-1);
}
SeetaKeepBlob(recognizer->net, recognizer->header.blob_name.c_str());
}
FaceRecognizerPrivate::FaceRecognizerPrivate(const char *modelPath) : FaceRecognizerPrivate(modelPath, SEETA_DEVICE_AUTO, 0)
{
}
FaceRecognizerPrivate::FaceRecognizerPrivate(const char *modelPath, SeetaDevice device, int gpuid) : recognizer(new Recognizer)
{
#ifdef SEETA_CHECK_INIT
SEETA_CHECK_INIT;
#endif
if (modelPath && !LoadModel(modelPath, device, gpuid))
{
std::cerr << "Error: Can not access \"" << modelPath << "\"!" << std::endl;
throw std::logic_error("Missing model");
}
}
FaceRecognizerPrivate::FaceRecognizerPrivate(const char *modelBuffer, size_t bufferLength, SeetaDevice device, int gpuid)
: recognizer(new Recognizer)
{
#ifdef SEETA_CHECK_INIT
SEETA_CHECK_INIT;
#endif
if (modelBuffer && !LoadModel(modelBuffer, bufferLength, device, gpuid))
{
std::cerr << "Error: Can not initialize from memory!" << std::endl;
throw std::logic_error("Missing model");
}
}
FaceRecognizerPrivate::~FaceRecognizerPrivate()
{
delete recognizer;
}
bool FaceRecognizerPrivate::LoadModel(const char *modelPath)
{
return LoadModel(modelPath, SEETA_DEVICE_AUTO, 0);
}
bool FaceRecognizerPrivate::LoadModel(const char *modelPath, SeetaDevice device, int gpuid)
{
if (modelPath == NULL)
return false;
recognizer->trans_func = nullptr;
char *buffer = nullptr;
int64_t buffer_len = 0;
if (SeetaReadAllContentFromFile(modelPath, &buffer, &buffer_len))
{
return false;
}
bool loaded = LoadModel(buffer, size_t(buffer_len), device, gpuid);
SeetaFreeBuffer(buffer);
recognizer->fix();
return loaded;
}
bool FaceRecognizerPrivate::LoadModel(const char *modelBuffer, size_t bufferLength, SeetaDevice device, int gpuid)
{
// Code
#ifdef NEED_CHECK
checkit();
#endif
if (modelBuffer == NULL)
{
return false;
}
recognizer->free();
using self = FaceRecognizerPrivate;
SeetaNet_DEVICE_TYPE type = SEETANET_CPU_DEVICE;
recognizer->device = device;
// read header
size_t header_size = recognizer->header.read_ex(modelBuffer, bufferLength);
std::cout << "[INFO] FaceRecognizer: " << "Feature size: " << recognizer->header.feature_size << std::endl;
// convert the model
if (SeetaReadModelFromBuffer(modelBuffer + header_size, bufferLength - header_size, &recognizer->model))
{
return false;
}
// create the net
int err_code;
err_code = SeetaCreateNetSharedParam(recognizer->model, GetMaxBatch(), type, &recognizer->net, &recognizer->param);
if (err_code)
{
SeetaReleaseModel(recognizer->model);
recognizer->model = nullptr;
return false;
}
SeetaKeepBlob(recognizer->net, recognizer->header.blob_name.c_str());
SeetaReleaseModel(recognizer->model);
recognizer->model = nullptr;
return true;
}
uint32_t FaceRecognizerPrivate::GetFeatureSize()
{
return recognizer->header.feature_size;
}
uint32_t FaceRecognizerPrivate::GetCropWidth()
{
return recognizer->header.width;
}
uint32_t FaceRecognizerPrivate::GetCropHeight()
{
return recognizer->header.height;
}
uint32_t FaceRecognizerPrivate::GetCropChannels()
{
return recognizer->header.channels;
}
bool FaceRecognizerPrivate::CropFace(const SeetaImageData &srcImg, const SeetaPointF *llpoint, SeetaImageData &dstImg, uint8_t posNum)
{
float mean_shape[10] =
{
89.3095f, 72.9025f,
169.3095f, 72.9025f,
127.8949f, 127.0441f,
96.8796f, 184.8907f,
159.1065f, 184.7601f,
};
float points[10];
for (int i = 0; i < 5; ++i)
{
points[2 * i] = float(llpoint[i].x);
points[2 * i + 1] = float(llpoint[i].y);
}
if (GetCropHeight() == 256 && GetCropWidth() == 256)
{
face_crop_core(srcImg.data, srcImg.width, srcImg.height, srcImg.channels, dstImg.data, GetCropWidth(), GetCropHeight(), points, 5, mean_shape, 256, 256);
}
else
{
if (recognizer->method == "resize")
{
seeta::Image face256x256(256, 256, 3);
face_crop_core(srcImg.data, srcImg.width, srcImg.height, srcImg.channels, face256x256.data(), 256, 256, points, 5, mean_shape, 256, 256);
seeta::Image fixed = seeta::resize(face256x256, seeta::Size(GetCropWidth(), GetCropHeight()));
fixed.copy_to(dstImg.data);
}
else
{
face_crop_core(srcImg.data, srcImg.width, srcImg.height, srcImg.channels, dstImg.data, GetCropWidth(), GetCropHeight(), points, 5, mean_shape, 256, 256);
}
}
return true;
}
bool FaceRecognizerPrivate::ExtractFeature(const SeetaImageData &cropImg, float *feats)
{
std::vector<SeetaImageData> faces = { cropImg };
return ExtractFeature(faces, feats, false);
}
static void normalize(float *features, int num)
{
double norm = 0;
float *dim = features;
for (int i = 0; i < num; ++i)
{
norm += *dim * *dim;
++dim;
}
norm = std::sqrt(norm) + 1e-5;
dim = features;
for (int i = 0; i < num; ++i)
{
*dim /= float(norm);
++dim;
}
}
bool FaceRecognizerPrivate::ExtractFeatureNormalized(const SeetaImageData &cropImg, float *feats)
{
std::vector<SeetaImageData> faces = { cropImg };
return ExtractFeature(faces, feats, true);
}
bool FaceRecognizerPrivate::ExtractFeatureWithCrop(const SeetaImageData &srcImg, const SeetaPointF *llpoint, float *feats, uint8_t posNum)
{
SeetaImageData dstImg;
dstImg.width = GetCropWidth();
dstImg.height = GetCropHeight();
dstImg.channels = srcImg.channels;
std::unique_ptr<uint8_t[]> dstImgData(new uint8_t[dstImg.width * dstImg.height * dstImg.channels]);
dstImg.data = dstImgData.get();
CropFace(srcImg, llpoint, dstImg, posNum);
ExtractFeature(dstImg, feats);
return true;
}
bool FaceRecognizerPrivate::ExtractFeatureWithCropNormalized(const SeetaImageData &srcImg, const SeetaPointF *llpoint, float *feats, uint8_t posNum)
{
if (ExtractFeatureWithCrop(srcImg, llpoint, feats, posNum))
{
normalize(feats, GetFeatureSize());
return true;
}
return false;
}
float FaceRecognizerPrivate::CalcSimilarity(const float *fc1, const float *fc2, long dim)
{
if (dim <= 0)
dim = GetFeatureSize();
double dot = 0;
double norm1 = 0;
double norm2 = 0;
for (size_t i = 0; i < dim; ++i)
{
dot += fc1[i] * fc2[i];
norm1 += fc1[i] * fc1[i];
norm2 += fc2[i] * fc2[i];
}
double similar = dot / (sqrt(norm1 * norm2) + 1e-5);
return recognizer->trans(float(similar));
}
float FaceRecognizerPrivate::CalcSimilarityNormalized(const float *fc1, const float *fc2, long dim)
{
if (dim <= 0)
dim = GetFeatureSize();
double dot = 0;
const float *fc1_dim = fc1;
const float *fc2_dim = fc2;
for (int i = 0; i < dim; ++i)
{
dot += *fc1_dim * *fc2_dim;
++fc1_dim;
++fc2_dim;
}
double similar = dot;
return recognizer->trans(float(similar));
}
int FaceRecognizerPrivate::SetMaxBatchGlobal(int max_batch)
{
std::swap(max_batch, Recognizer::max_batch_global);
return max_batch;
}
int FaceRecognizerPrivate::GetMaxBatch()
{
return recognizer->GetMaxBatch();
}
int FaceRecognizerPrivate::SetCoreNumberGlobal(int core_number)
{
std::swap(core_number, Recognizer::core_number_global);
return core_number;
}
int FaceRecognizerPrivate::GetCoreNumber()
{
return recognizer->GetCoreNumber();
}
template <typename T>
static void CopyData(T *dst, const T *src, size_t count)
{
#if _MSC_VER >= 1600
memcpy_s(dst, count * sizeof(T), src, count * sizeof(T));
#else
memcpy(dst, src, count * sizeof(T));
#endif
}
static bool LocalExtractFeature(
int number, int width, int height, int channels, unsigned char *data,
SeetaNet_Net *net, int max_batch, const char *blob_name, int feature_size,
float *feats,
bool normalization, int sqrt_times = 0)
{
if (!net)
return false;
if (data == nullptr || number <= 0)
return true;
auto single_image_size = channels * height * width;
if (number > max_batch)
{
// Divide and Conquer
int end = number;
int step = max_batch;
int left = 0;
while (left < end)
{
int right = std::min(left + step, end);
int local_number = right - left;
unsigned char *local_data = data + left * single_image_size;
float *local_feats = feats + left * feature_size;
if (!LocalExtractFeature(
local_number, width, height, channels, local_data,
net, max_batch, blob_name, feature_size,
local_feats,
normalization,
sqrt_times))
return false;
left = right;
}
return true;
}
SeetaNet_InputOutputData himg;
himg.number = number;
himg.channel = channels;
himg.height = height;
himg.width = width;
himg.buffer_type = SEETANET_BGR_IMGE_CHAR;
himg.data_point_char = data;
// do forward
if (SeetaRunNetChar(net, 1, &himg))
{
std::cout << "SeetaRunNetChar failed." << std::endl;
return false;
}
// get the output
SeetaNet_InputOutputData output;
if (SeetaGetFeatureMap(net, blob_name, &output))
{
std::cout << "SeetaGetFeatureMap failed." << std::endl;
return false;
}
// check the output size
if (output.channel * output.height * output.width != feature_size || output.number != himg.number)
{
std::cout << "output shape missmatch. " << feature_size << " expected. but " << output.channel *output.height *output.width << " given" << std::endl;
return false;
}
// copy data for output
CopyData(feats, output.data_point_float, output.number * feature_size);
int32_t all_feats_size = output.number * feature_size;
float *all_feats = feats;
#if defined(DOUBLE_SQRT) || defined(SINGLE_SQRT)
for (int i = 0; i != all_feats_size; i++)
{
#if defined(DOUBLE_SQRT)
feat[i] = sqrt(sqrt(feat[i]));
#elif defined(SINGLE_SQRT)
all_feats[i] = sqrt(all_feats[i]);
#endif // DOUBLE_SQRT
}
#endif // DOUBLE_SQRT || SINGLE_SQRT
if (sqrt_times > 0)
{
while (sqrt_times--)
{
for (int i = 0; i != all_feats_size; i++) all_feats[i] = std::sqrt(all_feats[i]);
}
}
if (normalization)
{
for (int i = 0; i < number; ++i)
{
float *local_feats = feats + i * feature_size;
normalize(local_feats, feature_size);
}
}
return true;
}
bool FaceRecognizerPrivate::ExtractFeature(const std::vector<SeetaImageData> &faces, float *feats, bool normalization)
{
if (!recognizer->net)
return false;
if (faces.empty())
return true;
int number = int(faces.size());
int channels = GetCropChannels();
int height = GetCropHeight();
int width = GetCropWidth();
auto single_image_size = channels * height * width;
std::unique_ptr<unsigned char[]> data_point_char(new unsigned char[number * single_image_size]);
for (int i = 0; i < number; ++i)
{
if (faces[i].channels == channels && faces[i].height == height && faces[i].width == width)
{
CopyData(&data_point_char[i * single_image_size], faces[i].data, single_image_size);
continue;
}
if (recognizer->method == "resize")
{
seeta::Image face(faces[i].data, faces[i].width, faces[i].height, faces[i].channels);
seeta::Image fixed = seeta::resize(face, seeta::Size(GetCropWidth(), GetCropHeight()));
CopyData(&data_point_char[i * single_image_size], fixed.data(), single_image_size);
}
else
{
seeta::Image face(faces[i].data, faces[i].width, faces[i].height, faces[i].channels);
seeta::Rect rect((GetCropWidth() - faces[i].width) / 2, (GetCropHeight() - faces[i].height) / 2, GetCropWidth(), GetCropHeight());
seeta::Image fixed = seeta::crop_resize(face, rect, seeta::Size(GetCropWidth(), GetCropHeight()));
CopyData(&data_point_char[i * single_image_size], fixed.data(), single_image_size);
}
}
return LocalExtractFeature(
number, width, height, channels, data_point_char.get(),
recognizer->net, GetMaxBatch(), recognizer->header.blob_name.c_str(), GetFeatureSize(),
feats,
normalization,
recognizer->sqrt_times);
}
bool FaceRecognizerPrivate::ExtractFeatureNormalized(const std::vector<SeetaImageData> &faces, float *feats)
{
return ExtractFeature(faces, feats, true);
}
// on checking param, sure right
static bool CropFaceBatch(FaceRecognizerPrivate &FR, const std::vector<SeetaImageData> &images,
const std::vector<SeetaPointF> &points, unsigned char *faces_data)
{
const int PN = 5;
const auto single_image_size = FR.GetCropChannels() * FR.GetCropHeight() * FR.GetCropWidth();
unsigned char *single_face_data = faces_data;
const SeetaPointF *single_points = points.data();
for (size_t i = 0; i < images.size(); ++i)
{
SeetaImageData face;
face.width = FR.GetCropWidth();
face.height = FR.GetCropHeight();
face.channels = FR.GetCropChannels();
face.data = single_face_data;
if (!FR.CropFace(images[i], single_points, face))
return false;
single_points += PN;
single_face_data += single_image_size;
}
return true;
}
bool FaceRecognizerPrivate::ExtractFeatureWithCrop(const std::vector<SeetaImageData> &images,
const std::vector<SeetaPointF> &points, float *feats, bool normalization)
{
if (!recognizer->net)
return false;
if (images.empty())
return true;
const int PN = 5;
if (images.size() * PN != points.size())
{
return false;
}
// crop face
std::unique_ptr<unsigned char[]> faces_data(new unsigned char[images.size() * GetCropChannels() * GetCropHeight() * GetCropWidth()]);
::CropFaceBatch(*this, images, points, faces_data.get());
int number = int(images.size());
int channels = GetCropChannels();
int height = GetCropHeight();
int width = GetCropWidth();
return LocalExtractFeature(
number, width, height, channels, faces_data.get(),
recognizer->net, GetMaxBatch(), recognizer->header.blob_name.c_str(), GetFeatureSize(),
feats,
normalization,
recognizer->sqrt_times
);
}
bool FaceRecognizerPrivate::ExtractFeatureWithCropNormalized(const std::vector<SeetaImageData> &images,
const std::vector<SeetaPointF> &points, float *feats)
{
return ExtractFeatureWithCrop(images, points, feats, true);
}
| 23.895275 | 156 | 0.708552 | glcnzude126 |
4bdcbd3ca95c78dbc88ff627212e69599c9396f3 | 753 | hpp | C++ | IA-testing/IA/IA/ICromosomaObserver.hpp | alseether/GeneticGame | 83bbdf926e6eb0974d9cacba7b315c91e59a1095 | [
"MIT"
] | 5 | 2017-07-08T18:26:31.000Z | 2022-03-30T12:07:03.000Z | IA-testing/IA/IA/ICromosomaObserver.hpp | alseether/GeneticGame | 83bbdf926e6eb0974d9cacba7b315c91e59a1095 | [
"MIT"
] | null | null | null | IA-testing/IA/IA/ICromosomaObserver.hpp | alseether/GeneticGame | 83bbdf926e6eb0974d9cacba7b315c91e59a1095 | [
"MIT"
] | 2 | 2017-07-08T18:26:33.000Z | 2018-10-26T08:14:28.000Z | #ifndef ICROMOSOMAOBSERVER_HPP
#define ICROMOSOMAOBSERVER_HPP
#include "npc.hpp"
#include "Mapa.hpp"
#include "Cromosoma.hpp"
class Cromosoma;
class ICromosomaObserver{
public:
virtual ~ICromosomaObserver() {};
virtual void onSimulacionIniciada(const Cromosoma*) = 0;
virtual void onTurno(const Cromosoma*, npc, npc, Mapa, Mapa, Mapa, Mapa) = 0; // jugador, enemigo, mapa, explorado, andado
virtual void onMapaTerminado(double fitness, double factorPatrulla, int cExpl, int cAndadas, int turnosQueValen, double factorAtaque, int cAndadasAtaque, int golpesEvitados, int golpes, int encontradoAtaque, int turnosAtaque, int intentos, double distancia, int turnosGolpeo) = 0;
virtual void onSimulacionTerminada(const Cromosoma*) = 0;
};
#endif | 31.375 | 281 | 0.780876 | alseether |
4be266e5726c6be9d8b71d1f629dd07a6ebc567c | 1,263 | cc | C++ | src/test/CppFile.cc | KomodoPlatform/marketmaker-cli | 433199ecc26eaadfbeff50deebd6a16184fa4a12 | [
"MIT"
] | 5 | 2018-02-27T11:04:42.000Z | 2018-09-28T20:49:01.000Z | src/test/CppFile.cc | KomodoPlatform/marketmaker-cli | 433199ecc26eaadfbeff50deebd6a16184fa4a12 | [
"MIT"
] | 3 | 2018-02-27T14:07:14.000Z | 2018-02-28T06:44:46.000Z | src/test/CppFile.cc | KomodoPlatform/marketmaker-cli | 433199ecc26eaadfbeff50deebd6a16184fa4a12 | [
"MIT"
] | 6 | 2018-03-08T05:40:41.000Z | 2018-12-31T11:09:29.000Z |
#include "CppFile.h"
static bool _open(AbstractFile *absFile, const char *pathname, const char *mode, err_t *errp);
static long _size(AbstractFile *absFile, err_t *errp);
static size_t _read(AbstractFile *absFile, void *ptr, size_t size, err_t *errp);
static bool _write(AbstractFile *absFile, const void *ptr, size_t size, err_t *errp);
static void _close(AbstractFile *absFile);
CppFile::CppFile()
{
this->open = _open;
this->size = _size;
this->read = _read;
this->write = _write;
this->close = _close;
}
bool _open(AbstractFile *absFile, const char *pathname, const char *mode, err_t *errp)
{
auto *file = (CppFile *) absFile;
return file->doOpen(pathname, mode, errp);
}
long _size(AbstractFile *absFile, err_t *errp)
{
auto *file = (CppFile *) absFile;
return file->doSize(errp);
}
size_t _read(AbstractFile *absFile, void *ptr, size_t size, err_t *errp)
{
auto *file = (CppFile *) absFile;
return file->doRead((char *) ptr, size, errp);
}
bool _write(AbstractFile *absFile, const void *ptr, size_t size, err_t *errp)
{
auto *file = (CppFile *) absFile;
return file->doWrite(ptr, size, errp);
}
void _close(AbstractFile *absFile)
{
auto *file = (CppFile *) absFile;
file->doClose();
}
| 24.288462 | 94 | 0.679335 | KomodoPlatform |
4be337d8967c994ad318b65aa8c8187f5af3b338 | 841 | hpp | C++ | oms_small/include/okapi/api/control/async/asyncController.hpp | wanton-wind/oms-vex | d2eca00ccfefad5e2f85f8465837bd8a0710359c | [
"Apache-2.0"
] | 1 | 2018-10-28T01:49:16.000Z | 2018-10-28T01:49:16.000Z | oms_small/include/okapi/api/control/async/asyncController.hpp | wanton-wind/oms-vex | d2eca00ccfefad5e2f85f8465837bd8a0710359c | [
"Apache-2.0"
] | 1 | 2018-10-28T01:40:00.000Z | 2018-10-28T01:40:00.000Z | oms_small/include/okapi/api/control/async/asyncController.hpp | wanton-wind/oms-vex | d2eca00ccfefad5e2f85f8465837bd8a0710359c | [
"Apache-2.0"
] | 3 | 2018-10-26T08:45:58.000Z | 2018-10-27T13:36:37.000Z | /**
* @author Ryan Benasutti, WPI
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef _OKAPI_ASYNCCONTROLLER_HPP_
#define _OKAPI_ASYNCCONTROLLER_HPP_
#include "okapi/api/control/closedLoopController.hpp"
namespace okapi {
/**
* Closed-loop controller that steps on its own in another thread and automatically writes to the
* output.
*/
template <typename Input, typename Output>
class AsyncController : public ClosedLoopController<Input, Output> {
public:
/**
* Blocks the current task until the controller has settled. Determining what settling means is
* implementation-dependent.
*/
virtual void waitUntilSettled() = 0;
};
} // namespace okapi
#endif
| 28.033333 | 97 | 0.740785 | wanton-wind |
4be6caed4bbeccc5bc193ed624b18fc98f56568c | 3,048 | cpp | C++ | src/Plugins/MyPedestrianModel/MyModel.cpp | mfprado/Menge | 75b1ebe91989c2a58073444fb2d5908644856372 | [
"Apache-2.0"
] | null | null | null | src/Plugins/MyPedestrianModel/MyModel.cpp | mfprado/Menge | 75b1ebe91989c2a58073444fb2d5908644856372 | [
"Apache-2.0"
] | null | null | null | src/Plugins/MyPedestrianModel/MyModel.cpp | mfprado/Menge | 75b1ebe91989c2a58073444fb2d5908644856372 | [
"Apache-2.0"
] | null | null | null | /*
License
Menge
Copyright � and trademark � 2012-14 University of North Carolina at Chapel Hill.
All rights reserved.
Permission to use, copy, modify, and distribute this software and its documentation
for educational, research, and non-profit purposes, without fee, and without a
written agreement is hereby granted, provided that the above copyright notice,
this paragraph, and the following four paragraphs appear in all copies.
This software program and documentation are copyrighted by the University of North
Carolina at Chapel Hill. The software program and documentation are supplied "as is,"
without any accompanying services from the University of North Carolina at Chapel
Hill or the authors. The University of North Carolina at Chapel Hill and the
authors do not warrant that the operation of the program will be uninterrupted
or error-free. The end-user understands that the program was developed for research
purposes and is advised not to rely exclusively on the program for any reason.
IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR THE AUTHORS
BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
DOCUMENTATION, EVEN IF THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR THE
AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND THE AUTHORS SPECIFICALLY
DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY STATUTORY WARRANTY
OF NON-INFRINGEMENT. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND
THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND THE AUTHORS HAVE NO OBLIGATIONS
TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
Any questions or comments should be sent to the authors {menge,geom}@cs.unc.edu
*/
/*!
* @file MyModel.cpp
* @brief Plugin for dummy pedestrian.
*/
#include "MyModel.h"
#include "MyModelDBEntry.h"
#include "MengeCore/PluginEngine/CorePluginEngine.h"
extern "C" {
/*!
* @brief Retrieves the name of the plug-in.
*
* @returns The name of the plug in.
*/
MENGE_API const char * getName() {
// http://gamma.cs.unc.edu/DenseCrowds/narain-siga09.pdf
return "My Pedestrian Model, based on Aggregate Dynamics for Dense Crowd Simulation";
}
/*!
* @brief Description of the plug-in.
*
* @returns A description of the plugin.
*/
MENGE_API const char * getDescription() {
return "A simple example of a pedestrian model. This model computes a "
"new velocity following this paper: http://gamma.cs.unc.edu/DenseCrowds/narain-siga09.pdf";
}
/*!
* @brief Registers the plug-in with the PluginEngine
*
* @param engine A pointer to the plugin engine.
*/
MENGE_API void registerCorePlugin( Menge::PluginEngine::CorePluginEngine * engine ) {
engine->registerModelDBEntry( new MyModel::MyModelDBEntry() );
}
}
| 38.582278 | 98 | 0.76542 | mfprado |
4bec35f22fa7f8a114901b8f4c8c5f038b9c9d66 | 3,901 | cpp | C++ | src/main_ds.cpp | MartinK84/riesling | 3deb01ef6ec4a03ecbd5cf694d37f20de063dbae | [
"MIT"
] | null | null | null | src/main_ds.cpp | MartinK84/riesling | 3deb01ef6ec4a03ecbd5cf694d37f20de063dbae | [
"MIT"
] | null | null | null | src/main_ds.cpp | MartinK84/riesling | 3deb01ef6ec4a03ecbd5cf694d37f20de063dbae | [
"MIT"
] | null | null | null | #include "types.h"
#include "filter.h"
#include "io_hd5.h"
#include "io_nifti.h"
#include "log.h"
#include "parse_args.h"
#include "threads.h"
using namespace std::complex_literals;
constexpr float pi = M_PI;
int main_ds(args::Subparser &parser)
{
args::Positional<std::string> iname(parser, "FILE", "Input radial k-space file");
args::ValueFlag<std::string> oname(parser, "OUTPUT", "Override output name", {"out", 'o'});
args::ValueFlag<std::string> oftype(
parser, "OUT FILETYPE", "File type of output (nii/nii.gz/img/h5)", {"oft"}, "nii");
Log log = ParseCommand(parser, iname);
HD5::Reader reader(iname.Get(), log);
Trajectory traj = reader.readTrajectory();
auto const &info = traj.info();
Cx3 rad_ks = info.noncartesianVolume();
Cx4 channels(info.channels, info.matrix[0], info.matrix[1], info.matrix[2]);
R4 out(info.matrix[0], info.matrix[1], info.matrix[2], info.volumes);
auto const sx = info.matrix[0];
auto const hx = sx / 2;
auto const sy = info.matrix[1];
auto const hy = sy / 2;
auto const sz = info.matrix[2];
auto const hz = sz / 2;
auto const maxX = info.matrix.maxCoeff();
auto const maxK = maxX / 2;
float const scale = std::sqrt(info.matrix.prod());
// Work out volume element
auto const delta = 1.;
float const d_lo = (4. / 3.) * M_PI * delta * delta * delta / info.spokes_lo;
float const d_hi = (4. / 3.) * M_PI * delta * delta * delta / info.spokes_hi;
// When k-space becomes undersampled need to flatten DC (Menon & Pipe 1999)
float const approx_undersamp =
(M_PI * info.matrix.maxCoeff() * info.matrix.maxCoeff()) / info.spokes_hi;
float const flat_start = maxK / sqrt(approx_undersamp);
float const flat_val = d_hi * (3. * (flat_start * flat_start) + 1. / 4.);
auto const &all_start = log.now();
for (long iv = 0; iv < info.volumes; iv++) {
auto const &vol_start = log.now();
reader.readNoncartesian(iv, rad_ks);
channels.setZero();
log.info("Beginning Direct Summation");
auto fourier = [&](long const lo, long const hi) {
for (long iz = lo; iz < hi; iz++) {
log.info("Starting {}/{}", iz, hi);
for (long iy = 0; iy < sy; iy++) {
for (long ix = 0; ix < sx; ix++) {
Point3 const c = Point3{
(ix - hx) / (float)(maxX), (iy - hy) / (float)(maxX), (iz - hz) / (float)(maxX)};
for (long is = 0; is < info.spokes_total(); is++) {
for (long ir = info.read_gap; ir < info.read_points; ir++) {
Point3 const r = traj.point(ir, is, maxK);
float const r_mag = r.matrix().norm();
auto const &d_k = is < info.spokes_lo ? d_lo : d_hi;
float dc;
if (r_mag == 0.f) {
dc = d_k * 1.f / 8.f;
} else if (r_mag < flat_start) {
dc = d_k * (3. * (r_mag * r_mag) + 1. / 4.);
} else {
dc = flat_val;
}
std::complex<float> const f_term =
std::exp(2.if * pi * r.matrix().dot(c.matrix())) * dc / scale;
for (long ic = 0; ic < info.channels; ic++) {
auto const val = rad_ks(ic, ir, is) * f_term;
channels(ic, ix, iy, iz) += val;
}
}
}
}
}
log.info("Finished {}/{}", iz, hi);
}
};
Threads::RangeFor(fourier, sz);
log.info("Calculating RSS");
WriteNifti(info, Cx4(channels.shuffle(Sz4{1, 2, 3, 0})), "chan.nii", log);
out.chip(iv, 3).device(Threads::GlobalDevice()) =
(channels * channels.conjugate()).sum(Sz1{0}).sqrt();
log.info("Volume {}: {}", iv, log.toNow(vol_start));
}
log.info("All volumes: {}", log.toNow(all_start));
WriteOutput(out, false, info, iname.Get(), oname.Get(), "ds", oftype.Get(), log);
return EXIT_SUCCESS;
}
| 38.245098 | 97 | 0.558831 | MartinK84 |
4bee5810032b2cabd5a11ada18849f0e7ab3ec95 | 13,234 | cc | C++ | pdlab/test/foo.pb.cc | SonuRex/Traffic-Management-System | afe7449790a06ca29dfa49552d2ec921b353238d | [
"MIT"
] | 7 | 2018-12-21T13:38:43.000Z | 2020-05-03T18:12:25.000Z | pdlab/test/foo.pb.cc | ujlive/Traffic-Management-system | afe7449790a06ca29dfa49552d2ec921b353238d | [
"MIT"
] | null | null | null | pdlab/test/foo.pb.cc | ujlive/Traffic-Management-system | afe7449790a06ca29dfa49552d2ec921b353238d | [
"MIT"
] | 6 | 2021-03-15T23:08:16.000Z | 2022-03-29T17:51:33.000Z | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: foo.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "foo.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
namespace prototest {
namespace {
const ::google::protobuf::Descriptor* Foo_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
Foo_reflection_ = NULL;
} // namespace
void protobuf_AssignDesc_foo_2eproto() {
protobuf_AddDesc_foo_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"foo.proto");
GOOGLE_CHECK(file != NULL);
Foo_descriptor_ = file->message_type(0);
static const int Foo_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Foo, id_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Foo, bar_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Foo, baz_),
};
Foo_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
Foo_descriptor_,
Foo::default_instance_,
Foo_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Foo, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Foo, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(Foo));
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_foo_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Foo_descriptor_, &Foo::default_instance());
}
} // namespace
void protobuf_ShutdownFile_foo_2eproto() {
delete Foo::default_instance_;
delete Foo_reflection_;
}
void protobuf_AddDesc_foo_2eproto() {
static bool already_here = false;
if (already_here) return;
already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\tfoo.proto\022\tprototest\"+\n\003Foo\022\n\n\002id\030\001 \002("
"\005\022\013\n\003bar\030\002 \002(\t\022\013\n\003baz\030\003 \001(\t", 67);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"foo.proto", &protobuf_RegisterTypes);
Foo::default_instance_ = new Foo();
Foo::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_foo_2eproto);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_foo_2eproto {
StaticDescriptorInitializer_foo_2eproto() {
protobuf_AddDesc_foo_2eproto();
}
} static_descriptor_initializer_foo_2eproto_;
// ===================================================================
#ifndef _MSC_VER
const int Foo::kIdFieldNumber;
const int Foo::kBarFieldNumber;
const int Foo::kBazFieldNumber;
#endif // !_MSC_VER
Foo::Foo()
: ::google::protobuf::Message() {
SharedCtor();
// @@protoc_insertion_point(constructor:prototest.Foo)
}
void Foo::InitAsDefaultInstance() {
}
Foo::Foo(const Foo& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:prototest.Foo)
}
void Foo::SharedCtor() {
::google::protobuf::internal::GetEmptyString();
_cached_size_ = 0;
id_ = 0;
bar_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
baz_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
Foo::~Foo() {
// @@protoc_insertion_point(destructor:prototest.Foo)
SharedDtor();
}
void Foo::SharedDtor() {
if (bar_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete bar_;
}
if (baz_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete baz_;
}
if (this != default_instance_) {
}
}
void Foo::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Foo::descriptor() {
protobuf_AssignDescriptorsOnce();
return Foo_descriptor_;
}
const Foo& Foo::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_foo_2eproto();
return *default_instance_;
}
Foo* Foo::default_instance_ = NULL;
Foo* Foo::New() const {
return new Foo;
}
void Foo::Clear() {
if (_has_bits_[0 / 32] & 7) {
id_ = 0;
if (has_bar()) {
if (bar_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
bar_->clear();
}
}
if (has_baz()) {
if (baz_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
baz_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool Foo::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:prototest.Foo)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required int32 id = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
input, &id_)));
set_has_id();
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_bar;
break;
}
// required string bar = 2;
case 2: {
if (tag == 18) {
parse_bar:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_bar()));
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->bar().data(), this->bar().length(),
::google::protobuf::internal::WireFormat::PARSE,
"bar");
} else {
goto handle_unusual;
}
if (input->ExpectTag(26)) goto parse_baz;
break;
}
// optional string baz = 3;
case 3: {
if (tag == 26) {
parse_baz:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_baz()));
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->baz().data(), this->baz().length(),
::google::protobuf::internal::WireFormat::PARSE,
"baz");
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:prototest.Foo)
return true;
failure:
// @@protoc_insertion_point(parse_failure:prototest.Foo)
return false;
#undef DO_
}
void Foo::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:prototest.Foo)
// required int32 id = 1;
if (has_id()) {
::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->id(), output);
}
// required string bar = 2;
if (has_bar()) {
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->bar().data(), this->bar().length(),
::google::protobuf::internal::WireFormat::SERIALIZE,
"bar");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
2, this->bar(), output);
}
// optional string baz = 3;
if (has_baz()) {
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->baz().data(), this->baz().length(),
::google::protobuf::internal::WireFormat::SERIALIZE,
"baz");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
3, this->baz(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:prototest.Foo)
}
::google::protobuf::uint8* Foo::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:prototest.Foo)
// required int32 id = 1;
if (has_id()) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->id(), target);
}
// required string bar = 2;
if (has_bar()) {
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->bar().data(), this->bar().length(),
::google::protobuf::internal::WireFormat::SERIALIZE,
"bar");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->bar(), target);
}
// optional string baz = 3;
if (has_baz()) {
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->baz().data(), this->baz().length(),
::google::protobuf::internal::WireFormat::SERIALIZE,
"baz");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->baz(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:prototest.Foo)
return target;
}
int Foo::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required int32 id = 1;
if (has_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
this->id());
}
// required string bar = 2;
if (has_bar()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->bar());
}
// optional string baz = 3;
if (has_baz()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->baz());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void Foo::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const Foo* source =
::google::protobuf::internal::dynamic_cast_if_available<const Foo*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void Foo::MergeFrom(const Foo& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_id()) {
set_id(from.id());
}
if (from.has_bar()) {
set_bar(from.bar());
}
if (from.has_baz()) {
set_baz(from.baz());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void Foo::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Foo::CopyFrom(const Foo& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Foo::IsInitialized() const {
if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
return true;
}
void Foo::Swap(Foo* other) {
if (other != this) {
std::swap(id_, other->id_);
std::swap(bar_, other->bar_);
std::swap(baz_, other->baz_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata Foo::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = Foo_descriptor_;
metadata.reflection = Foo_reflection_;
return metadata;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace prototest
// @@protoc_insertion_point(global_scope)
| 29.540179 | 104 | 0.65974 | SonuRex |
4bf154d0827bf541abc2907bc35ad102425df801 | 1,116 | cpp | C++ | src/falclib/msgsrc/sendteaminfomsg.cpp | Terebinth/freefalcon-central | c28d807183ab447ef6a801068aa3769527d55deb | [
"BSD-2-Clause"
] | 117 | 2015-01-13T14:48:49.000Z | 2022-03-16T01:38:19.000Z | src/falclib/msgsrc/sendteaminfomsg.cpp | darongE/freefalcon-central | c28d807183ab447ef6a801068aa3769527d55deb | [
"BSD-2-Clause"
] | 4 | 2015-05-01T13:09:53.000Z | 2017-07-22T09:11:06.000Z | src/falclib/msgsrc/sendteaminfomsg.cpp | darongE/freefalcon-central | c28d807183ab447ef6a801068aa3769527d55deb | [
"BSD-2-Clause"
] | 78 | 2015-01-13T09:27:47.000Z | 2022-03-18T14:39:09.000Z | /*
* Machine Generated source file for message "Send Team Info".
* NOTE: The functions here must be completed by hand.
* Generated on 05-November-1996 at 17:39:12
* Generated from file EVENTS.XLS by Leon Rosenshein
*/
//sfr: took it out, not used!!
/*
#include "MsgInc/SendTeamInfoMsg.h"
#include "mesg.h"
#include "falclib.h"
#include "falcmesg.h"
#include "falcgame.h"
#include "falcsess.h"
//sfr: added here for checks
#include "InvalidBufferException.h"
using std::memcpychk;
FalconSendTeamInfoMessage::FalconSendTeamInfoMessage(
VU_ID entityId, VuTargetEntity *target, VU_BOOL loopback) :
FalconEvent (SendTeamInfoMsg, FalconEvent::CampaignThread, entityId, target, loopback)
{
// Your Code Goes Here
}
FalconSendTeamInfoMessage::FalconSendTeamInfoMessage(VU_MSG_TYPE type, VU_ID senderid, VU_ID target) : FalconEvent (SendTeamInfoMsg, FalconEvent::CampaignThread, senderid, target)
{
// Your Code Goes Here
}
FalconSendTeamInfoMessage::~FalconSendTeamInfoMessage(void)
{
// Your Code Goes Here
}
int FalconSendTeamInfoMessage::Process(void)
{
// Your Code Goes Here
return 0;
}
*/
| 24.8 | 179 | 0.756272 | Terebinth |
4bf22fa119f3682697812926ff6de00193f14833 | 3,527 | cpp | C++ | variant.cpp | Yichen-Si/vt-topmed | e22e964a68e236b190b3038318ca9799f1922e0e | [
"MIT"
] | null | null | null | variant.cpp | Yichen-Si/vt-topmed | e22e964a68e236b190b3038318ca9799f1922e0e | [
"MIT"
] | 1 | 2019-12-26T09:34:03.000Z | 2019-12-26T09:34:03.000Z | variant.cpp | Yichen-Si/vt-topmed | e22e964a68e236b190b3038318ca9799f1922e0e | [
"MIT"
] | 1 | 2021-09-18T18:23:00.000Z | 2021-09-18T18:23:00.000Z | /* The MIT License
Copyright (c) 2013 Adrian Tan <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include "variant.h"
/**
* Constructor.
*/
Variant::Variant(bcf1_t* v)
{
this->v = v;
}
/**
* Constructor.
*/
Variant::Variant()
{
type = VT_REF;
alleles.clear();
}
/**
* Destructor.
*/
Variant::~Variant() {};
/**
* Clears variant information.
*/
void Variant::clear()
{
type = VT_REF;
alleles.clear();
vntr.clear();
};
/**
* Prints variant information.
*/
void Variant::print()
{
std::cerr << "type : " << vtype2string(type) << "\n";
std::cerr << "motif: " << vntr.motif << "\n";
std::cerr << "rlen : " << vntr.motif.size() << "\n";
for (int32_t i=0; i<alleles.size(); ++i)
{
std::cerr << "\tallele: " << i << "\n";
std::cerr << "\t type: " << vtype2string(alleles[i].type) << "\n";
std::cerr << "\t diff: " << alleles[i].diff << "\n";
std::cerr << "\t alen: " << alleles[i].alen << "\n";
std::cerr << "\t dlen: " << alleles[i].dlen << "\n";
}
};
/**
* Gets a string representation of the underlying VNTR.
*/
void Variant::get_vntr_string(kstring_t* s)
{
s->l = 0;
kputs(chrom.c_str(), s);
kputc(':', s);
kputw(vntr.rbeg1, s);
kputc(':', s);
kputs(vntr.repeat_tract.c_str(), s);
kputc(':', s);
kputs("<VNTR>", s);
};
/**
* Gets a string representation of the underlying VNTR.
*/
void Variant::get_fuzzy_vntr_string(kstring_t* s)
{
s->l = 0;
kputs(chrom.c_str(), s);
kputc(':', s);
kputw(vntr.fuzzy_rbeg1, s);
kputc(':', s);
kputs(vntr.fuzzy_repeat_tract.c_str(), s);
kputc(':', s);
kputs("<VNTR>", s);
};
/**
* Converts VTYPE to string.
*/
std::string Variant::vtype2string(int32_t VTYPE)
{
std::string s;
if (!VTYPE)
{
s += (s.size()==0) ? "" : "/";
s += "REF";
}
if (VTYPE & VT_SNP)
{
s += (s.size()==0) ? "" : "/";
s += "SNP";
}
if (VTYPE & VT_MNP)
{
s += (s.size()==0) ? "" : "/";
s += "MNP";
}
if (VTYPE & VT_INDEL)
{
s += (s.size()==0) ? "" : "/";
s += "INDEL";
}
if (VTYPE & VT_CLUMPED)
{
s += (s.size()==0) ? "" : "/";
s += "CLUMPED";
}
if (VTYPE & VT_VNTR)
{
s += (s.size()==0) ? "" : "/";
s += "VNTR";
}
if (VTYPE & VT_SV)
{
s += (s.size()==0) ? "" : "/";
s += "SV";
}
return s;
} | 22.464968 | 80 | 0.55146 | Yichen-Si |
4bf78b1cef8b89c8b600a967ed3610294c2d769d | 4,398 | cpp | C++ | src/sfutil/blend-mode.cpp | tilnewman/heroespath-src | a7784e44d8b5724f305ef8b8671fed54e2e5fd69 | [
"BSL-1.0",
"Beerware"
] | 2 | 2019-02-28T00:28:08.000Z | 2019-10-20T14:39:48.000Z | src/sfutil/blend-mode.cpp | tilnewman/heroespath-src | a7784e44d8b5724f305ef8b8671fed54e2e5fd69 | [
"BSL-1.0",
"Beerware"
] | null | null | null | src/sfutil/blend-mode.cpp | tilnewman/heroespath-src | a7784e44d8b5724f305ef8b8671fed54e2e5fd69 | [
"BSL-1.0",
"Beerware"
] | null | null | null | // ----------------------------------------------------------------------------
// "THE BEER-WARE LICENSE" (Revision 42):
// <[email protected]> wrote this file. As long as you retain this notice you
// can do whatever you want with this stuff. If we meet some day, and you think
// this stuff is worth it, you can buy me a beer in return. Ziesche Til Newman
// ----------------------------------------------------------------------------
//
// blend-mode.cpp
//
#include "blend-mode.hpp"
#include "misc/strings.hpp"
#include <ostream>
#include <tuple>
namespace sf
{
bool operator<(const sf::BlendMode & L, const sf::BlendMode & R)
{
return std::tie(
L.colorSrcFactor,
L.colorDstFactor,
L.colorEquation,
L.alphaSrcFactor,
L.alphaDstFactor,
L.alphaEquation)
< std::tie(
R.colorSrcFactor,
R.colorDstFactor,
R.colorEquation,
R.alphaSrcFactor,
R.alphaDstFactor,
R.alphaEquation);
}
std::ostream & operator<<(std::ostream & os, const sf::BlendMode & BM)
{
os << "(";
if (BM == sf::BlendAlpha)
{
os << "Alpha";
}
else if (BM == sf::BlendAdd)
{
os << "Add";
}
else if (BM == sf::BlendMultiply)
{
os << "Multiply";
}
else if (BM == sf::BlendNone)
{
os << "None";
}
else
{
auto factorToString = [](const sf::BlendMode::Factor FACTOR) -> std::string {
switch (FACTOR)
{
case sf::BlendMode::Factor::Zero:
{
return "Zero";
}
case sf::BlendMode::Factor::One:
{
return "One";
}
case sf::BlendMode::Factor::SrcColor:
{
return "SrcColor";
}
case sf::BlendMode::Factor::OneMinusSrcColor:
{
return "OneMinusSrcColor";
}
case sf::BlendMode::Factor::DstColor:
{
return "DstColor";
}
case sf::BlendMode::Factor::OneMinusDstColor:
{
return "OneMinusDstColor";
}
case sf::BlendMode::Factor::SrcAlpha:
{
return "SrcAlpha";
}
case sf::BlendMode::Factor::OneMinusSrcAlpha:
{
return "OneMinusSrcAlpha";
}
case sf::BlendMode::Factor::DstAlpha:
{
return "DstAlpha";
}
default:
case sf::BlendMode::Factor::OneMinusDstAlpha:
{
return "OneMinusDstAlpha";
}
}
};
auto equationToString = [](const sf::BlendMode::Equation EQUATION) -> std::string {
switch (EQUATION)
{
case sf::BlendMode::Equation::Add:
{
return "Add";
}
case sf::BlendMode::Equation::Subtract:
{
return "Subtract";
}
default:
case sf::BlendMode::Equation::ReverseSubtract:
{
return "ReverseSubtract";
}
}
};
os << factorToString(BM.colorSrcFactor) << "," << factorToString(BM.colorDstFactor) << ","
<< equationToString(BM.colorEquation) << "," << factorToString(BM.alphaSrcFactor) << ","
<< factorToString(BM.alphaDstFactor) << "," << equationToString(BM.alphaEquation);
}
os << ")";
return os;
}
} // namespace sf
namespace heroespath
{
namespace sfutil
{
const std::string ToString(const sf::BlendMode & BM, const misc::ToStringPrefix::Enum OPTIONS)
{
std::ostringstream ss;
ss << misc::MakeToStringPrefix<sf::BlendMode>(OPTIONS, "BlendMode") << BM;
return ss.str();
}
} // namespace sfutil
} // namespace heroespath
| 29.125828 | 100 | 0.429286 | tilnewman |
4bf7f750e7993e8adee89375cef90d9d4af2ea1b | 2,724 | hpp | C++ | include/eepp/audio/soundfilewriter.hpp | jayrulez/eepp | 09c5c1b6b4c0306bb0a188474778c6949b5df3a7 | [
"MIT"
] | 37 | 2020-01-20T06:21:24.000Z | 2022-03-21T17:44:50.000Z | include/eepp/audio/soundfilewriter.hpp | jayrulez/eepp | 09c5c1b6b4c0306bb0a188474778c6949b5df3a7 | [
"MIT"
] | null | null | null | include/eepp/audio/soundfilewriter.hpp | jayrulez/eepp | 09c5c1b6b4c0306bb0a188474778c6949b5df3a7 | [
"MIT"
] | 9 | 2019-03-22T00:33:07.000Z | 2022-03-01T01:35:59.000Z | #ifndef EE_AUDIO_SOUNDFILEWRITER_HPP
#define EE_AUDIO_SOUNDFILEWRITER_HPP
#include <eepp/config.hpp>
#include <string>
namespace EE { namespace Audio {
/// \brief Abstract base class for sound file encoding
class EE_API SoundFileWriter {
public:
virtual ~SoundFileWriter() {}
////////////////////////////////////////////////////////////
/// \brief Open a sound file for writing
///
/// \param filename Path of the file to open
/// \param sampleRate Sample rate of the sound
/// \param channelCount Number of channels of the sound
///
/// \return True if the file was successfully opened
///
////////////////////////////////////////////////////////////
virtual bool open( const std::string& filename, unsigned int sampleRate,
unsigned int channelCount ) = 0;
////////////////////////////////////////////////////////////
/// \brief Write audio samples to the open file
///
/// \param samples Pointer to the sample array to write
/// \param count Number of samples to write
///
////////////////////////////////////////////////////////////
virtual void write( const Int16* samples, Uint64 count ) = 0;
};
}} // namespace EE::Audio
#endif
////////////////////////////////////////////////////////////
/// @class EE::Audio::SoundFileWriter
///
/// This class allows users to write audio file formats not natively
/// supported by EEPP, and thus extend the set of supported writable
/// audio formats.
///
/// A valid sound file writer must override the open and write functions,
/// as well as providing a static check function; the latter is used by
/// EEPP to find a suitable writer for a given filename.
///
/// To register a new writer, use the SoundFileFactory::registerWriter
/// template function.
///
/// Usage example:
/// \code
/// class MySoundFileWriter : public SoundFileWriter
/// {
/// public:
///
/// static bool check(const std::string& filename)
/// {
/// // typically, check the extension
/// // return true if the writer can handle the format
/// }
///
/// virtual bool open(const std::string& filename, unsigned int sampleRate, unsigned int
/// channelCount)
/// {
/// // open the file 'filename' for writing,
/// // write the given sample rate and channel count to the file header
/// // return true on success
/// }
///
/// virtual void write(const Int16* samples, Uint64 count)
/// {
/// // write 'count' samples stored at address 'samples',
/// // convert them (for example to normalized float) if the format requires it
/// }
/// };
///
/// SoundFileFactory::registerWriter<MySoundFileWriter>();
/// \endcode
///
/// \see OutputSoundFile, SoundFileFactory, SoundFileReader
///
////////////////////////////////////////////////////////////
| 30.954545 | 89 | 0.595815 | jayrulez |
4bfbb94537ea202cfdfba57084ed14ec13da51ca | 13,090 | hpp | C++ | include/imgproc/laplace.hpp | waterben/LineExtraction | d247de45417a1512a3bf5d0ffcd630d40ffb8798 | [
"MIT"
] | 1 | 2020-06-12T13:30:56.000Z | 2020-06-12T13:30:56.000Z | include/imgproc/laplace.hpp | waterben/LineExtraction | d247de45417a1512a3bf5d0ffcd630d40ffb8798 | [
"MIT"
] | null | null | null | include/imgproc/laplace.hpp | waterben/LineExtraction | d247de45417a1512a3bf5d0ffcd630d40ffb8798 | [
"MIT"
] | null | null | null | /*M///////////////////////////////////////////////////////////////////////////////////////
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
// C by Benjamin Wassermann
//M*/
#ifndef _LAPLACE_HPP_
#define _LAPLACE_HPP_
#ifdef __cplusplus
#include "opencv2/imgproc/imgproc.hpp"
#include "filter.hpp"
namespace lsfm {
//! Laplace base class
//! Use IT to define Image type (8Bit, 16Bit, 32Bit, or floating type float or double)
//! Use LT to define Laplace type (int, float or double)
//! For 8 Bit images use GT = short, for 16 Bit images float.
//! For images with floating values, use IT and GT = image floating type (float or double)
template<class IT, class LT>
class LaplaceI : public FilterI<IT> {
LaplaceI(const LaplaceI&);
public:
typedef IT img_type;
typedef Range<IT> IntensityRange;
typedef LT laplace_type;
typedef Range<LT> LaplaceRange;
LaplaceI() {}
virtual ~LaplaceI() {}
//! get magnitude
virtual cv::Mat laplace() const = 0;
//! get magnitude range for intensity range
virtual LaplaceRange laplaceRange() const = 0;
//! convert threshold between 0-1 to mangitude threshold
virtual LT laplaceThreshold(double val) const {
return static_cast<LT>(laplaceRange().size() * val);
}
};
//! Laplace base class helper
template<class IT, class LT>
class Laplace : public LaplaceI<IT, LT> {
protected:
Range<IT> intRange_;
public:
typedef IT img_type;
typedef Range<IT> IntensityRange;
typedef LT laplace_type;
typedef Range<LT> LaplaceRange;
Laplace(IT int_lower = std::numeric_limits<IT>::lowest(), IT int_upper = std::numeric_limits<IT>::max()) :
intRange_(int_lower,int_upper) {}
//! get image intensity range (for single channel)
IntensityRange intensityRange() const {
return intRange_;
}
//! generic interface to get processed data
virtual FilterResults results() const {
FilterResults ret;
ret["laplace"] = FilterData(this->laplace(), this->laplaceRange());
return ret;
}
};
template<class IT, class LT>
class LaplaceSimple : public Laplace<IT, LT> {
protected:
cv::Mat laplace_;
cv::Mat_<LT> k_;
cv::Point anchor;
using Laplace<IT, LT>::intRange_;
public:
typedef IT img_type;
typedef Range<IT> IntensityRange;
typedef LT laplace_type;
typedef Range<LT> LaplaceRange;
LaplaceSimple(IT int_lower = std::numeric_limits<IT>::lowest(), IT int_upper = std::numeric_limits<IT>::max()) :
Laplace<IT,LT>(int_lower, int_upper), anchor(-1, -1) {
k_ = cv::Mat_<LT>::ones(3, 3);
k_(1, 1) = -8;
}
//! process laplacian
void process(const cv::Mat& img) {
cv::filter2D(img, laplace_, cv::DataType<LT>::type, k_, anchor, 0, cv::BORDER_REFLECT_101);
}
//! get magnitude
cv::Mat laplace() const {
return laplace_;
}
//! get magnitude range for intensity range
virtual LaplaceRange laplaceRange() const {
LT val = intRange_.upper * 8;
return LaplaceRange(-val, val);
}
//! get name of gradient operator
std::string name() const {
return "laplace";
}
using ValueManager::values;
using ValueManager::valuePair;
using ValueManager::value;
using Laplace<IT, LT>::intensityRange;
using Laplace<IT, LT>::results;
};
template<class IT, class LT>
class LoG : public LaplaceSimple<IT, LT> {
int ksize_;
double kspace_, kscale_;
using LaplaceSimple<IT, LT>::intRange_;
Range<LT> laplaceRange_;
public:
static inline double exp_d2(double x, double y, double s) {
double xy2 = x*x + y*y;
return s*(xy2 - 1)*std::exp(-xy2);
}
static inline cv::Mat_<LT> createFilter(int width, double spacing, double scale) {
width = width / 2;
cv::Mat_<LT> kernel(width * 2 + 1, width * 2 + 1);
for (int i = -width; i <= width; ++i)
for (int j = -width; j <= width; ++j)
kernel(j + width, i + width) = static_cast<LT>(exp_d2(i*spacing, j*spacing, scale));
// zero dc
#ifndef DISABLE_DC_ZERO_FIX
kernel -= cv::sum(kernel)[0] / (kernel.size().area());
#endif
return kernel;
}
private:
void create_kernel() {
this->k_ = createFilter(ksize_, kspace_, kscale_);
cv::Mat_<LT> tmp;
this->k_.copyTo(tmp);
tmp.setTo(0, tmp < 0);
laplaceRange_.upper = static_cast<LT>(cv::sum(tmp)[0] * intRange_.upper);
this->k_.copyTo(tmp);
tmp.setTo(0, tmp > 0);
laplaceRange_.lower = static_cast<LT>(cv::sum(tmp)[0] * intRange_.upper);
//std::cout << this->k_ << std::endl << laplaceRange_.upper << std::endl << laplaceRange_.lower << std::endl;
}
public:
typedef IT img_type;
typedef Range<IT> IntensityRange;
typedef LT laplace_type;
typedef Range<LT> LaplaceRange;
LoG(int kernel_size = 5, double kernel_spacing = 1.008, double kernel_scale = 1, IT int_lower = std::numeric_limits<IT>::lowest(), IT int_upper = std::numeric_limits<IT>::max()) :
LaplaceSimple<IT,LT>(int_lower, int_upper), ksize_(kernel_size), kspace_(kernel_spacing), kscale_(kernel_scale) {
this->add("grad_kernel_size", std::bind(&LoG<IT, LT>::valueKernelSize, this, std::placeholders::_1), "Kernel size for LoG-Operator.");
this->add("grad_kernel_spacing", std::bind(&LoG<IT, LT>::valueKernelSpacing, this, std::placeholders::_1), "Spacing for a single step for LoG-Operator.");
this->add("grad_kernel_scale", std::bind(&LoG<IT, LT>::valueKernelScale, this, std::placeholders::_1), "Upscale for LoG-Operator (e.g. for converting to short).");
create_kernel();
}
Value valueKernelSize(const Value &ks = Value::NAV()) { if (ks.type()) kernelSize(ks); return ksize_; }
//! get kernel size
int kernelSize() const { return ksize_; }
//! set kernel size (range 2-99, has to be odd, even will be corrected to ksize+1)
//! Note: large kernels needs larger GT type like int or long long int
void kernelSize(int ks) {
if (ks == ksize_)
return;
if (ks < 3)
ks = 3;
if (ks % 2 == 0)
++ks;
if (ks > 99)
ks = 99;
ksize_ = ks;
create_kernel();
}
Value valueKernelSpacing(const Value &ks = Value::NAV()) { if (ks.type()) kernelSpacing(ks); return kspace_; }
double kernelSpacing() const { return kspace_; }
void kernelSpacing(double ks) {
if (ks == kspace_ || ks <= 0)
return;
kspace_ = ks;
create_kernel();
}
Value valueKernelScale(const Value &ks = Value::NAV()) { if (ks.type()) kernelScale(ks); return kscale_; }
double kernelScale() const { return kscale_; }
void kernelScale(double ks) {
if (ks == kscale_ || ks <= 0)
return;
kscale_ = ks;
create_kernel();
}
cv::Mat kernel() const {
return this->k_;
}
cv::Mat even() const {
return this->laplace();
}
using ValueManager::values;
using ValueManager::valuePair;
using ValueManager::value;
using LaplaceSimple<IT,LT>::process;
using LaplaceSimple<IT,LT>::laplace;
using LaplaceSimple<IT, LT>::intensityRange;
using LaplaceSimple<IT, LT>::results;
//! get magnitude range for intensity range
virtual LaplaceRange laplaceRange() const {
return laplaceRange_;
}
//! get name of gradient operator
std::string name() const {
return "LoG";
}
};
template<class IT, class LT>
class LaplaceCV : public Laplace<IT,LT> {
Range<LT> laplaceRange_;
cv::Mat laplace_;
int ksize_;
void calc_range() {
// TODO
laplaceRange_.lower = -this->intRange_.upper * 2 * ksize_;
laplaceRange_.upper = this->intRange_.upper * 2 * ksize_;
}
public:
typedef IT img_type;
typedef Range<IT> IntensityRange;
typedef LT laplace_type;
typedef Range<LT> LaplaceRange;
LaplaceCV(int ksize = 5, IT int_lower = std::numeric_limits<IT>::lowest(), IT int_upper = std::numeric_limits<IT>::max()) :
Laplace<IT,LT>(int_lower, int_upper), ksize_(ksize) {
this->add("grad_kernel_size", std::bind(&LaplaceCV<IT, LT>::valueKernelSize, this, std::placeholders::_1),
"Kernel size for Laplace-Operator.");
calc_range();
}
Value valueKernelSize(const Value &ks = Value::NAV()) { if (ks.type()) kernelSize(ks.getInt()); return ksize_; }
//! Get kernel size
int kernelSize() const { return ksize_; }
//! Set kernel size (range 1-31, has to be odd, even will be corrected to ksize+1)
//! Note: large kernels needs larger GT type like float or double
void kernelSize(int ks) {
if (ksize_ == ks)
return;
if (ks < 1)
ks = 1;
if (ks % 2 == 0)
++ks;
if (ks > 31)
ks = 31;
ksize_ = ks;
calc_range();
}
//! process laplacian
void process(const cv::Mat& img) {
cv::Laplacian(img, laplace_, cv::DataType<LT>::type, ksize_, 1, 0, cv::BORDER_REFLECT_101);
}
//! get magnitude
cv::Mat laplace() const {
return laplace_;
}
//! get magnitude range for intensity range
LaplaceRange laplaceRange() const {
return laplaceRange_;
}
//! get name of gradient operator
std::string name() const {
return "laplaceCV";
}
using ValueManager::values;
using ValueManager::valuePair;
using ValueManager::value;
using Laplace<IT, LT>::intensityRange;
using Laplace<IT, LT>::results;
};
}
#endif
#endif
| 35.283019 | 188 | 0.56906 | waterben |
4bfe429f97b49ba4a61fe07d03698b6291a2fd25 | 1,938 | hpp | C++ | app/bin/miner/xmr-stak/xmrstak/backend/miner_work.hpp | chrisknepper/electron-gui-crypto-miner | e154b1f1ea6ce8285c7a682a8dcef90f17a5c8a2 | [
"MIT"
] | 2 | 2018-01-25T04:29:57.000Z | 2020-02-13T15:30:55.000Z | app/bin/miner/xmr-stak/xmrstak/backend/miner_work.hpp | chrisknepper/electron-gui-crypto-miner | e154b1f1ea6ce8285c7a682a8dcef90f17a5c8a2 | [
"MIT"
] | 1 | 2019-05-26T17:51:57.000Z | 2019-05-26T17:51:57.000Z | app/bin/miner/xmr-stak/xmrstak/backend/miner_work.hpp | chrisknepper/electron-gui-crypto-miner | e154b1f1ea6ce8285c7a682a8dcef90f17a5c8a2 | [
"MIT"
] | 5 | 2018-02-17T11:32:37.000Z | 2021-02-26T22:26:07.000Z | #pragma once
#include <thread>
#include <atomic>
#include <mutex>
#include <cstdint>
#include <iostream>
#include <cassert>
#include <cstring>
namespace xmrstak
{
struct miner_work
{
char sJobID[64];
uint8_t bWorkBlob[112];
uint32_t iWorkSize;
uint64_t iTarget;
bool bNiceHash;
bool bStall;
size_t iPoolId;
miner_work() : iWorkSize(0), bNiceHash(false), bStall(true), iPoolId(0) { }
miner_work(const char* sJobID, const uint8_t* bWork, uint32_t iWorkSize,
uint64_t iTarget, bool bNiceHash, size_t iPoolId) : iWorkSize(iWorkSize),
iTarget(iTarget), bNiceHash(bNiceHash), bStall(false), iPoolId(iPoolId)
{
assert(iWorkSize <= sizeof(bWorkBlob));
memcpy(this->sJobID, sJobID, sizeof(miner_work::sJobID));
memcpy(this->bWorkBlob, bWork, iWorkSize);
}
miner_work(miner_work const&) = delete;
miner_work& operator=(miner_work const& from)
{
assert(this != &from);
iWorkSize = from.iWorkSize;
iTarget = from.iTarget;
bNiceHash = from.bNiceHash;
bStall = from.bStall;
iPoolId = from.iPoolId;
assert(iWorkSize <= sizeof(bWorkBlob));
memcpy(sJobID, from.sJobID, sizeof(sJobID));
memcpy(bWorkBlob, from.bWorkBlob, iWorkSize);
return *this;
}
miner_work(miner_work&& from) : iWorkSize(from.iWorkSize), iTarget(from.iTarget),
bStall(from.bStall), iPoolId(from.iPoolId)
{
assert(iWorkSize <= sizeof(bWorkBlob));
memcpy(sJobID, from.sJobID, sizeof(sJobID));
memcpy(bWorkBlob, from.bWorkBlob, iWorkSize);
}
miner_work& operator=(miner_work&& from)
{
assert(this != &from);
iWorkSize = from.iWorkSize;
iTarget = from.iTarget;
bNiceHash = from.bNiceHash;
bStall = from.bStall;
iPoolId = from.iPoolId;
assert(iWorkSize <= sizeof(bWorkBlob));
memcpy(sJobID, from.sJobID, sizeof(sJobID));
memcpy(bWorkBlob, from.bWorkBlob, iWorkSize);
return *this;
}
};
} // namepsace xmrstak
| 24.531646 | 83 | 0.684727 | chrisknepper |
ef02864b04104925cda2a3a4ce09fcac1c40a528 | 4,740 | cpp | C++ | MonoNative.Tests/SampleFixture.cpp | brunolauze/MonoNative | 959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66 | [
"BSD-2-Clause"
] | 7 | 2015-03-10T03:36:16.000Z | 2021-11-05T01:16:58.000Z | MonoNative.Tests/SampleFixture.cpp | brunolauze/MonoNative | 959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66 | [
"BSD-2-Clause"
] | 1 | 2020-06-23T10:02:33.000Z | 2020-06-24T02:05:47.000Z | MonoNative.Tests/SampleFixture.cpp | brunolauze/MonoNative | 959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66 | [
"BSD-2-Clause"
] | null | null | null |
#include <gtest/gtest.h>
#include <mscorlib.h>
using namespace mscorlib::System;
using namespace mscorlib::System::Collections::Generic;
extern "C" {
MONO_API void* mono_delegate_to_ftnptr (MonoDelegate *delegate);
MONO_API MonoDelegate* mono_ftnptr_to_delegate (MonoClass *klass, void* ftn);
MONO_API void mono_delegate_free_ftnptr (MonoDelegate *delegate);
}
extern "C" {
MonoBoolean List_Exists(MonoObject *arg1, MonoObject *arg2)
{
if (arg2 != NULL)
{
const char *result = mono_string_to_utf8(mono_object_to_string(arg2, NULL));
if (strcmp(result, "TEST") == 0)
return TRUE;
}
return FALSE;
}
}
TEST(SampleFixture, BasicTest1)
{
/* Just try Console a bit */
ConsoleColor::__ENUM__ lastColor = Console::ForegroundColor;
std::cout << "Current Console Color: " << lastColor << std::endl;
Console::WriteLine(String("Hello World!"));
Console::ForegroundColor = ConsoleColor::Magenta;
Console::WriteLine(String("Writing here in Magenta foreground color."));
Console::ForegroundColor = lastColor;
Console::WriteLine(String("Writing back with default foreground color."));
Console::WriteLine("Writing from a plain old const char *");
std::cout << "pass1" << std::endl;
MonoType *type1 = Global::GetType("mscorlib", "System", "Object");
std::cout << "pass2" << std::endl;
MonoClass *kclass1 = mono_class_from_mono_type(type1);
std::cout << "pass3" << std::endl;
MonoClass *arraykclass = mono_array_class_get(kclass1, 1);
std::cout << "pass4" << std::endl;
MonoType *type2 = mono_class_get_type(arraykclass);
std::cout << "pass7" << std::endl;
const char *typeName = mono_type_get_name(type2);
std::cout << "Array Type Created is : " << typeName << std::endl;
Object obj1 = String("Jim");
Console::WriteLine(String("Formatting: My name is {0}."), obj1);
std::vector<Object*> objs;
Object *arg1 = new String("John");
objs.push_back(arg1);
Console::WriteLine(String("Formatting: My name is {0}."), objs);
}
TEST(SampleFixture, BasicTest2)
{
std::vector<Object*> objs;
Object *arg1 = new String("John");
objs.push_back(arg1);
MonoObject* arrayObj = Global::FromArray<Object*>(objs, typeid(Object).name());
MonoArray *arrayEl = (MonoArray*)arrayObj;
int length = mono_array_length(arrayEl);
std::cout << "Array Length: " << length << std::endl;
}
TEST(SampleFixture, BasicTest3)
{
List<String> *list = new List<String>();
list->Add(String("TEST"));
std::cout << "pass1" << std::endl;
//mscorlib::System::Boolean doesExists = list->Exists(BIND_FREE_CB(SampleFixture_BasicTest3_Exists));
MonoObject *__native_object__ = list->GetNativeObject();
MonoType *__parameter_types__[1];
void *__parameters__[1];
MonoType *__generic_types__[1];
__generic_types__[0] = Global::GetType(typeid(String).name());
std::cout << "pass2" << std::endl;
__parameter_types__[0] = Global::GetType("mscorlib", "System", "Predicate`1", 1, __generic_types__);
std::cout << "pass3" << std::endl;
//MonoType *typeDelegate = Global::GetType("mscorlib", "System", "Predicate`1", 1, __generic_types__);
//MonoType *typeDelegate = Global::GetType("mscorlib", "System", "Action");
MonoClass *delegateClass = Global::GetClass("mscorlib", "System", "Predicate`1", 1, __generic_types__);
/*
MonoAssembly *ass = mono_assembly_open("MonoNativeHelper.dll", NULL);
MonoImage *image = mono_assembly_get_image(ass);
MonoClass *delegateClass = mono_class_from_name(image, "System", "BooleanDelegate");
*/
//std::cout << mono_type_get_name(typeDelegate) << std::endl;
std::cout << "pass4" << std::endl;
//mono_type_get_class(typeDelegate)
MonoDelegate *delegateObj = mono_ftnptr_to_delegate(delegateClass, (void*)List_Exists);
std::cout << "pass5" << std::endl;
__parameters__[0] = delegateObj;
std::cout << "pass6" << std::endl;
MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Collections.Generic", "List`1", 1, __generic_types__, "Exists", __native_object__, 1, __parameter_types__, __parameters__, NULL);
const char *resStr = mono_string_to_utf8(mono_object_to_string(__result__, NULL));
std::cout << "pass7:" << resStr << std::endl;
mscorlib::System::Boolean doesExists = *(mscorlib::System::Boolean*)mono_object_unbox(__result__);
std::cout << "pass8" << std::endl;
EXPECT_TRUE(doesExists);
list->Remove(String("TEST"));
EXPECT_EQ(0, list->Count);
list->Add(String("TEST_NO"));
__result__ = Global::InvokeMethod("mscorlib", "System.Collections.Generic", "List`1", 1, __generic_types__, "Exists", __native_object__, 1, __parameter_types__, __parameters__, NULL);
doesExists = *(mscorlib::System::Boolean*)mono_object_unbox(__result__);
EXPECT_FALSE(doesExists);
}
TEST(SampleFixture, BasicTest4)
{
}
TEST(SampleFixture, BasicTest5)
{
}
| 32.027027 | 196 | 0.715401 | brunolauze |
ef0290a03a5005abce124c9cffb3bf7594a922a1 | 7,199 | cpp | C++ | brsdk/net/event/event_loop.cpp | JerryYu512/brsdk | b0bc4606a34e5d934db52b7b054f36c588b840f9 | [
"MIT"
] | null | null | null | brsdk/net/event/event_loop.cpp | JerryYu512/brsdk | b0bc4606a34e5d934db52b7b054f36c588b840f9 | [
"MIT"
] | null | null | null | brsdk/net/event/event_loop.cpp | JerryYu512/brsdk | b0bc4606a34e5d934db52b7b054f36c588b840f9 | [
"MIT"
] | null | null | null | /**
* MIT License
*
* Copyright © 2021 <Jerry.Yu>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
* and associated documentation files (the “Software”), to deal in the Software without
* restriction, including without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
*
* The above copyright notice and this permission notice shall be included in all copies or
* substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* @file event_loop.cpp
* @brief
* @author Jerry.Yu ([email protected])
* @version 1.0.0
* @date 2021-10-17
*
* @copyright MIT License
*
*/
#include "event_log.hpp"
#include "event_loop.hpp"
#include "event_channel.hpp"
#include "poller.hpp"
#include "brsdk/net/socket/socket_util.hpp"
#include <algorithm>
// #include <signal.h>
#include <sys/eventfd.h>
#include <unistd.h>
namespace brsdk {
namespace net {
__thread EventLoop* t_loop_in_this_thread = nullptr;
// 轮询其间隔10s
const int kPollTimeMs = 10000;
static int create_eventfd(void) {
int evtfd = ::eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
if (evtfd < 0) {
LOG_SYSERR << "Failed in eventfd";
abort();
}
return evtfd;
}
EventLoop* EventLoop::GetEventLoopOfCurrentThead(void) {
return t_loop_in_this_thread;
}
EventLoop::EventLoop()
: looping_(false),
quit_(false),
event_handling_(false),
calling_pending_functors_(false),
iteration_(0),
tid_(thread::tid()),
poller_(EventPoller::NewDefaultPoller(this)),
timer_queue_(new TimerQueue(this)),
wakeup_fd_(create_eventfd()),
wakeup_channel_(new EventChannel(this, wakeup_fd_)),
current_active_channel_(nullptr) {
LOG_DEBUG << "EventLopp created " << this << " in thread " << tid_;
// 全局判断,一个线程只能创建一个
if (t_loop_in_this_thread) {
LOG_FATAL << "Another EventLoop " << t_loop_in_this_thread
<< " exists in this thread " << tid_;
} else {
t_loop_in_this_thread = this;
}
// 设置唤醒通道的读事件
wakeup_channel_->SetReadCallback(std::bind(&EventLoop::HandleWakeupRead, this));
// 始终允许读事件
wakeup_channel_->EnableReading();
}
EventLoop::~EventLoop() {
LOG_DEBUG << "EventLoop" << this << " of thread " << tid_
<< " destructs in thread " << thread::tid();
// 移除唤醒通道
wakeup_channel_->DisableAll();
wakeup_channel_->remove();
::close(wakeup_fd_);
// 处理待处理的回调接口
DoPendingFunctors();
t_loop_in_this_thread = nullptr;
}
void EventLoop::loop(void) {
assert(!looping_);
AssertInLoopThread();
looping_ = true;
quit_ = false;
LOG_TRACE << "EventLoop " << this << " start looping";
while (!quit_) {
// 清空活动队列
active_channels_.clear();
// 轮询活动通道
poll_return_time_ = poller_->poll(kPollTimeMs, &active_channels_);
// loop次数增加
++iteration_;
if (Logger::logLevel() <= Logger::TRACE) {
PrintActiveChannels();
}
// 正在处理事件
event_handling_ = true;
// 活动事件轮询处理
for (EventChannel* channel : active_channels_) {
current_active_channel_ = channel;
current_active_channel_->HandleEvent(poll_return_time_);
}
current_active_channel_ = nullptr;
// 事件处理结束
event_handling_ = false;
// 处理待处理的回调接口
DoPendingFunctors();
}
LOG_TRACE << "EventLoop " << this << " stop looping";
looping_ = false;
}
void EventLoop::quit(void) {
// FIXME:非线程安全的,退出需要使用加锁来解决
quit_ = true;
// 如果不是loop线程内的话,唤醒一次,因为有机会将剩下的事件/回调处理完
if (!IsInLoopThread()) {
wakeup();
}
}
void EventLoop::RunInLoop(EventFunctor cb) {
if (IsInLoopThread() || quit_) {
// loop线程内的直接调用,因为已经在loop里了
cb();
} else {
// 放到队列中,在loop循环内执行
QueueInLoop(std::move(cb));
}
}
void EventLoop::QueueInLoop(EventFunctor cb) {
if (quit_)
{
cb();
return;
}
{
MutexLockGuard lock(mutex_);
pending_functors_.push_back(std::move(cb));
}
// 如果不是在loop线程内,或者正在执行待处理回调函数,需要唤醒一次,避免处理延后
if (!IsInLoopThread() || calling_pending_functors_) {
wakeup();
}
}
size_t EventLoop::queue_size(void) const {
MutexLockGuard lock(mutex_);
return pending_functors_.size();
}
TimerId EventLoop::RunAt(Timestamp time, TimerCallback cb) {
// 间隔为0则不需要间隔执行
return timer_queue_->AddTimer(std::move(cb), time, 0.0);
}
TimerId EventLoop::RunAfter(double delay, TimerCallback cb) {
Timestamp time(addTime(Timestamp::now(), delay));
return RunAt(time, std::move(cb));
}
TimerId EventLoop::RunEvery(double interval, TimerCallback cb) {
Timestamp time(addTime(Timestamp::now(), interval));
return timer_queue_->AddTimer(std::move(cb), time, interval);
}
void EventLoop::cancel(TimerId timer_id) {
return timer_queue_->cancel(timer_id);
}
void EventLoop::UpdateChannel(EventChannel* channel) {
// 更新是在loop线程中更新的
assert(channel->OwnerLoop() == this);
AssertInLoopThread();
// 事件更新
poller_->UpdateChannel(channel);
}
void EventLoop::RemoveChannel(EventChannel* channel) {
// 更新是在loop线程中删除的
assert(channel->OwnerLoop() == this);
AssertInLoopThread();
if (event_handling_) {
assert(current_active_channel_ == channel ||
std::find(active_channels_.begin(), active_channels_.end(), channel) == active_channels_.end());
}
poller_->RemoveChannel(channel);
}
bool EventLoop::HasChannel(EventChannel* channel) {
assert(channel->OwnerLoop() == this);
AssertInLoopThread();
return poller_->HasChannel(channel);
}
void EventLoop::AbortNotInLoopThread(void) {
LOG_FATAL << "EventLoop::abortNotInLoopThread - EventLoop " << this
<< " was created in threadId_ = " << tid_
<< ", current thread id = " << thread::tid();
}
void EventLoop::wakeup(void) {
uint64_t one = 1;
// 通过写数据来唤醒轮询器
ssize_t n = sock_write(wakeup_fd_, &one, sizeof(one));
if (n != sizeof(one)) {
LOG_ERROR << "EventLoop::wakeup() writes " << n << " bytes instead of 8";
}
}
void EventLoop::HandleWakeupRead(void) {
uint64_t one = 1;
ssize_t n = sock_read(wakeup_fd_, &one, sizeof(one));
if (n != sizeof(one)) {
LOG_ERROR << "EventLoop::handleRead() reads " << n << " bytes instead of 8";
}
}
void EventLoop::DoPendingFunctors(void) {
std::vector<EventFunctor> functors;
// 正在处理回调接口
calling_pending_functors_ = true;
{
MutexLockGuard lock(mutex_);
functors.swap(pending_functors_);
}
for (const EventFunctor& functor : functors) {
functor();
}
calling_pending_functors_ = false;
}
void EventLoop::PrintActiveChannels(void) const {
for (const EventChannel* channel : active_channels_) {
LOG_TRACE << "{" << channel->ReventsToString() << "}";
}
}
} // namespace net
} // namespace brsdk
| 26.564576 | 100 | 0.681761 | JerryYu512 |
ef056550a0ab7ebcf4496c64f27d7965838047b0 | 18,690 | cc | C++ | image_loader.cc | diixo/tensorflow_xla | f5a82ff203670103b6fd81b72682623123724ca1 | [
"Apache-2.0"
] | 3 | 2020-08-27T16:40:04.000Z | 2021-05-12T13:31:05.000Z | image_loader.cc | diixo/tensorflow_xla | f5a82ff203670103b6fd81b72682623123724ca1 | [
"Apache-2.0"
] | null | null | null | image_loader.cc | diixo/tensorflow_xla | f5a82ff203670103b6fd81b72682623123724ca1 | [
"Apache-2.0"
] | 2 | 2020-06-09T11:32:27.000Z | 2021-04-04T18:41:11.000Z |
#include "image_loader.h"
namespace xla
{
std::unique_ptr<xla::Array4D <UChar8> > load_bmp(const std::string& file_name)
{
std::ifstream fin(file_name.c_str(), std::ios::in | std::ios::binary);
if (!fin)
{
//throw image_load_error("Unable to open " + file_name + " for reading.");
return std::unique_ptr<xla::Array4D<UChar8>>();
}
unsigned long bytes_read_so_far = 0;
using namespace std;
streambuf& in = *fin.rdbuf();
// streamsize num;
UChar8 buf[100];
std::unique_ptr<xla::Array4D<UChar8>> image = 0;
try
{
BITMAPFILEHEADER header;
header.bfType = read_u16(in);
header.bfSize = read_u32(in);
header.bfReserved1 = read_u16(in);
header.bfReserved2 = read_u16(in);
header.bfOffBits = read_u32(in);
buf[0] = UChar8(header.bfType);
buf[1] = UChar8(header.bfType >> 8);
bytes_read_so_far += 2;
if (buf[0] != 'B' || buf[1] != 'M')
{
throw image_load_error("bmp load error 2: header error");
}
bytes_read_so_far += 12;
// finish read BITMAPFILEHEADER
// https://ziggi.org/bystryy-negativ-bmp-izobrazheniya-v-cpp/
// if this value isn't zero then there is something wrong
// with this bitmap.
if (header.bfReserved1 != 0)
{
throw image_load_error("bmp load error 4: reserved area not zero");
}
bytes_read_so_far += 40;
///////////////////////////////////
BITMAPINFOHEADER info;
info.biSize = read_u32(in);
info.biWidth = read_u32(in);
info.biHeight = read_u32(in);
info.biPlanes = read_u16(in);
info.biBitCount = read_u16(in);
info.biCompression = read_u32(in);
info.biSizeImage = read_u32(in);
info.biXPelsPerMeter = read_u32(in);
info.biYPelsPerMeter = read_u32(in);
info.biClrUsed = read_u32(in);
info.biClrImportant = read_u32(in);
image = xla::MakeUnique<xla::Array4D<UChar8>>(1, 3, info.biHeight, info.biWidth);
switch (info.biBitCount)
{
case 1:
{
// figure out how the pixels are packed
long padding;
if (header.bfSize - header.bfOffBits == static_cast<unsigned int>(info.biWidth*info.biHeight) / 8U)
{
padding = 0;
}
else
{
padding = 4 - ((info.biWidth + 7) / 8) % 4;
}
const unsigned int palette_size = 2;
UChar8 red[palette_size];
UChar8 green[palette_size];
UChar8 blue[palette_size];
for (unsigned int i = 0; i < palette_size; ++i)
{
if (in.sgetn(reinterpret_cast<char*>(buf), 4) != 4)
{
throw image_load_error("bmp load error 20: color palette missing");
}
bytes_read_so_far += 4;
blue[i] = buf[0];
green[i] = buf[1];
red[i] = buf[2];
}
// seek to the start of the pixel data
while (bytes_read_so_far != header.bfOffBits)
{
const long to_read = (long)std::min(header.bfOffBits - bytes_read_so_far, (unsigned long)sizeof(buf));
if (in.sgetn(reinterpret_cast<char*>(buf), to_read) != to_read)
{
throw image_load_error("bmp load error: missing data");
}
bytes_read_so_far += to_read;
}
// load the image data
for (int row = info.biHeight - 1; row >= 0; --row)
{
for (int col = 0; col < info.biWidth; col += 8)
{
if (in.sgetn(reinterpret_cast<char*>(buf), 1) != 1)
{
throw image_load_error("bmp load error 21.6: file too short");
}
UChar8 pixels[8];
pixels[0] = (buf[0] >> 7);
pixels[1] = ((buf[0] >> 6) & 0x01);
pixels[2] = ((buf[0] >> 5) & 0x01);
pixels[3] = ((buf[0] >> 4) & 0x01);
pixels[4] = ((buf[0] >> 3) & 0x01);
pixels[5] = ((buf[0] >> 2) & 0x01);
pixels[6] = ((buf[0] >> 1) & 0x01);
pixels[7] = ((buf[0]) & 0x01);
for (int i = 0; i < 8 && col + i < info.biWidth; ++i)
{
rgb_pixel p;
p.red = red[pixels[i]];
p.green = green[pixels[i]];
p.blue = blue[pixels[i]];
(*image)(0, 0, row, col + i) = p.red;
(*image)(0, 1, row, col + i) = p.green;
(*image)(0, 2, row, col + i) = p.blue;
}
}
if (in.sgetn(reinterpret_cast<char*>(buf), padding) != padding)
{
throw image_load_error("bmp load error 9: file too short");
}
}
}
break;
case 4:
{
// figure out how the pixels are packed
long padding;
if (header.bfSize - header.bfOffBits == static_cast<unsigned int>(info.biWidth*info.biHeight) / 2U)
{
padding = 0;
}
else
{
padding = 4 - ((info.biWidth + 1) / 2) % 4;
}
const int palette_size = 16;
UChar8 red[palette_size];
UChar8 green[palette_size];
UChar8 blue[palette_size];
for (int i = 0; i < palette_size; ++i)
{
if (in.sgetn(reinterpret_cast<char*>(buf), 4) != 4)
{
throw image_load_error("bmp load error 20: color palette missing");
}
bytes_read_so_far += 4;
blue[i] = buf[0];
green[i] = buf[1];
red[i] = buf[2];
}
// seek to the start of the pixel data
while (bytes_read_so_far != header.bfOffBits)
{
const long to_read = (long)std::min(header.bfOffBits - bytes_read_so_far, (unsigned long)sizeof(buf));
if (in.sgetn(reinterpret_cast<char*>(buf), to_read) != to_read)
{
throw image_load_error("bmp load error: missing data");
}
bytes_read_so_far += to_read;
}
// load the image data
for (int row = info.biHeight - 1; row >= 0; --row)
{
for (int col = 0; col < info.biWidth; col += 2)
{
if (in.sgetn(reinterpret_cast<char*>(buf), 1) != 1)
{
throw image_load_error("bmp load error 21.7: file too short");
}
const unsigned char pixel1 = (buf[0] >> 4);
const unsigned char pixel2 = (buf[0] & 0x0F);
rgb_pixel p;
p.red = red[pixel1];
p.green = green[pixel1];
p.blue = blue[pixel1];
(*image)(0, 0, row, col) = p.red;
(*image)(0, 1, row, col) = p.green;
(*image)(0, 2, row, col) = p.blue;
if (col + 1 < info.biWidth)
{
p.red = red[pixel2];
p.green = green[pixel2];
p.blue = blue[pixel2];
//(*image)(row, col+1) = p;
(*image)(0, 0, row, col + 1) = p.red;
(*image)(0, 1, row, col + 1) = p.green;
(*image)(0, 2, row, col + 1) = p.blue;
}
}
if (in.sgetn(reinterpret_cast<char*>(buf), padding) != padding)
throw image_load_error("bmp load error 9: file too short");
}
}
break;
case 8:
{
// figure out how the pixels are packed
int padding = 0;
if (header.bfSize - header.bfOffBits == static_cast<unsigned int>(info.biWidth*info.biHeight))
padding = 0;
else
padding = 4 - info.biWidth % 4;
// check for this case. It shouldn't happen but some BMP writers screw up the files
// so we have to do this.
if (info.biHeight * (info.biWidth + padding) > static_cast<int>(header.bfSize - header.bfOffBits))
padding = 0;
const unsigned int palette_size = 256;
UChar8 red[palette_size];
UChar8 green[palette_size];
UChar8 blue[palette_size];
for (unsigned int i = 0; i < palette_size; ++i)
{
if (in.sgetn(reinterpret_cast<char*>(buf), 4) != 4)
{
throw image_load_error("bmp load error 20: color palette missing");
}
bytes_read_so_far += 4;
blue[i] = buf[0];
green[i] = buf[1];
red[i] = buf[2];
}
// seek to the start of the pixel data
while (bytes_read_so_far != header.bfOffBits)
{
const long to_read = (long)std::min(header.bfOffBits - bytes_read_so_far, (unsigned long)sizeof(buf));
if (in.sgetn(reinterpret_cast<char*>(buf), to_read) != to_read)
{
throw image_load_error("bmp load error: missing data");
}
bytes_read_so_far += to_read;
}
// Next we load the image data.
// if there is no RLE compression
if (info.biCompression == 0)
{
for (long row = info.biHeight - 1; row >= 0; --row)
{
for (/*unsigned long*/ int col = 0; col < info.biWidth; ++col)
{
if (in.sgetn(reinterpret_cast<char*>(buf), 1) != 1)
{
throw image_load_error("bmp load error 21.8: file too short");
}
rgb_pixel p;
p.red = red[buf[0]];
p.green = green[buf[0]];
p.blue = blue[buf[0]];
//(*image)(row, col) = p;
(*image)(0, 0, row, col) = p.red;
(*image)(0, 1, row, col) = p.green;
(*image)(0, 2, row, col) = p.blue;
}
if (in.sgetn(reinterpret_cast<char*>(buf), padding) != padding)
{
throw image_load_error("bmp load error 9: file too short");
}
}
}
else
{
// Here we deal with the psychotic RLE used by BMP files.
// First zero the image since the RLE sometimes jumps over
// pixels and assumes the image has been zero initialized.
//assign_all_pixels(image, 0);
long row = info.biHeight - 1;
long col = 0;
while (true)
{
if (in.sgetn(reinterpret_cast<char*>(buf), 2) != 2)
{
throw image_load_error("bmp load error 21.9: file too short");
}
const unsigned char count = buf[0];
const unsigned char command = buf[1];
if (count == 0 && command == 0)
{
// This is an escape code that means go to the next row
// of the image
--row;
col = 0;
continue;
}
else if (count == 0 && command == 1)
{
// This is the end of the image. So quit this loop.
break;
}
else if (count == 0 && command == 2)
{
// This is the escape code for the command to jump to
// a new part of the image relative to where we are now.
if (in.sgetn(reinterpret_cast<char*>(buf), 2) != 2)
{
throw image_load_error("bmp load error 21.1: file too short");
}
col += buf[0];
row -= buf[1];
continue;
}
else if (count == 0)
{
// This is the escape code for a run of uncompressed bytes
if (row < 0 || col + command > image->width())
{
// If this is just some padding bytes at the end then ignore them
if (row >= 0 && col + count <= image->width() + padding)
continue;
throw image_load_error("bmp load error 21.2: file data corrupt");
}
// put the bytes into the image
for (unsigned int i = 0; i < command; ++i)
{
if (in.sgetn(reinterpret_cast<char*>(buf), 1) != 1)
{
throw image_load_error("bmp load error 21.3: file too short");
}
rgb_pixel p;
p.red = red[buf[0]];
p.green = green[buf[0]];
p.blue = blue[buf[0]];
(*image)(0, 0, row, col) = p.red;
(*image)(0, 1, row, col) = p.green;
(*image)(0, 2, row, col) = p.blue;
++col;
}
// if we read an uneven number of bytes then we need to read and
// discard the next byte.
if ((command & 1) != 1)
{
if (in.sgetn(reinterpret_cast<char*>(buf), 1) != 1)
{
throw image_load_error("bmp load error 21.4: file too short");
}
}
continue;
}
rgb_pixel p;
if (row < 0 || col + count > image->width())
{
// If this is just some padding bytes at the end then ignore them
if (row >= 0 && col + count <= image->width() + padding)
{
continue;
}
throw image_load_error("bmp load error 21.5: file data corrupt");
}
// put the bytes into the image
for (unsigned int i = 0; i < count; ++i)
{
p.red = red[command];
p.green = green[command];
p.blue = blue[command];
(*image)(0, 0, row, col) = p.red;
(*image)(0, 1, row, col) = p.green;
(*image)(0, 2, row, col) = p.blue;
++col;
}
}
}
}
break;
case 16:
throw image_load_error("16 bit BMP images not supported");
case 24: //
{
// figure out how the pixels are packed
long padding;
if (header.bfSize - header.bfOffBits == static_cast<unsigned int>(info.biWidth * info.biHeight) * 3U)
{
padding = 0;
}
else
{
padding = 4 - (info.biWidth * 3) % 4;
}
// check for this case. It shouldn't happen but some BMP writers screw up the files
// so we have to do this.
if (info.biHeight * (info.biWidth * 3 + padding) > static_cast<int>(header.bfSize - header.bfOffBits))
{
padding = 0;
}
// seek to the start of the pixel data
while (bytes_read_so_far != header.bfOffBits)
{
const long to_read = (long)std::min(header.bfOffBits - bytes_read_so_far, (unsigned long)sizeof(buf));
if (in.sgetn(reinterpret_cast<char*>(buf), to_read) != to_read)
{
throw image_load_error("bmp load error: missing data");
}
bytes_read_so_far += to_read;
}
// load the image data
for (int row = info.biHeight - 1; row >= 0; --row)
{
for (int col = 0; col < info.biWidth; ++col)
{
if (in.sgetn(reinterpret_cast<char*>(buf), 3) != 3)
{
throw image_load_error("bmp load error 8: file too short");
}
rgb_pixel p;
p.red = buf[2];
p.green = buf[1];
p.blue = buf[0];
(*image)(0, 2, row, col) = p.red;
(*image)(0, 1, row, col) = p.green;
(*image)(0, 0, row, col) = p.blue;
}
if (padding > 0)
{
if (in.sgetn(reinterpret_cast<char*>(buf), padding) != padding)
{
throw image_load_error("bmp load error 9: file too short");
}
}
}
break;
}
case 32:
throw image_load_error("32 bit BMP images not supported");
default:
throw image_load_error("bmp load error 10: unknown color depth");
}
}
catch (...)
{
//image.clear();
throw;
}
return image;
}
} // ns
| 36.15087 | 118 | 0.410166 | diixo |
ef1740eaadc446c62f1b35e5919b6031f8113063 | 5,213 | cpp | C++ | plugins/gui/src/code_editor/code_editor_minimap.cpp | emsec/HAL | 608e801896e1b5254b28ce0f29d4d898b81b0f77 | [
"MIT"
] | 407 | 2019-04-26T10:45:52.000Z | 2022-03-31T15:52:30.000Z | plugins/gui/src/code_editor/code_editor_minimap.cpp | emsec/HAL | 608e801896e1b5254b28ce0f29d4d898b81b0f77 | [
"MIT"
] | 219 | 2019-04-29T16:42:01.000Z | 2022-03-11T22:57:41.000Z | plugins/gui/src/code_editor/code_editor_minimap.cpp | emsec/HAL | 608e801896e1b5254b28ce0f29d4d898b81b0f77 | [
"MIT"
] | 53 | 2019-05-02T21:23:35.000Z | 2022-03-11T19:46:05.000Z | #include "gui/code_editor/code_editor_minimap.h"
#include "gui/code_editor/code_editor.h"
#include "gui/code_editor/minimap_scrollbar.h"
#include <QPainter>
#include <QStyleOption>
#include <QTextBlock>
#include <cmath>
#include <math.h>
#include <QDebug>
namespace hal
{
CodeEditorMinimap::CodeEditorMinimap(CodeEditor* editor)
: QWidget(editor), mEditor(editor), mDocument(new QTextDocument()), mScrollbar(new MinimapScrollbar(this)), mDocumentHeight(0), mOffset(0)
{
connect(mEditor->document(), &QTextDocument::contentsChange, this, &CodeEditorMinimap::handleContentsChange);
connect(mDocument->documentLayout(), &QAbstractTextDocumentLayout::documentSizeChanged, this, &CodeEditorMinimap::handleDocumentSizeChanged);
mDocument->setDocumentMargin(0);
mScrollbar->show();
repolish();
}
MinimapScrollbar* CodeEditorMinimap::scrollbar()
{
return mScrollbar;
}
QTextDocument* CodeEditorMinimap::document()
{
return mDocument;
}
void CodeEditorMinimap::adjustSliderHeight(int viewport_height)
{
Q_UNUSED(viewport_height);
qDebug() << "editor " << mEditor->document()->documentLayout()->documentSize().height();
qDebug() << "mini " << mDocument->documentLayout()->documentSize().height();
qreal ratio = mEditor->document()->documentLayout()->documentSize().height() / mDocument->documentLayout()->documentSize().height(); // UNEXPECTED RESULT, MAKES NO SENSE
mScrollbar->setSliderHeight(std::round(mEditor->viewport()->contentsRect().height() * ratio));
}
void CodeEditorMinimap::adjustSliderHeight(qreal ratio)
{
mScrollbar->setSliderHeight(std::round(ratio * mDocument->documentLayout()->blockBoundingRect(mDocument->firstBlock()).height()));
resizeScrollbar();
}
void CodeEditorMinimap::adjustSliderHeight(int first_visible_block, int last_visible_block)
{
qDebug() << "first block: " + QString::number(first_visible_block);
qDebug() << "last block: " + QString::number(last_visible_block);
qreal top = mDocument->documentLayout()->blockBoundingRect(mDocument->findBlockByNumber(first_visible_block)).top();
qreal bottom = mDocument->documentLayout()->blockBoundingRect(mDocument->findBlockByNumber(last_visible_block)).bottom();
qDebug() << "top: " + QString::number(top);
qDebug() << "bottom: " + QString::number(bottom);
mScrollbar->setSliderHeight(std::round(bottom - top));
}
void CodeEditorMinimap::handleDocumentSizeChanged(const QSizeF& new_size)
{
mDocumentHeight = std::ceil(new_size.height());
resizeScrollbar();
}
void CodeEditorMinimap::handleContentsChange(int position, int chars_removed, int chars_added)
{
QTextCursor cursor = QTextCursor(mDocument);
cursor.setPosition(position);
if (chars_removed)
{
cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, chars_removed);
cursor.removeSelectedText();
}
if (chars_added)
cursor.insertText(mEditor->document()->toPlainText().mid(position, chars_added));
}
void CodeEditorMinimap::paintEvent(QPaintEvent* event)
{
Q_UNUSED(event)
QStyleOption opt;
opt.init(this);
QPainter painter(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
painter.setClipping(true);
painter.setClipRect(rect());
QAbstractTextDocumentLayout::PaintContext ctx;
ctx.palette.setColor(QPalette::Text, palette().text().color());
if (mDocumentHeight > height())
{
int block_number = mEditor->first_visible_block();
int sliderPosition = mScrollbar->sliderPosition();
mOffset = mDocument->documentLayout()->blockBoundingRect(mDocument->findBlockByNumber(block_number)).top() - sliderPosition;
painter.translate(0, -mOffset);
ctx.clip = QRectF(0, mOffset, width(), height());
}
mDocument->documentLayout()->draw(&painter, ctx);
}
void CodeEditorMinimap::resizeEvent(QResizeEvent* event)
{
Q_UNUSED(event)
resizeScrollbar();
}
void CodeEditorMinimap::mousePressEvent(QMouseEvent* event)
{
int position = mDocument->documentLayout()->hitTest(QPointF(event->pos().x(), event->pos().y() + mOffset), Qt::FuzzyHit);
QTextCursor cursor(mDocument);
cursor.setPosition(position);
mEditor->centerOnLine(cursor.blockNumber());
}
void CodeEditorMinimap::wheelEvent(QWheelEvent* event)
{
mEditor->handleWheelEvent(event);
}
void CodeEditorMinimap::resizeScrollbar()
{
if (mDocumentHeight < height())
mScrollbar->resize(width(), std::max(mScrollbar->sliderHeight(), mDocumentHeight));
else
mScrollbar->resize(width(), height());
}
void CodeEditorMinimap::repolish()
{
QStyle* s = style();
s->unpolish(this);
s->polish(this);
mDocument->setDefaultFont(font());
}
}
| 33.203822 | 180 | 0.656819 | emsec |
faa2d85910b3524ecbc8cf8e0bdce970b462431d | 10,104 | hpp | C++ | Lib-ZeroG/src/d3d12/D3D12CommandQueue.hpp | PetorSFZ/sfz_tech | 0d4027ad2c2bb444b83e78f009b649478cb97a73 | [
"Zlib"
] | 2 | 2020-09-04T16:52:47.000Z | 2021-04-21T18:30:25.000Z | Lib-ZeroG/src/d3d12/D3D12CommandQueue.hpp | PetorSFZ/sfz_tech | 0d4027ad2c2bb444b83e78f009b649478cb97a73 | [
"Zlib"
] | null | null | null | Lib-ZeroG/src/d3d12/D3D12CommandQueue.hpp | PetorSFZ/sfz_tech | 0d4027ad2c2bb444b83e78f009b649478cb97a73 | [
"Zlib"
] | null | null | null | // Copyright (c) Peter Hillerström (skipifzero.com, [email protected])
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#pragma once
#include <mutex>
#include <skipifzero.hpp>
#include <skipifzero_arrays.hpp>
#include <skipifzero_ring_buffers.hpp>
#include "ZeroG.h"
#include "d3d12/D3D12Common.hpp"
#include "d3d12/D3D12CommandList.hpp"
#include "d3d12/D3D12DescriptorRingBuffer.hpp"
#include "d3d12/D3D12ResourceTracking.hpp"
// Fence
// ------------------------------------------------------------------------------------------------
struct ZgFence final {
public:
// Constructors & destructors
// --------------------------------------------------------------------------------------------
ZgFence() noexcept = default;
ZgFence(const ZgFence&) = delete;
ZgFence& operator= (const ZgFence&) = delete;
ZgFence(ZgFence&&) = delete;
ZgFence& operator= (ZgFence&&) = delete;
~ZgFence() noexcept {}
// Members
// --------------------------------------------------------------------------------------------
u64 fenceValue = 0;
ZgCommandQueue* commandQueue = nullptr;
// Virtual methods
// --------------------------------------------------------------------------------------------
ZgResult reset() noexcept
{
this->fenceValue = 0;
this->commandQueue = nullptr;
return ZG_SUCCESS;
}
ZgResult checkIfSignaled(bool& fenceSignaledOut) const noexcept;
ZgResult waitOnCpuBlocking() const noexcept;
};
// ZgCommandQueue
// ------------------------------------------------------------------------------------------------
constexpr u32 MAX_NUM_COMMAND_LISTS = 1024;
struct ZgCommandQueue final {
// Constructors & destructors
// --------------------------------------------------------------------------------------------
ZgCommandQueue() noexcept = default;
ZgCommandQueue(const ZgCommandQueue&) = delete;
ZgCommandQueue& operator= (const ZgCommandQueue&) = delete;
ZgCommandQueue(ZgCommandQueue&&) = delete;
ZgCommandQueue& operator= (ZgCommandQueue&&) = delete;
~ZgCommandQueue() noexcept
{
// Flush queue
[[maybe_unused]] ZgResult res = this->flush();
// Check that all command lists have been returned
sfz_assert(mCommandListStorage.size() == mCommandListQueue.size());
// Destroy fence event
CloseHandle(mCommandQueueFenceEvent);
}
// State methods
// --------------------------------------------------------------------------------------------
ZgResult create(
D3D12_COMMAND_LIST_TYPE type,
ComPtr<ID3D12Device3>& device,
D3D12DescriptorRingBuffer* descriptorBuffer) noexcept
{
mType = type;
mDevice = device;
mDescriptorBuffer = descriptorBuffer;
// Create command queue
D3D12_COMMAND_QUEUE_DESC desc = {};
desc.Type = type;
desc.Priority = D3D12_COMMAND_QUEUE_PRIORITY_NORMAL;
desc.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE; // TODO: D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT
desc.NodeMask = 0;
if (D3D12_FAIL(device->CreateCommandQueue(&desc, IID_PPV_ARGS(&mCommandQueue)))) {
return ZG_ERROR_NO_SUITABLE_DEVICE;
}
// Create command queue fence
if (D3D12_FAIL(device->CreateFence(
mCommandQueueFenceValue, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&mCommandQueueFence)))) {
return ZG_ERROR_GENERIC;
}
// Create command queue fence event
mCommandQueueFenceEvent = ::CreateEvent(NULL, false, false, NULL);
// Allocate memory for command lists
mCommandListStorage.init(
MAX_NUM_COMMAND_LISTS, getAllocator(), sfz_dbg("ZeroG - D3D12CommandQueue - CommandListStorage"));
mCommandListQueue.create(
MAX_NUM_COMMAND_LISTS, getAllocator(), sfz_dbg("ZeroG - D3D12CommandQueue - CommandListQueue"));
return ZG_SUCCESS;
}
// Members
// --------------------------------------------------------------------------------------------
D3D12_COMMAND_LIST_TYPE mType;
ComPtr<ID3D12Device3> mDevice;
D3D12DescriptorRingBuffer* mDescriptorBuffer = nullptr;
ComPtr<ID3D12CommandQueue> mCommandQueue;
ComPtr<ID3D12Fence> mCommandQueueFence;
u64 mCommandQueueFenceValue = 0;
HANDLE mCommandQueueFenceEvent = nullptr;
sfz::Array<ZgCommandList> mCommandListStorage;
sfz::RingBuffer<ZgCommandList*> mCommandListQueue;
// Virtual methods
// --------------------------------------------------------------------------------------------
ZgResult signalOnGpu(ZgFence& fenceToSignal) noexcept
{
fenceToSignal.commandQueue = this;
fenceToSignal.fenceValue = signalOnGpuInternal();
return ZG_SUCCESS;
}
ZgResult waitOnGpu(const ZgFence& fence) noexcept
{
if (fence.commandQueue == nullptr) return ZG_ERROR_INVALID_ARGUMENT;
CHECK_D3D12 this->mCommandQueue->Wait(
fence.commandQueue->mCommandQueueFence.Get(), fence.fenceValue);
return ZG_SUCCESS;
}
ZgResult flush() noexcept
{
u64 fenceValue = this->signalOnGpuInternal();
this->waitOnCpuInternal(fenceValue);
return ZG_SUCCESS;
}
ZgResult beginCommandListRecording(ZgCommandList** commandListOut) noexcept
{
ZgCommandList* commandList = nullptr;
bool commandListFound = false;
// If command lists available in queue, attempt to get one of them
u64 queueSize = mCommandListQueue.size();
if (queueSize != 0) {
if (isFenceValueDone(mCommandListQueue.first()->fenceValue)) {
mCommandListQueue.pop(commandList);
commandListFound = true;
}
}
// If no command list found, create new one
if (!commandListFound) {
ZgResult res = createCommandList(commandList);
if (res != ZG_SUCCESS) return res;
commandListFound = true;
}
// Reset command list and allocator
ZgResult res = commandList->reset();
if (res != ZG_SUCCESS) return res;
// Return command list
*commandListOut = commandList;
return ZG_SUCCESS;
}
ZgResult executeCommandList(ZgCommandList* commandList, bool barrierList = false) noexcept
{
// Close command list
if (D3D12_FAIL(commandList->commandList->Close())) {
return ZG_ERROR_GENERIC;
}
auto execBarriers = [&](const CD3DX12_RESOURCE_BARRIER* barriers, u32 numBarriers) -> ZgResult {
// Get command list to execute barriers in
ZgCommandList* commandList = nullptr;
ZgResult res =
this->beginCommandListRecording(&commandList);
if (res != ZG_SUCCESS) return res;
// Insert barrier call
commandList->commandList->ResourceBarrier(numBarriers, barriers);
// Execute barriers
return this->executeCommandList(commandList, true);
};
// Execute command list
ID3D12CommandList* cmdLists[1] = {};
ZgTrackerCommandListState* cmdListStates[1] = {};
cmdLists[0] = commandList->commandList.Get();
cmdListStates[0] = &commandList->tracking;
executeCommandLists(*mCommandQueue.Get(), cmdLists, cmdListStates, 1, execBarriers, barrierList);
// Signal
u64 fenceValue = this->signalOnGpuInternal();
commandList->fenceValue = fenceValue;
// Add command list to queue
mCommandListQueue.add(commandList);
return ZG_SUCCESS;
}
// Synchronization methods
// --------------------------------------------------------------------------------------------
u64 signalOnGpuInternal() noexcept
{
CHECK_D3D12 mCommandQueue->Signal(mCommandQueueFence.Get(), mCommandQueueFenceValue);
return mCommandQueueFenceValue++;
}
void waitOnCpuInternal(u64 fenceValue) noexcept
{
if (!isFenceValueDone(fenceValue)) {
CHECK_D3D12 mCommandQueueFence->SetEventOnCompletion(
fenceValue, mCommandQueueFenceEvent);
// TODO: Don't wait forever
::WaitForSingleObject(mCommandQueueFenceEvent, INFINITE);
}
}
bool isFenceValueDone(u64 fenceValue) noexcept
{
return mCommandQueueFence->GetCompletedValue() >= fenceValue;
}
private:
// Private methods
// --------------------------------------------------------------------------------------------
ZgResult createCommandList(ZgCommandList*& commandListOut) noexcept
{
// Create a new command list in storage
ZgCommandList& commandList = mCommandListStorage.add();
sfz_assert_hard(mCommandListStorage.size() < MAX_NUM_COMMAND_LISTS);
commandList.commandListType = this->mType;
// Create command allocator
if (D3D12_FAIL(mDevice->CreateCommandAllocator(
mType, IID_PPV_ARGS(&commandList.commandAllocator)))) {
mCommandListStorage.pop();
return ZG_ERROR_GENERIC;
}
// Create command list
if (D3D12_FAIL(mDevice->CreateCommandList(
0,
mType,
commandList.commandAllocator.Get(),
nullptr,
IID_PPV_ARGS(&commandList.commandList)))) {
mCommandListStorage.pop();
return ZG_ERROR_GENERIC;
}
// Ensure command list is in closed state
if (D3D12_FAIL(commandList.commandList->Close())) {
mCommandListStorage.pop();
return ZG_ERROR_GENERIC;
}
// Initialize command list
commandList.create(
mDevice,
mDescriptorBuffer);
commandListOut = &commandList;
return ZG_SUCCESS;
}
};
// Fence (continued
// ------------------------------------------------------------------------------------------------
inline ZgResult ZgFence::checkIfSignaled(bool& fenceSignaledOut) const noexcept
{
if (this->commandQueue == nullptr) return ZG_ERROR_INVALID_ARGUMENT;
fenceSignaledOut = this->commandQueue->isFenceValueDone(this->fenceValue);
return ZG_SUCCESS;
}
inline ZgResult ZgFence::waitOnCpuBlocking() const noexcept
{
if (this->commandQueue == nullptr) return ZG_SUCCESS;
this->commandQueue->waitOnCpuInternal(this->fenceValue);
return ZG_SUCCESS;
}
| 30.711246 | 101 | 0.665182 | PetorSFZ |
faaa4656d794e9965baf48a624ba27a09506fb94 | 214 | cpp | C++ | n.cpp | Parthiv-657/DSA | 0923753218d934b728f6c44da0edb8af836bd1ab | [
"MIT"
] | null | null | null | n.cpp | Parthiv-657/DSA | 0923753218d934b728f6c44da0edb8af836bd1ab | [
"MIT"
] | null | null | null | n.cpp | Parthiv-657/DSA | 0923753218d934b728f6c44da0edb8af836bd1ab | [
"MIT"
] | null | null | null | #include<iostream>
using namespace std;
int main()
{
int n,x=0;
cin>>n;
while(n!=1)
{
x++;
if(n%2==0)
n=n/2;
else if(n%2==1)
n++;
}
cout<<x;
} | 13.375 | 23 | 0.373832 | Parthiv-657 |
fab254641b537bd05e24cd02f58b582c0b0065c8 | 503 | cpp | C++ | AIC/AIC'20 - Level 1 Training Contests/Contest #6 (Online)/D.cpp | MaGnsio/CP-Problems | a7f518a20ba470f554b6d54a414b84043bf209c5 | [
"Unlicense"
] | 3 | 2020-11-01T06:31:30.000Z | 2022-02-21T20:37:51.000Z | AIC/AIC'20 - Level 1 Training Contests/Contest #6 (Online)/D.cpp | MaGnsio/CP-Problems | a7f518a20ba470f554b6d54a414b84043bf209c5 | [
"Unlicense"
] | null | null | null | AIC/AIC'20 - Level 1 Training Contests/Contest #6 (Online)/D.cpp | MaGnsio/CP-Problems | a7f518a20ba470f554b6d54a414b84043bf209c5 | [
"Unlicense"
] | 1 | 2021-05-05T18:56:31.000Z | 2021-05-05T18:56:31.000Z | //https://codeforces.com/group/aDFQm4ed6d/contest/274872/problem/D
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef long long ll;
typedef long double ld;
ll mod = 1e9 + 7;
int main ()
{
ios_base::sync_with_stdio (0); cin.tie (0); cout.tie (0);
ll N, p = 0, n = 0;
cin >> N;
while (N--)
{
ll x, y;
cin >> x >> y;
if (x < 0) p++;
else n++;
}
if (p <= 1 || n <= 1) cout << "YES";
else cout << "NO";
}
| 19.346154 | 66 | 0.520875 | MaGnsio |
fab82bd1c7e49cd9c8a2fb05076aaf9b2a7a93fb | 566 | cpp | C++ | Codeforces/69A - Young Physicist.cpp | naimulcsx/online-judge-solutions | 0b80f81bcfb05a7cfe7fc925304c70b19eff1d6f | [
"MIT"
] | null | null | null | Codeforces/69A - Young Physicist.cpp | naimulcsx/online-judge-solutions | 0b80f81bcfb05a7cfe7fc925304c70b19eff1d6f | [
"MIT"
] | null | null | null | Codeforces/69A - Young Physicist.cpp | naimulcsx/online-judge-solutions | 0b80f81bcfb05a7cfe7fc925304c70b19eff1d6f | [
"MIT"
] | null | null | null | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(void) {
int numberOfVectors;
cin >> numberOfVectors;
int arr[numberOfVectors][3];
for (int i = 0; i < numberOfVectors; i++)
cin >> arr[i][0] >> arr[i][1] >> arr[i][2];
int p = 0, q = 0, r = 0;
for (int i = 0; i < numberOfVectors; i++) {
p += arr[i][0];
q += arr[i][1];
r += arr[i][2];
}
if (p == 0 && q == 0 && r == 0)
cout << "YES" << endl;
else
cout << "NO" << endl;
return 0;
} | 19.517241 | 51 | 0.462898 | naimulcsx |
fab89358f86040fb144db934d0e49926f6fdc6b0 | 1,761 | cpp | C++ | android-28/android/hardware/usb/UsbRequest.cpp | YJBeetle/QtAndroidAPI | 1468b5dc6eafaf7709f0b00ba1a6ec2b70684266 | [
"Apache-2.0"
] | 12 | 2020-03-26T02:38:56.000Z | 2022-03-14T08:17:26.000Z | android-28/android/hardware/usb/UsbRequest.cpp | YJBeetle/QtAndroidAPI | 1468b5dc6eafaf7709f0b00ba1a6ec2b70684266 | [
"Apache-2.0"
] | 1 | 2021-01-27T06:07:45.000Z | 2021-11-13T19:19:43.000Z | android-30/android/hardware/usb/UsbRequest.cpp | YJBeetle/QtAndroidAPI | 1468b5dc6eafaf7709f0b00ba1a6ec2b70684266 | [
"Apache-2.0"
] | 3 | 2021-02-02T12:34:55.000Z | 2022-03-08T07:45:57.000Z | #include "./UsbDeviceConnection.hpp"
#include "./UsbEndpoint.hpp"
#include "../../../JObject.hpp"
#include "../../../java/nio/ByteBuffer.hpp"
#include "./UsbRequest.hpp"
namespace android::hardware::usb
{
// Fields
// QJniObject forward
UsbRequest::UsbRequest(QJniObject obj) : JObject(obj) {}
// Constructors
UsbRequest::UsbRequest()
: JObject(
"android.hardware.usb.UsbRequest",
"()V"
) {}
// Methods
jboolean UsbRequest::cancel() const
{
return callMethod<jboolean>(
"cancel",
"()Z"
);
}
void UsbRequest::close() const
{
callMethod<void>(
"close",
"()V"
);
}
JObject UsbRequest::getClientData() const
{
return callObjectMethod(
"getClientData",
"()Ljava/lang/Object;"
);
}
android::hardware::usb::UsbEndpoint UsbRequest::getEndpoint() const
{
return callObjectMethod(
"getEndpoint",
"()Landroid/hardware/usb/UsbEndpoint;"
);
}
jboolean UsbRequest::initialize(android::hardware::usb::UsbDeviceConnection arg0, android::hardware::usb::UsbEndpoint arg1) const
{
return callMethod<jboolean>(
"initialize",
"(Landroid/hardware/usb/UsbDeviceConnection;Landroid/hardware/usb/UsbEndpoint;)Z",
arg0.object(),
arg1.object()
);
}
jboolean UsbRequest::queue(java::nio::ByteBuffer arg0) const
{
return callMethod<jboolean>(
"queue",
"(Ljava/nio/ByteBuffer;)Z",
arg0.object()
);
}
jboolean UsbRequest::queue(java::nio::ByteBuffer arg0, jint arg1) const
{
return callMethod<jboolean>(
"queue",
"(Ljava/nio/ByteBuffer;I)Z",
arg0.object(),
arg1
);
}
void UsbRequest::setClientData(JObject arg0) const
{
callMethod<void>(
"setClientData",
"(Ljava/lang/Object;)V",
arg0.object<jobject>()
);
}
} // namespace android::hardware::usb
| 20.476744 | 130 | 0.667802 | YJBeetle |
fabe170f27fd07fce247851e8f736902c89a8b11 | 842 | hpp | C++ | include/svgpp/factory/unitless_angle.hpp | RichardCory/svgpp | 801e0142c61c88cf2898da157fb96dc04af1b8b0 | [
"BSL-1.0"
] | 428 | 2015-01-05T17:13:54.000Z | 2022-03-31T08:25:47.000Z | include/svgpp/factory/unitless_angle.hpp | andrew2015/svgpp | 1d2f15ab5e1ae89e74604da08f65723f06c28b3b | [
"BSL-1.0"
] | 61 | 2015-01-08T14:32:27.000Z | 2021-12-06T16:55:11.000Z | include/svgpp/factory/unitless_angle.hpp | andrew2015/svgpp | 1d2f15ab5e1ae89e74604da08f65723f06c28b3b | [
"BSL-1.0"
] | 90 | 2015-05-19T04:56:46.000Z | 2022-03-26T16:42:50.000Z | // Copyright Oleg Maximenko 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://github.com/svgpp/svgpp for library home page.
#pragma once
#include <svgpp/traits/angle_units.hpp>
namespace svgpp { namespace factory { namespace angle
{
template<class Angle = double, class ReferenceAngleUnits = tag::angle_units::deg>
struct unitless
{
typedef Angle angle_type;
template<class Number>
static Angle create(Number value, ReferenceAngleUnits)
{
return static_cast<Angle>(value);
}
template<class Number, class Units>
static Angle create(Number value, Units)
{
return static_cast<Angle>(value) * traits::angle_conversion_coefficient<Units, ReferenceAngleUnits, Angle>::value();
}
};
}}} | 25.515152 | 120 | 0.74228 | RichardCory |
fac23cb256e165423d7d4342757c4467f0d43a71 | 10,693 | cpp | C++ | practicaIntegradoraPOO/src/main.cpp | JosueCano143/Object-oriented-programming | ab889d4b4eec5db75311d4700d11aacef53d23f9 | [
"MIT"
] | 1 | 2020-09-28T05:45:54.000Z | 2020-09-28T05:45:54.000Z | practicaIntegradoraPOO/src/main.cpp | JosueCano143/Object-oriented-programming | ab889d4b4eec5db75311d4700d11aacef53d23f9 | [
"MIT"
] | null | null | null | practicaIntegradoraPOO/src/main.cpp | JosueCano143/Object-oriented-programming | ab889d4b4eec5db75311d4700d11aacef53d23f9 | [
"MIT"
] | null | null | null | // Josue Salvador Cano Martinez | A00829022
// Programación orientada a objetos (c++)
// Proyecto integrador: Streaming
// 05 Junio 2020
// Incluir librerías
#include <iostream>
#include <fstream>
using namespace std;
// Incluir clases
#include "Pelicula.h"
#include "Episodio.h"
#include "Serie.h"
#include "Video.h"
// Cargar los datos de los archivos .txt
void cargaDatosVideo(Video *listaVideos[], int &cantVideos) {
// Definir variables
int id, duracion, calificacion, numeroEpisodio, numeroTemporada;
string nombre, genero, tituloSerie, director;
char tipo;
// Abrir archivo
ifstream archivo;
archivo.open("datosVideos.txt");
// Ciclo que itera todos los registros
cantVideos = 0;
while (archivo >> tipo) {
// Determinar si se trata de una película
if (tipo == 'p'){
// Obtener datos de la película
archivo >> id >> nombre >> genero >> duracion >> calificacion >> director;
// Asignar datos de la película
listaVideos[cantVideos++] = new Pelicula(id, nombre, genero, duracion, calificacion, director);
}
else{
// Obtener datos de una serie
archivo >> id >> nombre >> genero >> duracion >> calificacion >> director >> tituloSerie >> numeroEpisodio >> numeroTemporada;
// Asignar datos de la serie
listaVideos[cantVideos++] = new Episodio(id, nombre, genero, duracion, calificacion, director, tituloSerie, numeroEpisodio, numeroTemporada);
}
}
// Cerrar el archivo de lectura
archivo.close();
}
// Cargar los dtos del fichero de series
void cargaDatosSerie(Serie *listaSeries[], int &cantSeries) {
// Definir variables
string nombre;
int id;
// Abrir archivo
ifstream archivo;
archivo.open("datosSeries.txt");
// Iterar todos los registros del fichero
cantSeries = 0;
while (archivo >> id){
// Obtener el nombre de la serie
archivo >> nombre;
// Asignar el nombre de la serie
listaSeries[cantSeries++] = new Serie(nombre);
}
// Cerrar el archivo
archivo.close();
}
// Método que muestra las películas
void muestraPeliculas(Video *listaVideos[], int cantVideos){
// Iterar la lista de videos
for(int i=0; i<cantVideos; i++){
// Seleccionar los videos que sean películas
if(typeid(*listaVideos[i]) == typeid(Pelicula)){
// Imprimir los vídeos (películas) selecionados
listaVideos[i]->imprimir();
}
}
}
// Método que muestra videos con cierta calificación
void muestraVideosCalificacion(Video *listaVideos[], int cantVideos, int cal){
// Iteración de la lista de videos
for(int i=0; i<cantVideos; i++){
// Comparar si la calificación del vídeo coincide con la que ingresa el usuario
if(listaVideos[i]->getCalificacion() == cal){
// Imprimir los vídeos
listaVideos[i]->imprimir();
}
}
}
// Método que muestra los videos con cierto género
void muestraVideosGenero(Video *listaVideos[], int cantVideos, string genero){
int validacion = 0;
// Iteración de la lista de videos
for(int i=0; i<cantVideos; i++){
// Comparar si el género del vídeo coincide con el ingresado por el usuario
if(listaVideos[i]->getGenero() == genero){
// Imprimir el vídeo
listaVideos[i]->imprimir();
validacion += 1;
}
}
// Validación el dato ingresado por el usuario
if(validacion == 0){
cout <<"Error, el genero no existente o fue escrito incorrectamente";
}
}
// Método que imprime las series
void muestraSeries(Serie *listaSeries[], int cantSeries){
// Iteración de la lista de series
for(int i=0; i<cantSeries; i++){
// Impresión del nombre de la serie
listaSeries[i]->imprimir();
}
}
// Método que imprime los episodios de una serie con su respectiva calificación
void episodiosDeSerie(Video *listaVideos[], int cantVideos, string serie){
Episodio *misEpisodios;
int validacion = 0;
// Iteración de la lista de videos
for(int i=0; i<cantVideos; i++){
// Determinar si el video se trata de un episodio
if(typeid(*listaVideos[i]) == typeid(Episodio)){
// Agregar los episodios
misEpisodios = (Episodio *)listaVideos[i];
// Comparar si los títulos son iguales
if(misEpisodios->getTituloSerie() == serie) {
// Obtner el nombre y la calificación de episodio
string name = misEpisodios->getNombre();
int cal = misEpisodios->getCalificacion();
// Imprimir el nombre y la calificación del episodio
cout << name <<" ";
cout << cal << endl;
validacion += 1;
}
}
}
// Validar el dato ingresado por el usuario
if (validacion == 0){
cout << "El nombre de la serie es incorrecto o no existe";
}
}
//Método que muestra las películas con cierta calificación
void muestraPeliculasCalificacion(Video *listaVideos[], int cantVideos, int cal){
// Iterar la lista de videos
for(int i=0; i<cantVideos; i++){
// Determinar si el video es una película y además tiene una calificación igual a la ingresada por el usuario
if(typeid(*listaVideos[i]) == typeid(Pelicula) && listaVideos[i]->getCalificacion() == cal){
// Imprimir los videos
listaVideos[i]->imprimir();
}
}
}
// Método que permite determinar si el usuario conoce al director de cierto video
void evaluaDirector(Video *listaVideos[], int cantVideos, string video, string director){
int validar = 0;
// Iteración de la lista de videos
for(int i=0; i<cantVideos; i++){
// Comparar si el video tiene el nombre que ingresó el usuario
if(listaVideos[i]->getNombre() == video){
validar += 1;
// Obtner el nombre del director del video
string name = listaVideos[i]->getDirector();
// Comparar si coincide la respuesta del usuario con el dato real
if(name == director){
// Mensaje en caso de ser correcto
cout << "Correcto, has acertado";
}
// Mensaje en caso de ser incorrecto
else{
cout << "Incorrecto";
}
}
}
// Validar nombre del video ingresado por el usuario
if(validar == 0){
cout << "Error, video escrito incorrectamente o no existente";
}
}
// Menú de opciones para el usuario
int menu()
{
int iOpcion;
// Impresión de las funciones que existen
cout << "\n1. Cargar ficheros"
<< "\n2. Mostrar lista de peliculas"
<< "\n3. Mostrar lista de series"
<< "\n4. Mostrar videos en general con cierta calificacion"
<< "\n5. Mostrar videos en general con cierto genero"
<< "\n6. Mostrar episodios de una determinada serie con sus calificaciones"
<< "\n7. Mostrar peliculas con cierta calificacion"
<< "\n8. Adivina el director del video"
<< "\n0. Salir"
<< "\nIngrese su opcion: ";
// Tomar la respuesta del usuario
cin >> iOpcion;
// Retornar respuesta del usuario
return iOpcion;
}
// Main
int main()
{
// Apuntadores
Video *listaVideos[50];
int cantVideos;
Serie *listaSeries[50];
int cantSeries;
// Varianles a manejar en el switch-case
int iOpcion;
string genero, serie, director, video;
int cal, id;
// Mandar al menú
iOpcion = menu();
// Permitir usar el programa hasta que el usuario ingrse 0
while (iOpcion != 0)
{
switch (iOpcion)
{
// Cargar los datos del fichero
case 1:
cargaDatosVideo(listaVideos, cantVideos);
cargaDatosSerie(listaSeries, cantSeries);
break;
// Mostrar las películas
case 2:
muestraPeliculas(listaVideos, cantVideos);
break;
// Mostrar las series
case 3:
muestraSeries(listaSeries, cantSeries);
break;
// Mostrar videos con cierta calificación
case 4:
cout << "Ingrese la calificacion (entero entre 1 y 5): ";
cin >> cal;
while(cal<0 or cal>5){
cout << "ERROR, dato fuera de parametros" <<endl;
cout << "Ingrese la calificacion (entero entre 1 y 5): ";
cin >> cal;
}
muestraVideosCalificacion(listaVideos, cantVideos, cal);
break;
// Mostrar los videos de cierto género
case 5:
cout << "Ingrese el genero (sintaxis: Genero | Mi_genero): ";
cin >> genero;
muestraVideosGenero(listaVideos, cantVideos, genero);
break;
// Mostrar episodios de una serie con su calificación
case 6:
cout << "Ingrese la serie (sintaxis: Stranger_things): ";
cin >> serie;
episodiosDeSerie(listaVideos, cantVideos, serie);
break;
// Mostrar películas con cierta calificación
case 7:
cout << "Ingrese la calificacion (entero entre 1 y 5): ";
cin >> cal;
while(cal<0 or cal>5){
cout << "ERROR, dato fuera de parametros" << endl;
cout << "Ingrese la calificacion (entero entre 1 y 5): ";
cin >> cal;
}
muestraPeliculasCalificacion(listaVideos, cantVideos, cal);
break;
// Adivinar el director del video
case 8:
cout << "Ingrese el nombre del video:";
cout << "Nota: primera letra de cada palabra con mayuscula, conectores" <<endl;
cout << "se escriben con minusculas, palabras separadas por guion bajo: ";
cin >> video;
cout << "Ingrese solo el primer nombre del director (en minusculas): ";
cin >> director;
evaluaDirector(listaVideos, cantVideos, video, director);
break;
// En caso de que el usuario ingrse una opción inválida
default:
cout << "Opcion Incorrecta\n";
break;
}
iOpcion = menu();
}
return 0;
} | 35.762542 | 154 | 0.576919 | JosueCano143 |
fac3af94081f53f188a7c5fe1612555223b4e867 | 1,162 | hpp | C++ | fac/ASTs/Exprs/AstExpr_op1.hpp | fa-org/fa | 13bba132b682554beccc25e6d016e04b7b67998f | [
"MIT"
] | 20 | 2021-11-23T23:38:25.000Z | 2022-03-13T04:39:24.000Z | fac/ASTs/Exprs/AstExpr_op1.hpp | fa-org/fa | 13bba132b682554beccc25e6d016e04b7b67998f | [
"MIT"
] | 5 | 2021-11-24T04:48:59.000Z | 2022-01-02T15:27:12.000Z | fac/ASTs/Exprs/AstExpr_op1.hpp | fa-org/fa | 13bba132b682554beccc25e6d016e04b7b67998f | [
"MIT"
] | 10 | 2021-11-24T03:36:12.000Z | 2022-03-06T19:13:10.000Z | #ifndef __AST_EXPR_OP1_HPP__
#define __AST_EXPR_OP1_HPP__
#include <memory>
#include <string>
#include "IAstExpr.hpp"
struct AstExpr_op1: public IAstExpr {
PAstExpr m_base;
std::string m_op;
bool m_prefix;
AstExpr_op1 (antlr4::Token *_token, PAstExpr _base, std::string _op, bool _prefix):
IAstExpr (_token), m_base (_base), m_op (_op), m_prefix (_prefix) {}
void GetChildTypes (std::function<void (PAstType &)> _cb) override {}
void GetChildExprs (std::function<void (PAstExpr &)> _cb) override { _cb (m_base); }
void GetChildStmts (std::function<void (PAstStmt &)> _cb) override {}
PAstType GuessType () override { throw NOT_IMPLEMENT (); }
void ProcessCode (PAstType _type) override { throw NOT_IMPLEMENT (); }
std::string GenCppCode (size_t _indent) override {
if (m_prefix) {
return std::format ("{}{}", m_op, m_base->GenCppCode (_indent));
} else {
return std::format ("{}{}", m_base->GenCppCode (_indent), m_op);
}
}
static PAstExpr Make (antlr4::Token *_token, PAstExpr _base, std::string _op, bool _prefix) {
return new AstExpr_op1 { _token, _base, _op, _prefix };
}
};
#endif //__AST_EXPR_OP1_HPP__
| 21.924528 | 94 | 0.697935 | fa-org |
fad2f63dbe5ad48db907a1fbea67f15365082e58 | 2,587 | cpp | C++ | src/baseClasses/vrposrm.cpp | woodbri/vehicle-routing-problems | aae24d92f46a6b1d473ad8f4ec6db9c96742b708 | [
"MIT"
] | 16 | 2015-06-26T22:53:20.000Z | 2021-03-09T22:54:33.000Z | src/baseClasses/vrposrm.cpp | woodbri/vehicle-routing-problems | aae24d92f46a6b1d473ad8f4ec6db9c96742b708 | [
"MIT"
] | 21 | 2015-01-29T14:16:19.000Z | 2016-03-27T00:09:50.000Z | src/baseClasses/vrposrm.cpp | woodbri/vehicle-routing-problems | aae24d92f46a6b1d473ad8f4ec6db9c96742b708 | [
"MIT"
] | 10 | 2015-07-18T02:48:35.000Z | 2019-12-25T11:04:17.000Z | /*VRP*********************************************************************
*
* vehicle routing problems
* A collection of C++ classes for developing VRP solutions
* and specific solutions developed using these classes.
*
* Copyright 2014 Stephen Woodbridge <[email protected]>
* Copyright 2014 Vicky Vergara <[email protected]>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the MIT License. Please file LICENSE for details.
*
********************************************************************VRP*/
#include <iostream>
#include <sstream>
#include <string>
#include "logger.h"
#include "vrposrm.h"
bool VrpOSRM::getTravelTime( double &ttime ) const {
rapidjson::Document jsondoc;
jsondoc.Parse( json.c_str() );
if ( jsondoc.HasParseError() ) {
DLOG( INFO ) << "Error: Invalid json document in OSRM response!";
return true;
}
if ( not jsondoc.HasMember( "route_summary" ) ) {
DLOG( INFO ) << "Error: Failed to find 'route_summary' key in json document!";
return true;
}
if ( not jsondoc["route_summary"].HasMember( "total_time" ) ) {
DLOG( INFO ) << "Error: Failed to find 'total_time' key in json document!";
return true;
}
ttime = jsondoc["route_summary"]["total_time"].GetDouble() / 60.0;
return false;
}
bool VrpOSRM::getStatus( int &status ) const {
status = -1;
if ( json.size() == 0 ) {
DLOG( INFO ) << "Null json document in OSRM response!";
return true;
}
rapidjson::Document jsondoc;
jsondoc.Parse( json.c_str() );
if ( jsondoc.HasParseError() ) {
DLOG( INFO ) << "Error: Invalid json document in OSRM response!";
return true;
}
if ( not jsondoc.HasMember( "status" ) ) {
DLOG( INFO ) << "Error: Failed to find 'status' key in json document!";
return true;
}
status = jsondoc["status"].GetInt();
return false;
}
bool VrpOSRM::callOSRM( const std::string url ) {
std::stringstream result;
//DLOG(INFO) << "callOSRM: url: " << url;
try {
curlpp::Easy request;
request.setOpt( new cURLpp::Options::Url( url ) );
request.setOpt( new cURLpp::Options::WriteStream( &result ) );
request.perform();
json = result.str();
}
catch ( curlpp::LogicError &e ) {
DLOG( WARNING ) << e.what();
return true;
}
catch ( curlpp::RuntimeError &e ) {
DLOG( WARNING ) << e.what();
return true;
}
return false;
}
| 24.875 | 86 | 0.571318 | woodbri |
fad36d15b11d2511c2204fcc4605acc92a5a6b01 | 348 | cpp | C++ | example/example.cpp | ediston/BigNumberCalculator-Cpp | 0d66daba5488e271d42cbb089aeec419ae95eba2 | [
"Unlicense"
] | null | null | null | example/example.cpp | ediston/BigNumberCalculator-Cpp | 0d66daba5488e271d42cbb089aeec419ae95eba2 | [
"Unlicense"
] | null | null | null | example/example.cpp | ediston/BigNumberCalculator-Cpp | 0d66daba5488e271d42cbb089aeec419ae95eba2 | [
"Unlicense"
] | null | null | null | #include "../header/BigNumberCalculator.h"
int main() {
//Add
cout << "Addition: " << add("19", "-22") << endl;
//Subtract
cout << "Subtract: " << subtract("122", "119") << endl;
// Multiply
cout << "Multiply: " << multiply("98", "-13") << endl;
//103!
cout << "Factorial: "<< fact(103) << endl;
return 0;
}
| 24.857143 | 60 | 0.5 | ediston |
fad7a374495c9e62db142a538efd9ef4cb264647 | 8,964 | hpp | C++ | motion/src/objectdetector.hpp | yoosamui/secam | c709b106227e2c57105bc9013b4d622c87f099db | [
"MIT"
] | null | null | null | motion/src/objectdetector.hpp | yoosamui/secam | c709b106227e2c57105bc9013b4d622c87f099db | [
"MIT"
] | 1 | 2022-02-11T11:41:21.000Z | 2022-02-11T11:41:21.000Z | motion/src/objectdetector.hpp | yoosamui/secam | c709b106227e2c57105bc9013b4d622c87f099db | [
"MIT"
] | null | null | null | //
// https://github.com/doleron/yolov5-opencv-cpp-python
// https://github.com/doleron/yolov5-opencv-cpp-python.git
//
#pragma once
#include <opencv2/dnn.hpp>
#include <queue>
#include "common.h"
#include "config.h"
#include "constants.h"
#include "ofMain.h"
#include "ofThread.h"
#include "ofxCv.h"
#include "ofxOpenCv.h"
#include "opencv2/imgcodecs.hpp"
#include "videowriter.hpp"
using namespace ofxCv;
using namespace cv;
using namespace std;
using namespace dnn;
class Objectdetector : public ofThread
{
const uint16_t QUEUE_MAX_SIZE = 5;
const float INPUT_WIDTH = 640.0;
const float INPUT_HEIGHT = 640.0;
const float SCORE_THRESHOLD = 0.2;
const float NMS_THRESHOLD = 0.4;
const float CONFIDENCE_THRESHOLD = 0.5;
const string m_title = "PERSON_";
struct Detection {
int class_id;
float confidence;
Rect box;
};
// clang-format off
map<string, Scalar> color_map = {
{"person", Scalar(0, 255, 255)},
{"motorbike", Scalar(255, 255, 0)},
{"car", Scalar(0, 255, 0)}
};
// clang-format on
public:
ofEvent<int> on_finish_detections;
Objectdetector()
{
ifstream ifs("data/classes.txt");
string line;
while (getline(ifs, line)) {
m_classes.push_back(line);
}
auto result = dnn::readNet("data/yolov5s.onnx");
if (m_is_cuda) {
result.setPreferableBackend(dnn::DNN_BACKEND_CUDA);
result.setPreferableTarget(dnn::DNN_TARGET_CUDA_FP16);
} else {
result.setPreferableBackend(dnn::DNN_BACKEND_OPENCV);
result.setPreferableTarget(dnn::DNN_TARGET_CPU);
}
m_net = result;
}
void add(const Mat &img, const Rect &r)
{
if (m_frames.size() >= 12 || ++m_frame_number % 3 || img.empty() || m_lock) {
return;
}
common::log("Add probe frame = " + to_string(r.width) + " x " + to_string(r.height));
Mat frame;
img.copyTo(frame);
common::bgr2rgb(frame);
m_frames.push_back(frame);
// string filename = m_writer.get_filepath("probe", ".jpg", 1);
// imwrite(filename, frame);
}
void detect()
{
m_processing = true;
if (m_frames.size()) {
m_lock = true;
common::log("Detected frames count :" + to_string(m_frames.size()));
}
int i = 0;
for (auto &frame : m_frames) {
if (m_detected) break;
common::log("Add probe to queue :" + to_string(i));
m_queue.push(frame.clone());
frame.release();
i++;
}
reset();
}
void start()
{
reset();
m_filename = m_writer.get_filepath("PERSON_" + m_config.parameters.camname, ".jpg", 1);
}
bool detected()
{
//
return m_detected;
}
private:
Videowriter m_writer;
Config &m_config = m_config.getInstance();
vector<Mat> m_frames;
vector<string> m_classes;
int m_frame_number = 1;
bool m_is_cuda = false;
bool m_processing = false;
bool m_lock = false;
bool m_detected = false;
dnn::Net m_net;
Rect m_detection_rect;
string m_filename;
string m_destination_dir;
string m_file;
string m_time_zone = m_config.settings.timezone;
queue<Mat> m_queue;
void reset()
{
m_frames.clear();
m_lock = false;
m_detected = false;
}
Scalar get_color(const string &name)
{
if (color_map.count(name) == 0) return Scalar(255, 255, 255);
return color_map[name];
}
// override
void threadedFunction()
{
vector<Detection> output;
int count;
while (isThreadRunning()) {
count = 0;
while (!m_queue.empty() && m_processing) {
common::log("Start detection => " + to_string(count));
output.clear();
Mat frame = m_queue.front();
m_detected = detect(frame.clone(), output);
m_queue.pop();
count++;
if (m_detected) {
while (!m_queue.empty()) {
m_queue.pop();
}
common::log("!!!Person detected!!!");
break;
}
}
if (m_processing) {
ofNotifyEvent(on_finish_detections, count, this);
m_processing = false;
m_lock = false;
}
ofSleepMillis(10);
}
}
template <typename T>
string tostr(const T &t, int precision = 2)
{
ostringstream ss;
ss << fixed << setprecision(precision) << t;
return ss.str();
}
Mat format_yolov5(const Mat &source)
{
int col = source.cols;
int row = source.rows;
int _max = max(col, row);
Mat result = Mat::zeros(_max, _max, CV_8UC3);
source.copyTo(result(Rect(0, 0, col, row)));
return result;
}
int detect(Mat frame, vector<Detection> &output)
{
Mat blob;
auto input_image = format_yolov5(frame);
dnn::blobFromImage(input_image, blob, 1. / 255., cv::Size(INPUT_WIDTH, INPUT_HEIGHT),
Scalar(), true, false);
m_net.setInput(blob);
vector<Mat> outputs;
m_net.forward(outputs, m_net.getUnconnectedOutLayersNames());
float x_factor = input_image.cols / INPUT_WIDTH;
float y_factor = input_image.rows / INPUT_HEIGHT;
float *data = (float *)outputs[0].data;
const int rows = 25200;
vector<int> class_ids;
vector<float> confidences;
vector<Rect> boxes;
for (int i = 0; i < rows; ++i) {
float confidence = data[4];
if (confidence >= CONFIDENCE_THRESHOLD) {
float *classes_scores = data + 5;
Mat scores(1, m_classes.size(), CV_32FC1, classes_scores);
Point class_id;
double max_class_score;
minMaxLoc(scores, 0, &max_class_score, 0, &class_id);
if (max_class_score > SCORE_THRESHOLD) {
confidences.push_back(confidence);
class_ids.push_back(class_id.x);
float x = data[0];
float y = data[1];
float w = data[2];
float h = data[3];
int left = int((x - 0.5 * w) * x_factor);
int top = int((y - 0.5 * h) * y_factor);
int width = int(w * x_factor);
int height = int(h * y_factor);
boxes.push_back(Rect(left, top, width, height));
}
}
data += 85;
}
vector<int> nms_result;
dnn::NMSBoxes(boxes, confidences, SCORE_THRESHOLD, NMS_THRESHOLD, nms_result);
for (size_t i = 0; i < nms_result.size(); i++) {
int idx = nms_result[i];
Detection result;
result.class_id = class_ids[idx];
result.confidence = confidences[idx];
result.box = boxes[idx];
output.push_back(result);
}
return draw(frame, output) != 0;
}
bool draw(const Mat &frame, vector<Detection> &output)
{
int detections = output.size();
if (!detections) return false;
Mat input;
frame.copyTo(input);
bool found = false;
for (int c = 0; c < detections; ++c) {
auto detection = output[c];
auto box = detection.box;
auto classId = detection.class_id;
auto color = get_color(m_classes[classId]);
if (!found) found = m_classes[classId] == "person";
Rect r = inflate(box, 20, input);
rectangle(input, r, color, 2);
rectangle(input, Point(r.x - 1, r.y - 20), cv::Point(r.x + r.width, r.y), color,
FILLED);
float fscale = 0.4;
int thickness = 1;
string title = m_classes[classId];
putText(input, title, Point(r.x + 2, r.y - 5), cv::FONT_HERSHEY_SIMPLEX, fscale,
Scalar(0, 0, 0), thickness, LINE_AA, false);
}
if (found) imwrite(m_filename, input);
return found;
}
Rect inflate(const Rect &rect, size_t size, const Mat &frame)
{
Rect r = rect;
r.x -= size;
if (r.x < 0) r.x = 0;
r.y -= size;
if (r.y < 0) r.y = 0;
r.width += size * 2;
if (r.x + r.width > frame.cols) {
r.x -= (r.x + r.width) - frame.cols;
}
r.height += size * 2;
if (r.y + r.height > frame.rows) {
r.y -= (r.y + r.height) - frame.rows;
}
return r;
}
};
| 25.109244 | 95 | 0.522311 | yoosamui |
fad82ddf69f224ff85fc9c42b44cbda8d8430dcf | 322,286 | cpp | C++ | Temp/il2cppOutput/il2cppOutput/Il2CppCompilerCalculateTypeValues_32Table.cpp | bhuwanY-Hexaware/MapBox_ARKit | 64edeb918b61c8d250ac8273253a065181de6c18 | [
"Apache-2.0"
] | null | null | null | Temp/il2cppOutput/il2cppOutput/Il2CppCompilerCalculateTypeValues_32Table.cpp | bhuwanY-Hexaware/MapBox_ARKit | 64edeb918b61c8d250ac8273253a065181de6c18 | [
"Apache-2.0"
] | null | null | null | Temp/il2cppOutput/il2cppOutput/Il2CppCompilerCalculateTypeValues_32Table.cpp | bhuwanY-Hexaware/MapBox_ARKit | 64edeb918b61c8d250ac8273253a065181de6c18 | [
"Apache-2.0"
] | null | null | null | #include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <cstring>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <limits>
#include <assert.h>
#include <stdint.h>
#include "il2cpp-class-internals.h"
#include "codegen/il2cpp-codegen.h"
#include "il2cpp-object-internals.h"
// System.Collections.Generic.Dictionary`2<System.Int32,System.String>
struct Dictionary_2_t736164020;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima
struct LocalMinima_t86068969;
// System.Collections.Generic.List`1<System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge>>
struct List_1_t343237081;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Scanbeam
struct Scanbeam_t3952834741;
// System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec>
struct List_1_t1788952413;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge
struct TEdge_t1694054893;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt
struct OutPt_t2591102706;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode
struct PolyNode_t1300984468;
// Mapbox.VectorTile.VectorTileReader
struct VectorTileReader_t1753322980;
// System.IntPtr[]
struct IntPtrU5BU5D_t4013366056;
// System.String
struct String_t;
// System.Collections.IDictionary
struct IDictionary_t1363984059;
// Mapbox.Examples.ReloadMap
struct ReloadMap_t3484436943;
// System.Collections.Generic.List`1<Mapbox.Examples.Voxels.VoxelData>
struct List_1_t3720956926;
// Mapbox.Examples.Voxels.VoxelTile
struct VoxelTile_t1944340880;
// UnityEngine.Color[]
struct ColorU5BU5D_t941916413;
// System.Threading.Mutex
struct Mutex_t3066672582;
// System.Collections.Generic.Dictionary`2<System.String,System.Byte[]>
struct Dictionary_2_t3901903956;
// System.Func`2<System.UInt32,System.Int32>
struct Func_2_t2244831341;
// System.Func`3<System.Int32,System.Int32,System.Boolean>
struct Func_3_t491204050;
// System.Byte[]
struct ByteU5BU5D_t4116647657;
// System.Collections.Generic.List`1<System.Byte[]>
struct List_1_t1293755103;
// System.Collections.Generic.List`1<System.Object>
struct List_1_t257213610;
// System.Collections.Generic.List`1<System.String>
struct List_1_t3319525431;
// Mapbox.Json.JsonConverter[]
struct JsonConverterU5BU5D_t1616679288;
// Mapbox.VectorTile.VectorTileFeature
struct VectorTileFeature_t4093669591;
// System.Func`2<System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.LatLng>,System.Collections.Generic.IEnumerable`1<Mapbox.VectorTile.Geometry.LatLng>>
struct Func_2_t1001585409;
// System.Func`2<Mapbox.VectorTile.Geometry.LatLng,System.String>
struct Func_2_t3663939823;
// System.Char[]
struct CharU5BU5D_t3528271667;
// System.Void
struct Void_t1185182177;
// UnityEngine.GameObject
struct GameObject_t1113636619;
// System.Collections.Generic.List`1<System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint>>
struct List_1_t976755323;
// System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint>
struct List_1_t3799647877;
// System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/DoublePoint>
struct List_1_t3080002113;
// System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode>
struct List_1_t2773059210;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Maxima
struct Maxima_t4278896992;
// System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntersectNode>
struct List_1_t556621665;
// System.Collections.Generic.IComparer`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntersectNode>
struct IComparer_1_t338812402;
// System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Join>
struct List_1_t3821086104;
// Mapbox.VectorTile.VectorTileLayer
struct VectorTileLayer_t873169949;
// System.Collections.Generic.List`1<System.UInt32>
struct List_1_t4032136720;
// System.Collections.Generic.List`1<System.Int32>
struct List_1_t128053199;
// UnityEngine.Transform
struct Transform_t3600365921;
// Mapbox.Unity.Location.ILocationProvider
struct ILocationProvider_t2513726273;
// UnityEngine.UI.InputField
struct InputField_t3762917431;
// Mapbox.Geocoding.ReverseGeocodeResource
struct ReverseGeocodeResource_t2777886177;
// Mapbox.Geocoding.Geocoder
struct Geocoder_t3195298050;
// Mapbox.Geocoding.ReverseGeocodeResponse
struct ReverseGeocodeResponse_t3723437562;
// System.EventHandler`1<System.EventArgs>
struct EventHandler_1_t1515976428;
// UnityEngine.Camera
struct Camera_t4157153871;
// Mapbox.Unity.Map.AbstractMap
struct AbstractMap_t3082917158;
// Mapbox.Examples.ForwardGeocodeUserInput
struct ForwardGeocodeUserInput_t2575136032;
// UnityEngine.UI.Slider
struct Slider_t3903728902;
// UnityEngine.Coroutine
struct Coroutine_t3829159415;
// UnityEngine.WaitForSeconds
struct WaitForSeconds_t1699091251;
// UnityEngine.UI.Text
struct Text_t1901882714;
// Mapbox.Map.Map`1<Mapbox.Map.VectorTile>
struct Map_1_t3054239837;
// Mapbox.Examples.ReverseGeocodeUserInput
struct ReverseGeocodeUserInput_t2632079094;
// UnityEngine.UI.Dropdown
struct Dropdown_t2274391225;
// UnityEngine.UI.RawImage
struct RawImage_t3182918964;
// Mapbox.Map.Map`1<Mapbox.Map.RasterTile>
struct Map_1_t1665010825;
// System.String[]
struct StringU5BU5D_t1281789340;
// Mapbox.Directions.Directions
struct Directions_t1397515081;
// Mapbox.Utils.Vector2d[]
struct Vector2dU5BU5D_t852968953;
// Mapbox.Directions.DirectionResource
struct DirectionResource_t3837219169;
// UnityEngine.LineRenderer
struct LineRenderer_t3154350270;
// System.Collections.Generic.List`1<Mapbox.Unity.Location.Location>
struct List_1_t3502158253;
// Mapbox.MapMatching.MapMatcher
struct MapMatcher_t3570695288;
// Mapbox.Examples.Voxels.VoxelColorMapper[]
struct VoxelColorMapperU5BU5D_t1422690960;
// Mapbox.Examples.Voxels.VoxelFetcher
struct VoxelFetcher_t3713644963;
// Mapbox.Map.Map`1<Mapbox.Map.RawPngRasterTile>
struct Map_1_t1070764774;
// UnityEngine.Texture2D
struct Texture2D_t3840446185;
// Mapbox.Platform.IFileSource
struct IFileSource_t3859839141;
// System.Collections.Generic.List`1<UnityEngine.GameObject>
struct List_1_t2585711361;
// Mapbox.Unity.MeshGeneration.Factories.FlatSphereTerrainFactory
struct FlatSphereTerrainFactory_t1099794750;
// UnityEngine.AnimationCurve
struct AnimationCurve_t3046754366;
// UnityEngine.RectTransform
struct RectTransform_t3704657025;
// System.Collections.Generic.Dictionary`2<UnityEngine.GameObject,Mapbox.Examples.FeatureSelectionDetector>
struct Dictionary_2_t2340548174;
// Mapbox.Examples.FeatureUiMarker
struct FeatureUiMarker_t3847499068;
// Mapbox.Examples.FeatureSelectionDetector
struct FeatureSelectionDetector_t508482069;
// System.Collections.Generic.Dictionary`2<System.String,System.Object>
struct Dictionary_2_t2865362463;
// Mapbox.Unity.Map.QuadTreeTileProvider
struct QuadTreeTileProvider_t3777865694;
// UnityEngine.TextMesh
struct TextMesh_t1536577757;
// VectorEntity
struct VectorEntity_t1410759464;
// UnityEngine.Vector3[]
struct Vector3U5BU5D_t1718750761;
// System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Object>,System.String>
struct Func_2_t268983481;
// Mapbox.Geocoding.ForwardGeocodeResource
struct ForwardGeocodeResource_t367023433;
// Mapbox.Geocoding.ForwardGeocodeResponse
struct ForwardGeocodeResponse_t2959476828;
// System.Action`1<Mapbox.Geocoding.ForwardGeocodeResponse>
struct Action_1_t3131944423;
// UnityEngine.Material
struct Material_t340375123;
// System.Collections.Generic.List`1<UnityEngine.Material>
struct List_1_t1812449865;
// UnityEngine.MeshRenderer
struct MeshRenderer_t587009260;
#ifndef RUNTIMEOBJECT_H
#define RUNTIMEOBJECT_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Object
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // RUNTIMEOBJECT_H
#ifndef COMPRESSION_T3624971113_H
#define COMPRESSION_T3624971113_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Utils.Compression
struct Compression_t3624971113 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // COMPRESSION_T3624971113_H
#ifndef CONSTANTSASDICTIONARY_T107503724_H
#define CONSTANTSASDICTIONARY_T107503724_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Contants.ConstantsAsDictionary
struct ConstantsAsDictionary_t107503724 : public RuntimeObject
{
public:
public:
};
struct ConstantsAsDictionary_t107503724_StaticFields
{
public:
// System.Collections.Generic.Dictionary`2<System.Int32,System.String> Mapbox.VectorTile.Contants.ConstantsAsDictionary::TileType
Dictionary_2_t736164020 * ___TileType_0;
// System.Collections.Generic.Dictionary`2<System.Int32,System.String> Mapbox.VectorTile.Contants.ConstantsAsDictionary::LayerType
Dictionary_2_t736164020 * ___LayerType_1;
// System.Collections.Generic.Dictionary`2<System.Int32,System.String> Mapbox.VectorTile.Contants.ConstantsAsDictionary::FeatureType
Dictionary_2_t736164020 * ___FeatureType_2;
// System.Collections.Generic.Dictionary`2<System.Int32,System.String> Mapbox.VectorTile.Contants.ConstantsAsDictionary::GeomType
Dictionary_2_t736164020 * ___GeomType_3;
public:
inline static int32_t get_offset_of_TileType_0() { return static_cast<int32_t>(offsetof(ConstantsAsDictionary_t107503724_StaticFields, ___TileType_0)); }
inline Dictionary_2_t736164020 * get_TileType_0() const { return ___TileType_0; }
inline Dictionary_2_t736164020 ** get_address_of_TileType_0() { return &___TileType_0; }
inline void set_TileType_0(Dictionary_2_t736164020 * value)
{
___TileType_0 = value;
Il2CppCodeGenWriteBarrier((&___TileType_0), value);
}
inline static int32_t get_offset_of_LayerType_1() { return static_cast<int32_t>(offsetof(ConstantsAsDictionary_t107503724_StaticFields, ___LayerType_1)); }
inline Dictionary_2_t736164020 * get_LayerType_1() const { return ___LayerType_1; }
inline Dictionary_2_t736164020 ** get_address_of_LayerType_1() { return &___LayerType_1; }
inline void set_LayerType_1(Dictionary_2_t736164020 * value)
{
___LayerType_1 = value;
Il2CppCodeGenWriteBarrier((&___LayerType_1), value);
}
inline static int32_t get_offset_of_FeatureType_2() { return static_cast<int32_t>(offsetof(ConstantsAsDictionary_t107503724_StaticFields, ___FeatureType_2)); }
inline Dictionary_2_t736164020 * get_FeatureType_2() const { return ___FeatureType_2; }
inline Dictionary_2_t736164020 ** get_address_of_FeatureType_2() { return &___FeatureType_2; }
inline void set_FeatureType_2(Dictionary_2_t736164020 * value)
{
___FeatureType_2 = value;
Il2CppCodeGenWriteBarrier((&___FeatureType_2), value);
}
inline static int32_t get_offset_of_GeomType_3() { return static_cast<int32_t>(offsetof(ConstantsAsDictionary_t107503724_StaticFields, ___GeomType_3)); }
inline Dictionary_2_t736164020 * get_GeomType_3() const { return ___GeomType_3; }
inline Dictionary_2_t736164020 ** get_address_of_GeomType_3() { return &___GeomType_3; }
inline void set_GeomType_3(Dictionary_2_t736164020 * value)
{
___GeomType_3 = value;
Il2CppCodeGenWriteBarrier((&___GeomType_3), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CONSTANTSASDICTIONARY_T107503724_H
#ifndef UTILGEOM_T2066125609_H
#define UTILGEOM_T2066125609_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.UtilGeom
struct UtilGeom_t2066125609 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // UTILGEOM_T2066125609_H
#ifndef DECODEGEOMETRY_T3735437420_H
#define DECODEGEOMETRY_T3735437420_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.DecodeGeometry
struct DecodeGeometry_t3735437420 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DECODEGEOMETRY_T3735437420_H
#ifndef CLIPPERBASE_T2411222589_H
#define CLIPPERBASE_T2411222589_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase
struct ClipperBase_t2411222589 : public RuntimeObject
{
public:
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::m_MinimaList
LocalMinima_t86068969 * ___m_MinimaList_6;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::m_CurrentLM
LocalMinima_t86068969 * ___m_CurrentLM_7;
// System.Collections.Generic.List`1<System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge>> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::m_edges
List_1_t343237081 * ___m_edges_8;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Scanbeam Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::m_Scanbeam
Scanbeam_t3952834741 * ___m_Scanbeam_9;
// System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::m_PolyOuts
List_1_t1788952413 * ___m_PolyOuts_10;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::m_ActiveEdges
TEdge_t1694054893 * ___m_ActiveEdges_11;
// System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::m_UseFullRange
bool ___m_UseFullRange_12;
// System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::m_HasOpenPaths
bool ___m_HasOpenPaths_13;
// System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperBase::<PreserveCollinear>k__BackingField
bool ___U3CPreserveCollinearU3Ek__BackingField_14;
public:
inline static int32_t get_offset_of_m_MinimaList_6() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___m_MinimaList_6)); }
inline LocalMinima_t86068969 * get_m_MinimaList_6() const { return ___m_MinimaList_6; }
inline LocalMinima_t86068969 ** get_address_of_m_MinimaList_6() { return &___m_MinimaList_6; }
inline void set_m_MinimaList_6(LocalMinima_t86068969 * value)
{
___m_MinimaList_6 = value;
Il2CppCodeGenWriteBarrier((&___m_MinimaList_6), value);
}
inline static int32_t get_offset_of_m_CurrentLM_7() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___m_CurrentLM_7)); }
inline LocalMinima_t86068969 * get_m_CurrentLM_7() const { return ___m_CurrentLM_7; }
inline LocalMinima_t86068969 ** get_address_of_m_CurrentLM_7() { return &___m_CurrentLM_7; }
inline void set_m_CurrentLM_7(LocalMinima_t86068969 * value)
{
___m_CurrentLM_7 = value;
Il2CppCodeGenWriteBarrier((&___m_CurrentLM_7), value);
}
inline static int32_t get_offset_of_m_edges_8() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___m_edges_8)); }
inline List_1_t343237081 * get_m_edges_8() const { return ___m_edges_8; }
inline List_1_t343237081 ** get_address_of_m_edges_8() { return &___m_edges_8; }
inline void set_m_edges_8(List_1_t343237081 * value)
{
___m_edges_8 = value;
Il2CppCodeGenWriteBarrier((&___m_edges_8), value);
}
inline static int32_t get_offset_of_m_Scanbeam_9() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___m_Scanbeam_9)); }
inline Scanbeam_t3952834741 * get_m_Scanbeam_9() const { return ___m_Scanbeam_9; }
inline Scanbeam_t3952834741 ** get_address_of_m_Scanbeam_9() { return &___m_Scanbeam_9; }
inline void set_m_Scanbeam_9(Scanbeam_t3952834741 * value)
{
___m_Scanbeam_9 = value;
Il2CppCodeGenWriteBarrier((&___m_Scanbeam_9), value);
}
inline static int32_t get_offset_of_m_PolyOuts_10() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___m_PolyOuts_10)); }
inline List_1_t1788952413 * get_m_PolyOuts_10() const { return ___m_PolyOuts_10; }
inline List_1_t1788952413 ** get_address_of_m_PolyOuts_10() { return &___m_PolyOuts_10; }
inline void set_m_PolyOuts_10(List_1_t1788952413 * value)
{
___m_PolyOuts_10 = value;
Il2CppCodeGenWriteBarrier((&___m_PolyOuts_10), value);
}
inline static int32_t get_offset_of_m_ActiveEdges_11() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___m_ActiveEdges_11)); }
inline TEdge_t1694054893 * get_m_ActiveEdges_11() const { return ___m_ActiveEdges_11; }
inline TEdge_t1694054893 ** get_address_of_m_ActiveEdges_11() { return &___m_ActiveEdges_11; }
inline void set_m_ActiveEdges_11(TEdge_t1694054893 * value)
{
___m_ActiveEdges_11 = value;
Il2CppCodeGenWriteBarrier((&___m_ActiveEdges_11), value);
}
inline static int32_t get_offset_of_m_UseFullRange_12() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___m_UseFullRange_12)); }
inline bool get_m_UseFullRange_12() const { return ___m_UseFullRange_12; }
inline bool* get_address_of_m_UseFullRange_12() { return &___m_UseFullRange_12; }
inline void set_m_UseFullRange_12(bool value)
{
___m_UseFullRange_12 = value;
}
inline static int32_t get_offset_of_m_HasOpenPaths_13() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___m_HasOpenPaths_13)); }
inline bool get_m_HasOpenPaths_13() const { return ___m_HasOpenPaths_13; }
inline bool* get_address_of_m_HasOpenPaths_13() { return &___m_HasOpenPaths_13; }
inline void set_m_HasOpenPaths_13(bool value)
{
___m_HasOpenPaths_13 = value;
}
inline static int32_t get_offset_of_U3CPreserveCollinearU3Ek__BackingField_14() { return static_cast<int32_t>(offsetof(ClipperBase_t2411222589, ___U3CPreserveCollinearU3Ek__BackingField_14)); }
inline bool get_U3CPreserveCollinearU3Ek__BackingField_14() const { return ___U3CPreserveCollinearU3Ek__BackingField_14; }
inline bool* get_address_of_U3CPreserveCollinearU3Ek__BackingField_14() { return &___U3CPreserveCollinearU3Ek__BackingField_14; }
inline void set_U3CPreserveCollinearU3Ek__BackingField_14(bool value)
{
___U3CPreserveCollinearU3Ek__BackingField_14 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CLIPPERBASE_T2411222589_H
#ifndef OUTREC_T316877671_H
#define OUTREC_T316877671_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec
struct OutRec_t316877671 : public RuntimeObject
{
public:
// System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec::Idx
int32_t ___Idx_0;
// System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec::IsHole
bool ___IsHole_1;
// System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec::IsOpen
bool ___IsOpen_2;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec::FirstLeft
OutRec_t316877671 * ___FirstLeft_3;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec::Pts
OutPt_t2591102706 * ___Pts_4;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec::BottomPt
OutPt_t2591102706 * ___BottomPt_5;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutRec::PolyNode
PolyNode_t1300984468 * ___PolyNode_6;
public:
inline static int32_t get_offset_of_Idx_0() { return static_cast<int32_t>(offsetof(OutRec_t316877671, ___Idx_0)); }
inline int32_t get_Idx_0() const { return ___Idx_0; }
inline int32_t* get_address_of_Idx_0() { return &___Idx_0; }
inline void set_Idx_0(int32_t value)
{
___Idx_0 = value;
}
inline static int32_t get_offset_of_IsHole_1() { return static_cast<int32_t>(offsetof(OutRec_t316877671, ___IsHole_1)); }
inline bool get_IsHole_1() const { return ___IsHole_1; }
inline bool* get_address_of_IsHole_1() { return &___IsHole_1; }
inline void set_IsHole_1(bool value)
{
___IsHole_1 = value;
}
inline static int32_t get_offset_of_IsOpen_2() { return static_cast<int32_t>(offsetof(OutRec_t316877671, ___IsOpen_2)); }
inline bool get_IsOpen_2() const { return ___IsOpen_2; }
inline bool* get_address_of_IsOpen_2() { return &___IsOpen_2; }
inline void set_IsOpen_2(bool value)
{
___IsOpen_2 = value;
}
inline static int32_t get_offset_of_FirstLeft_3() { return static_cast<int32_t>(offsetof(OutRec_t316877671, ___FirstLeft_3)); }
inline OutRec_t316877671 * get_FirstLeft_3() const { return ___FirstLeft_3; }
inline OutRec_t316877671 ** get_address_of_FirstLeft_3() { return &___FirstLeft_3; }
inline void set_FirstLeft_3(OutRec_t316877671 * value)
{
___FirstLeft_3 = value;
Il2CppCodeGenWriteBarrier((&___FirstLeft_3), value);
}
inline static int32_t get_offset_of_Pts_4() { return static_cast<int32_t>(offsetof(OutRec_t316877671, ___Pts_4)); }
inline OutPt_t2591102706 * get_Pts_4() const { return ___Pts_4; }
inline OutPt_t2591102706 ** get_address_of_Pts_4() { return &___Pts_4; }
inline void set_Pts_4(OutPt_t2591102706 * value)
{
___Pts_4 = value;
Il2CppCodeGenWriteBarrier((&___Pts_4), value);
}
inline static int32_t get_offset_of_BottomPt_5() { return static_cast<int32_t>(offsetof(OutRec_t316877671, ___BottomPt_5)); }
inline OutPt_t2591102706 * get_BottomPt_5() const { return ___BottomPt_5; }
inline OutPt_t2591102706 ** get_address_of_BottomPt_5() { return &___BottomPt_5; }
inline void set_BottomPt_5(OutPt_t2591102706 * value)
{
___BottomPt_5 = value;
Il2CppCodeGenWriteBarrier((&___BottomPt_5), value);
}
inline static int32_t get_offset_of_PolyNode_6() { return static_cast<int32_t>(offsetof(OutRec_t316877671, ___PolyNode_6)); }
inline PolyNode_t1300984468 * get_PolyNode_6() const { return ___PolyNode_6; }
inline PolyNode_t1300984468 ** get_address_of_PolyNode_6() { return &___PolyNode_6; }
inline void set_PolyNode_6(PolyNode_t1300984468 * value)
{
___PolyNode_6 = value;
Il2CppCodeGenWriteBarrier((&___PolyNode_6), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // OUTREC_T316877671_H
#ifndef MAXIMA_T4278896992_H
#define MAXIMA_T4278896992_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Maxima
struct Maxima_t4278896992 : public RuntimeObject
{
public:
// System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Maxima::X
int64_t ___X_0;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Maxima Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Maxima::Next
Maxima_t4278896992 * ___Next_1;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Maxima Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Maxima::Prev
Maxima_t4278896992 * ___Prev_2;
public:
inline static int32_t get_offset_of_X_0() { return static_cast<int32_t>(offsetof(Maxima_t4278896992, ___X_0)); }
inline int64_t get_X_0() const { return ___X_0; }
inline int64_t* get_address_of_X_0() { return &___X_0; }
inline void set_X_0(int64_t value)
{
___X_0 = value;
}
inline static int32_t get_offset_of_Next_1() { return static_cast<int32_t>(offsetof(Maxima_t4278896992, ___Next_1)); }
inline Maxima_t4278896992 * get_Next_1() const { return ___Next_1; }
inline Maxima_t4278896992 ** get_address_of_Next_1() { return &___Next_1; }
inline void set_Next_1(Maxima_t4278896992 * value)
{
___Next_1 = value;
Il2CppCodeGenWriteBarrier((&___Next_1), value);
}
inline static int32_t get_offset_of_Prev_2() { return static_cast<int32_t>(offsetof(Maxima_t4278896992, ___Prev_2)); }
inline Maxima_t4278896992 * get_Prev_2() const { return ___Prev_2; }
inline Maxima_t4278896992 ** get_address_of_Prev_2() { return &___Prev_2; }
inline void set_Prev_2(Maxima_t4278896992 * value)
{
___Prev_2 = value;
Il2CppCodeGenWriteBarrier((&___Prev_2), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MAXIMA_T4278896992_H
#ifndef SCANBEAM_T3952834741_H
#define SCANBEAM_T3952834741_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Scanbeam
struct Scanbeam_t3952834741 : public RuntimeObject
{
public:
// System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Scanbeam::Y
int64_t ___Y_0;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Scanbeam Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Scanbeam::Next
Scanbeam_t3952834741 * ___Next_1;
public:
inline static int32_t get_offset_of_Y_0() { return static_cast<int32_t>(offsetof(Scanbeam_t3952834741, ___Y_0)); }
inline int64_t get_Y_0() const { return ___Y_0; }
inline int64_t* get_address_of_Y_0() { return &___Y_0; }
inline void set_Y_0(int64_t value)
{
___Y_0 = value;
}
inline static int32_t get_offset_of_Next_1() { return static_cast<int32_t>(offsetof(Scanbeam_t3952834741, ___Next_1)); }
inline Scanbeam_t3952834741 * get_Next_1() const { return ___Next_1; }
inline Scanbeam_t3952834741 ** get_address_of_Next_1() { return &___Next_1; }
inline void set_Next_1(Scanbeam_t3952834741 * value)
{
___Next_1 = value;
Il2CppCodeGenWriteBarrier((&___Next_1), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SCANBEAM_T3952834741_H
#ifndef LOCALMINIMA_T86068969_H
#define LOCALMINIMA_T86068969_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima
struct LocalMinima_t86068969 : public RuntimeObject
{
public:
// System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima::Y
int64_t ___Y_0;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima::LeftBound
TEdge_t1694054893 * ___LeftBound_1;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima::RightBound
TEdge_t1694054893 * ___RightBound_2;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/LocalMinima::Next
LocalMinima_t86068969 * ___Next_3;
public:
inline static int32_t get_offset_of_Y_0() { return static_cast<int32_t>(offsetof(LocalMinima_t86068969, ___Y_0)); }
inline int64_t get_Y_0() const { return ___Y_0; }
inline int64_t* get_address_of_Y_0() { return &___Y_0; }
inline void set_Y_0(int64_t value)
{
___Y_0 = value;
}
inline static int32_t get_offset_of_LeftBound_1() { return static_cast<int32_t>(offsetof(LocalMinima_t86068969, ___LeftBound_1)); }
inline TEdge_t1694054893 * get_LeftBound_1() const { return ___LeftBound_1; }
inline TEdge_t1694054893 ** get_address_of_LeftBound_1() { return &___LeftBound_1; }
inline void set_LeftBound_1(TEdge_t1694054893 * value)
{
___LeftBound_1 = value;
Il2CppCodeGenWriteBarrier((&___LeftBound_1), value);
}
inline static int32_t get_offset_of_RightBound_2() { return static_cast<int32_t>(offsetof(LocalMinima_t86068969, ___RightBound_2)); }
inline TEdge_t1694054893 * get_RightBound_2() const { return ___RightBound_2; }
inline TEdge_t1694054893 ** get_address_of_RightBound_2() { return &___RightBound_2; }
inline void set_RightBound_2(TEdge_t1694054893 * value)
{
___RightBound_2 = value;
Il2CppCodeGenWriteBarrier((&___RightBound_2), value);
}
inline static int32_t get_offset_of_Next_3() { return static_cast<int32_t>(offsetof(LocalMinima_t86068969, ___Next_3)); }
inline LocalMinima_t86068969 * get_Next_3() const { return ___Next_3; }
inline LocalMinima_t86068969 ** get_address_of_Next_3() { return &___Next_3; }
inline void set_Next_3(LocalMinima_t86068969 * value)
{
___Next_3 = value;
Il2CppCodeGenWriteBarrier((&___Next_3), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // LOCALMINIMA_T86068969_H
#ifndef MYINTERSECTNODESORT_T682547759_H
#define MYINTERSECTNODESORT_T682547759_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/MyIntersectNodeSort
struct MyIntersectNodeSort_t682547759 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MYINTERSECTNODESORT_T682547759_H
#ifndef VECTORTILE_T3467883484_H
#define VECTORTILE_T3467883484_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.VectorTile
struct VectorTile_t3467883484 : public RuntimeObject
{
public:
// Mapbox.VectorTile.VectorTileReader Mapbox.VectorTile.VectorTile::_VTR
VectorTileReader_t1753322980 * ____VTR_0;
public:
inline static int32_t get_offset_of__VTR_0() { return static_cast<int32_t>(offsetof(VectorTile_t3467883484, ____VTR_0)); }
inline VectorTileReader_t1753322980 * get__VTR_0() const { return ____VTR_0; }
inline VectorTileReader_t1753322980 ** get_address_of__VTR_0() { return &____VTR_0; }
inline void set__VTR_0(VectorTileReader_t1753322980 * value)
{
____VTR_0 = value;
Il2CppCodeGenWriteBarrier((&____VTR_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VECTORTILE_T3467883484_H
#ifndef JSONCONVERTER_T472504469_H
#define JSONCONVERTER_T472504469_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Json.JsonConverter
struct JsonConverter_t472504469 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // JSONCONVERTER_T472504469_H
#ifndef EXCEPTION_T_H
#define EXCEPTION_T_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Exception
struct Exception_t : public RuntimeObject
{
public:
// System.IntPtr[] System.Exception::trace_ips
IntPtrU5BU5D_t4013366056* ___trace_ips_0;
// System.Exception System.Exception::inner_exception
Exception_t * ___inner_exception_1;
// System.String System.Exception::message
String_t* ___message_2;
// System.String System.Exception::help_link
String_t* ___help_link_3;
// System.String System.Exception::class_name
String_t* ___class_name_4;
// System.String System.Exception::stack_trace
String_t* ___stack_trace_5;
// System.String System.Exception::_remoteStackTraceString
String_t* ____remoteStackTraceString_6;
// System.Int32 System.Exception::remote_stack_index
int32_t ___remote_stack_index_7;
// System.Int32 System.Exception::hresult
int32_t ___hresult_8;
// System.String System.Exception::source
String_t* ___source_9;
// System.Collections.IDictionary System.Exception::_data
RuntimeObject* ____data_10;
public:
inline static int32_t get_offset_of_trace_ips_0() { return static_cast<int32_t>(offsetof(Exception_t, ___trace_ips_0)); }
inline IntPtrU5BU5D_t4013366056* get_trace_ips_0() const { return ___trace_ips_0; }
inline IntPtrU5BU5D_t4013366056** get_address_of_trace_ips_0() { return &___trace_ips_0; }
inline void set_trace_ips_0(IntPtrU5BU5D_t4013366056* value)
{
___trace_ips_0 = value;
Il2CppCodeGenWriteBarrier((&___trace_ips_0), value);
}
inline static int32_t get_offset_of_inner_exception_1() { return static_cast<int32_t>(offsetof(Exception_t, ___inner_exception_1)); }
inline Exception_t * get_inner_exception_1() const { return ___inner_exception_1; }
inline Exception_t ** get_address_of_inner_exception_1() { return &___inner_exception_1; }
inline void set_inner_exception_1(Exception_t * value)
{
___inner_exception_1 = value;
Il2CppCodeGenWriteBarrier((&___inner_exception_1), value);
}
inline static int32_t get_offset_of_message_2() { return static_cast<int32_t>(offsetof(Exception_t, ___message_2)); }
inline String_t* get_message_2() const { return ___message_2; }
inline String_t** get_address_of_message_2() { return &___message_2; }
inline void set_message_2(String_t* value)
{
___message_2 = value;
Il2CppCodeGenWriteBarrier((&___message_2), value);
}
inline static int32_t get_offset_of_help_link_3() { return static_cast<int32_t>(offsetof(Exception_t, ___help_link_3)); }
inline String_t* get_help_link_3() const { return ___help_link_3; }
inline String_t** get_address_of_help_link_3() { return &___help_link_3; }
inline void set_help_link_3(String_t* value)
{
___help_link_3 = value;
Il2CppCodeGenWriteBarrier((&___help_link_3), value);
}
inline static int32_t get_offset_of_class_name_4() { return static_cast<int32_t>(offsetof(Exception_t, ___class_name_4)); }
inline String_t* get_class_name_4() const { return ___class_name_4; }
inline String_t** get_address_of_class_name_4() { return &___class_name_4; }
inline void set_class_name_4(String_t* value)
{
___class_name_4 = value;
Il2CppCodeGenWriteBarrier((&___class_name_4), value);
}
inline static int32_t get_offset_of_stack_trace_5() { return static_cast<int32_t>(offsetof(Exception_t, ___stack_trace_5)); }
inline String_t* get_stack_trace_5() const { return ___stack_trace_5; }
inline String_t** get_address_of_stack_trace_5() { return &___stack_trace_5; }
inline void set_stack_trace_5(String_t* value)
{
___stack_trace_5 = value;
Il2CppCodeGenWriteBarrier((&___stack_trace_5), value);
}
inline static int32_t get_offset_of__remoteStackTraceString_6() { return static_cast<int32_t>(offsetof(Exception_t, ____remoteStackTraceString_6)); }
inline String_t* get__remoteStackTraceString_6() const { return ____remoteStackTraceString_6; }
inline String_t** get_address_of__remoteStackTraceString_6() { return &____remoteStackTraceString_6; }
inline void set__remoteStackTraceString_6(String_t* value)
{
____remoteStackTraceString_6 = value;
Il2CppCodeGenWriteBarrier((&____remoteStackTraceString_6), value);
}
inline static int32_t get_offset_of_remote_stack_index_7() { return static_cast<int32_t>(offsetof(Exception_t, ___remote_stack_index_7)); }
inline int32_t get_remote_stack_index_7() const { return ___remote_stack_index_7; }
inline int32_t* get_address_of_remote_stack_index_7() { return &___remote_stack_index_7; }
inline void set_remote_stack_index_7(int32_t value)
{
___remote_stack_index_7 = value;
}
inline static int32_t get_offset_of_hresult_8() { return static_cast<int32_t>(offsetof(Exception_t, ___hresult_8)); }
inline int32_t get_hresult_8() const { return ___hresult_8; }
inline int32_t* get_address_of_hresult_8() { return &___hresult_8; }
inline void set_hresult_8(int32_t value)
{
___hresult_8 = value;
}
inline static int32_t get_offset_of_source_9() { return static_cast<int32_t>(offsetof(Exception_t, ___source_9)); }
inline String_t* get_source_9() const { return ___source_9; }
inline String_t** get_address_of_source_9() { return &___source_9; }
inline void set_source_9(String_t* value)
{
___source_9 = value;
Il2CppCodeGenWriteBarrier((&___source_9), value);
}
inline static int32_t get_offset_of__data_10() { return static_cast<int32_t>(offsetof(Exception_t, ____data_10)); }
inline RuntimeObject* get__data_10() const { return ____data_10; }
inline RuntimeObject** get_address_of__data_10() { return &____data_10; }
inline void set__data_10(RuntimeObject* value)
{
____data_10 = value;
Il2CppCodeGenWriteBarrier((&____data_10), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // EXCEPTION_T_H
#ifndef VALUETYPE_T3640485471_H
#define VALUETYPE_T3640485471_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.ValueType
struct ValueType_t3640485471 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.ValueType
struct ValueType_t3640485471_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.ValueType
struct ValueType_t3640485471_marshaled_com
{
};
#endif // VALUETYPE_T3640485471_H
#ifndef U3CRELOADAFTERDELAYU3EC__ITERATOR0_T22183295_H
#define U3CRELOADAFTERDELAYU3EC__ITERATOR0_T22183295_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.ReloadMap/<ReloadAfterDelay>c__Iterator0
struct U3CReloadAfterDelayU3Ec__Iterator0_t22183295 : public RuntimeObject
{
public:
// System.Int32 Mapbox.Examples.ReloadMap/<ReloadAfterDelay>c__Iterator0::zoom
int32_t ___zoom_0;
// Mapbox.Examples.ReloadMap Mapbox.Examples.ReloadMap/<ReloadAfterDelay>c__Iterator0::$this
ReloadMap_t3484436943 * ___U24this_1;
// System.Object Mapbox.Examples.ReloadMap/<ReloadAfterDelay>c__Iterator0::$current
RuntimeObject * ___U24current_2;
// System.Boolean Mapbox.Examples.ReloadMap/<ReloadAfterDelay>c__Iterator0::$disposing
bool ___U24disposing_3;
// System.Int32 Mapbox.Examples.ReloadMap/<ReloadAfterDelay>c__Iterator0::$PC
int32_t ___U24PC_4;
public:
inline static int32_t get_offset_of_zoom_0() { return static_cast<int32_t>(offsetof(U3CReloadAfterDelayU3Ec__Iterator0_t22183295, ___zoom_0)); }
inline int32_t get_zoom_0() const { return ___zoom_0; }
inline int32_t* get_address_of_zoom_0() { return &___zoom_0; }
inline void set_zoom_0(int32_t value)
{
___zoom_0 = value;
}
inline static int32_t get_offset_of_U24this_1() { return static_cast<int32_t>(offsetof(U3CReloadAfterDelayU3Ec__Iterator0_t22183295, ___U24this_1)); }
inline ReloadMap_t3484436943 * get_U24this_1() const { return ___U24this_1; }
inline ReloadMap_t3484436943 ** get_address_of_U24this_1() { return &___U24this_1; }
inline void set_U24this_1(ReloadMap_t3484436943 * value)
{
___U24this_1 = value;
Il2CppCodeGenWriteBarrier((&___U24this_1), value);
}
inline static int32_t get_offset_of_U24current_2() { return static_cast<int32_t>(offsetof(U3CReloadAfterDelayU3Ec__Iterator0_t22183295, ___U24current_2)); }
inline RuntimeObject * get_U24current_2() const { return ___U24current_2; }
inline RuntimeObject ** get_address_of_U24current_2() { return &___U24current_2; }
inline void set_U24current_2(RuntimeObject * value)
{
___U24current_2 = value;
Il2CppCodeGenWriteBarrier((&___U24current_2), value);
}
inline static int32_t get_offset_of_U24disposing_3() { return static_cast<int32_t>(offsetof(U3CReloadAfterDelayU3Ec__Iterator0_t22183295, ___U24disposing_3)); }
inline bool get_U24disposing_3() const { return ___U24disposing_3; }
inline bool* get_address_of_U24disposing_3() { return &___U24disposing_3; }
inline void set_U24disposing_3(bool value)
{
___U24disposing_3 = value;
}
inline static int32_t get_offset_of_U24PC_4() { return static_cast<int32_t>(offsetof(U3CReloadAfterDelayU3Ec__Iterator0_t22183295, ___U24PC_4)); }
inline int32_t get_U24PC_4() const { return ___U24PC_4; }
inline int32_t* get_address_of_U24PC_4() { return &___U24PC_4; }
inline void set_U24PC_4(int32_t value)
{
___U24PC_4 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // U3CRELOADAFTERDELAYU3EC__ITERATOR0_T22183295_H
#ifndef U3CBUILDROUTINEU3EC__ITERATOR0_T1339467344_H
#define U3CBUILDROUTINEU3EC__ITERATOR0_T1339467344_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.Voxels.VoxelTile/<BuildRoutine>c__Iterator0
struct U3CBuildRoutineU3Ec__Iterator0_t1339467344 : public RuntimeObject
{
public:
// System.Collections.Generic.List`1<Mapbox.Examples.Voxels.VoxelData> Mapbox.Examples.Voxels.VoxelTile/<BuildRoutine>c__Iterator0::<distanceOrderedVoxels>__0
List_1_t3720956926 * ___U3CdistanceOrderedVoxelsU3E__0_0;
// System.Int32 Mapbox.Examples.Voxels.VoxelTile/<BuildRoutine>c__Iterator0::<i>__1
int32_t ___U3CiU3E__1_1;
// Mapbox.Examples.Voxels.VoxelTile Mapbox.Examples.Voxels.VoxelTile/<BuildRoutine>c__Iterator0::$this
VoxelTile_t1944340880 * ___U24this_2;
// System.Object Mapbox.Examples.Voxels.VoxelTile/<BuildRoutine>c__Iterator0::$current
RuntimeObject * ___U24current_3;
// System.Boolean Mapbox.Examples.Voxels.VoxelTile/<BuildRoutine>c__Iterator0::$disposing
bool ___U24disposing_4;
// System.Int32 Mapbox.Examples.Voxels.VoxelTile/<BuildRoutine>c__Iterator0::$PC
int32_t ___U24PC_5;
public:
inline static int32_t get_offset_of_U3CdistanceOrderedVoxelsU3E__0_0() { return static_cast<int32_t>(offsetof(U3CBuildRoutineU3Ec__Iterator0_t1339467344, ___U3CdistanceOrderedVoxelsU3E__0_0)); }
inline List_1_t3720956926 * get_U3CdistanceOrderedVoxelsU3E__0_0() const { return ___U3CdistanceOrderedVoxelsU3E__0_0; }
inline List_1_t3720956926 ** get_address_of_U3CdistanceOrderedVoxelsU3E__0_0() { return &___U3CdistanceOrderedVoxelsU3E__0_0; }
inline void set_U3CdistanceOrderedVoxelsU3E__0_0(List_1_t3720956926 * value)
{
___U3CdistanceOrderedVoxelsU3E__0_0 = value;
Il2CppCodeGenWriteBarrier((&___U3CdistanceOrderedVoxelsU3E__0_0), value);
}
inline static int32_t get_offset_of_U3CiU3E__1_1() { return static_cast<int32_t>(offsetof(U3CBuildRoutineU3Ec__Iterator0_t1339467344, ___U3CiU3E__1_1)); }
inline int32_t get_U3CiU3E__1_1() const { return ___U3CiU3E__1_1; }
inline int32_t* get_address_of_U3CiU3E__1_1() { return &___U3CiU3E__1_1; }
inline void set_U3CiU3E__1_1(int32_t value)
{
___U3CiU3E__1_1 = value;
}
inline static int32_t get_offset_of_U24this_2() { return static_cast<int32_t>(offsetof(U3CBuildRoutineU3Ec__Iterator0_t1339467344, ___U24this_2)); }
inline VoxelTile_t1944340880 * get_U24this_2() const { return ___U24this_2; }
inline VoxelTile_t1944340880 ** get_address_of_U24this_2() { return &___U24this_2; }
inline void set_U24this_2(VoxelTile_t1944340880 * value)
{
___U24this_2 = value;
Il2CppCodeGenWriteBarrier((&___U24this_2), value);
}
inline static int32_t get_offset_of_U24current_3() { return static_cast<int32_t>(offsetof(U3CBuildRoutineU3Ec__Iterator0_t1339467344, ___U24current_3)); }
inline RuntimeObject * get_U24current_3() const { return ___U24current_3; }
inline RuntimeObject ** get_address_of_U24current_3() { return &___U24current_3; }
inline void set_U24current_3(RuntimeObject * value)
{
___U24current_3 = value;
Il2CppCodeGenWriteBarrier((&___U24current_3), value);
}
inline static int32_t get_offset_of_U24disposing_4() { return static_cast<int32_t>(offsetof(U3CBuildRoutineU3Ec__Iterator0_t1339467344, ___U24disposing_4)); }
inline bool get_U24disposing_4() const { return ___U24disposing_4; }
inline bool* get_address_of_U24disposing_4() { return &___U24disposing_4; }
inline void set_U24disposing_4(bool value)
{
___U24disposing_4 = value;
}
inline static int32_t get_offset_of_U24PC_5() { return static_cast<int32_t>(offsetof(U3CBuildRoutineU3Ec__Iterator0_t1339467344, ___U24PC_5)); }
inline int32_t get_U24PC_5() const { return ___U24PC_5; }
inline int32_t* get_address_of_U24PC_5() { return &___U24PC_5; }
inline void set_U24PC_5(int32_t value)
{
___U24PC_5 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // U3CBUILDROUTINEU3EC__ITERATOR0_T1339467344_H
#ifndef THREADDATA_T1095464109_H
#define THREADDATA_T1095464109_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.Voxels.TextureScale/ThreadData
struct ThreadData_t1095464109 : public RuntimeObject
{
public:
// System.Int32 Mapbox.Examples.Voxels.TextureScale/ThreadData::start
int32_t ___start_0;
// System.Int32 Mapbox.Examples.Voxels.TextureScale/ThreadData::end
int32_t ___end_1;
public:
inline static int32_t get_offset_of_start_0() { return static_cast<int32_t>(offsetof(ThreadData_t1095464109, ___start_0)); }
inline int32_t get_start_0() const { return ___start_0; }
inline int32_t* get_address_of_start_0() { return &___start_0; }
inline void set_start_0(int32_t value)
{
___start_0 = value;
}
inline static int32_t get_offset_of_end_1() { return static_cast<int32_t>(offsetof(ThreadData_t1095464109, ___end_1)); }
inline int32_t get_end_1() const { return ___end_1; }
inline int32_t* get_address_of_end_1() { return &___end_1; }
inline void set_end_1(int32_t value)
{
___end_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // THREADDATA_T1095464109_H
#ifndef TEXTURESCALE_T57896704_H
#define TEXTURESCALE_T57896704_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.Voxels.TextureScale
struct TextureScale_t57896704 : public RuntimeObject
{
public:
public:
};
struct TextureScale_t57896704_StaticFields
{
public:
// UnityEngine.Color[] Mapbox.Examples.Voxels.TextureScale::texColors
ColorU5BU5D_t941916413* ___texColors_0;
// UnityEngine.Color[] Mapbox.Examples.Voxels.TextureScale::newColors
ColorU5BU5D_t941916413* ___newColors_1;
// System.Int32 Mapbox.Examples.Voxels.TextureScale::w
int32_t ___w_2;
// System.Single Mapbox.Examples.Voxels.TextureScale::ratioX
float ___ratioX_3;
// System.Single Mapbox.Examples.Voxels.TextureScale::ratioY
float ___ratioY_4;
// System.Int32 Mapbox.Examples.Voxels.TextureScale::w2
int32_t ___w2_5;
// System.Int32 Mapbox.Examples.Voxels.TextureScale::finishCount
int32_t ___finishCount_6;
// System.Threading.Mutex Mapbox.Examples.Voxels.TextureScale::mutex
Mutex_t3066672582 * ___mutex_7;
public:
inline static int32_t get_offset_of_texColors_0() { return static_cast<int32_t>(offsetof(TextureScale_t57896704_StaticFields, ___texColors_0)); }
inline ColorU5BU5D_t941916413* get_texColors_0() const { return ___texColors_0; }
inline ColorU5BU5D_t941916413** get_address_of_texColors_0() { return &___texColors_0; }
inline void set_texColors_0(ColorU5BU5D_t941916413* value)
{
___texColors_0 = value;
Il2CppCodeGenWriteBarrier((&___texColors_0), value);
}
inline static int32_t get_offset_of_newColors_1() { return static_cast<int32_t>(offsetof(TextureScale_t57896704_StaticFields, ___newColors_1)); }
inline ColorU5BU5D_t941916413* get_newColors_1() const { return ___newColors_1; }
inline ColorU5BU5D_t941916413** get_address_of_newColors_1() { return &___newColors_1; }
inline void set_newColors_1(ColorU5BU5D_t941916413* value)
{
___newColors_1 = value;
Il2CppCodeGenWriteBarrier((&___newColors_1), value);
}
inline static int32_t get_offset_of_w_2() { return static_cast<int32_t>(offsetof(TextureScale_t57896704_StaticFields, ___w_2)); }
inline int32_t get_w_2() const { return ___w_2; }
inline int32_t* get_address_of_w_2() { return &___w_2; }
inline void set_w_2(int32_t value)
{
___w_2 = value;
}
inline static int32_t get_offset_of_ratioX_3() { return static_cast<int32_t>(offsetof(TextureScale_t57896704_StaticFields, ___ratioX_3)); }
inline float get_ratioX_3() const { return ___ratioX_3; }
inline float* get_address_of_ratioX_3() { return &___ratioX_3; }
inline void set_ratioX_3(float value)
{
___ratioX_3 = value;
}
inline static int32_t get_offset_of_ratioY_4() { return static_cast<int32_t>(offsetof(TextureScale_t57896704_StaticFields, ___ratioY_4)); }
inline float get_ratioY_4() const { return ___ratioY_4; }
inline float* get_address_of_ratioY_4() { return &___ratioY_4; }
inline void set_ratioY_4(float value)
{
___ratioY_4 = value;
}
inline static int32_t get_offset_of_w2_5() { return static_cast<int32_t>(offsetof(TextureScale_t57896704_StaticFields, ___w2_5)); }
inline int32_t get_w2_5() const { return ___w2_5; }
inline int32_t* get_address_of_w2_5() { return &___w2_5; }
inline void set_w2_5(int32_t value)
{
___w2_5 = value;
}
inline static int32_t get_offset_of_finishCount_6() { return static_cast<int32_t>(offsetof(TextureScale_t57896704_StaticFields, ___finishCount_6)); }
inline int32_t get_finishCount_6() const { return ___finishCount_6; }
inline int32_t* get_address_of_finishCount_6() { return &___finishCount_6; }
inline void set_finishCount_6(int32_t value)
{
___finishCount_6 = value;
}
inline static int32_t get_offset_of_mutex_7() { return static_cast<int32_t>(offsetof(TextureScale_t57896704_StaticFields, ___mutex_7)); }
inline Mutex_t3066672582 * get_mutex_7() const { return ___mutex_7; }
inline Mutex_t3066672582 ** get_address_of_mutex_7() { return &___mutex_7; }
inline void set_mutex_7(Mutex_t3066672582 * value)
{
___mutex_7 = value;
Il2CppCodeGenWriteBarrier((&___mutex_7), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // TEXTURESCALE_T57896704_H
#ifndef VECTORTILEREADER_T1753322980_H
#define VECTORTILEREADER_T1753322980_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.VectorTileReader
struct VectorTileReader_t1753322980 : public RuntimeObject
{
public:
// System.Collections.Generic.Dictionary`2<System.String,System.Byte[]> Mapbox.VectorTile.VectorTileReader::_Layers
Dictionary_2_t3901903956 * ____Layers_0;
// System.Boolean Mapbox.VectorTile.VectorTileReader::_Validate
bool ____Validate_1;
public:
inline static int32_t get_offset_of__Layers_0() { return static_cast<int32_t>(offsetof(VectorTileReader_t1753322980, ____Layers_0)); }
inline Dictionary_2_t3901903956 * get__Layers_0() const { return ____Layers_0; }
inline Dictionary_2_t3901903956 ** get_address_of__Layers_0() { return &____Layers_0; }
inline void set__Layers_0(Dictionary_2_t3901903956 * value)
{
____Layers_0 = value;
Il2CppCodeGenWriteBarrier((&____Layers_0), value);
}
inline static int32_t get_offset_of__Validate_1() { return static_cast<int32_t>(offsetof(VectorTileReader_t1753322980, ____Validate_1)); }
inline bool get__Validate_1() const { return ____Validate_1; }
inline bool* get_address_of__Validate_1() { return &____Validate_1; }
inline void set__Validate_1(bool value)
{
____Validate_1 = value;
}
};
struct VectorTileReader_t1753322980_StaticFields
{
public:
// System.Func`2<System.UInt32,System.Int32> Mapbox.VectorTile.VectorTileReader::<>f__am$cache0
Func_2_t2244831341 * ___U3CU3Ef__amU24cache0_2;
// System.Func`3<System.Int32,System.Int32,System.Boolean> Mapbox.VectorTile.VectorTileReader::<>f__am$cache1
Func_3_t491204050 * ___U3CU3Ef__amU24cache1_3;
// System.Func`3<System.Int32,System.Int32,System.Boolean> Mapbox.VectorTile.VectorTileReader::<>f__am$cache2
Func_3_t491204050 * ___U3CU3Ef__amU24cache2_4;
public:
inline static int32_t get_offset_of_U3CU3Ef__amU24cache0_2() { return static_cast<int32_t>(offsetof(VectorTileReader_t1753322980_StaticFields, ___U3CU3Ef__amU24cache0_2)); }
inline Func_2_t2244831341 * get_U3CU3Ef__amU24cache0_2() const { return ___U3CU3Ef__amU24cache0_2; }
inline Func_2_t2244831341 ** get_address_of_U3CU3Ef__amU24cache0_2() { return &___U3CU3Ef__amU24cache0_2; }
inline void set_U3CU3Ef__amU24cache0_2(Func_2_t2244831341 * value)
{
___U3CU3Ef__amU24cache0_2 = value;
Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache0_2), value);
}
inline static int32_t get_offset_of_U3CU3Ef__amU24cache1_3() { return static_cast<int32_t>(offsetof(VectorTileReader_t1753322980_StaticFields, ___U3CU3Ef__amU24cache1_3)); }
inline Func_3_t491204050 * get_U3CU3Ef__amU24cache1_3() const { return ___U3CU3Ef__amU24cache1_3; }
inline Func_3_t491204050 ** get_address_of_U3CU3Ef__amU24cache1_3() { return &___U3CU3Ef__amU24cache1_3; }
inline void set_U3CU3Ef__amU24cache1_3(Func_3_t491204050 * value)
{
___U3CU3Ef__amU24cache1_3 = value;
Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache1_3), value);
}
inline static int32_t get_offset_of_U3CU3Ef__amU24cache2_4() { return static_cast<int32_t>(offsetof(VectorTileReader_t1753322980_StaticFields, ___U3CU3Ef__amU24cache2_4)); }
inline Func_3_t491204050 * get_U3CU3Ef__amU24cache2_4() const { return ___U3CU3Ef__amU24cache2_4; }
inline Func_3_t491204050 ** get_address_of_U3CU3Ef__amU24cache2_4() { return &___U3CU3Ef__amU24cache2_4; }
inline void set_U3CU3Ef__amU24cache2_4(Func_3_t491204050 * value)
{
___U3CU3Ef__amU24cache2_4 = value;
Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache2_4), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VECTORTILEREADER_T1753322980_H
#ifndef VECTORTILELAYER_T873169949_H
#define VECTORTILELAYER_T873169949_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.VectorTileLayer
struct VectorTileLayer_t873169949 : public RuntimeObject
{
public:
// System.Byte[] Mapbox.VectorTile.VectorTileLayer::<Data>k__BackingField
ByteU5BU5D_t4116647657* ___U3CDataU3Ek__BackingField_0;
// System.String Mapbox.VectorTile.VectorTileLayer::<Name>k__BackingField
String_t* ___U3CNameU3Ek__BackingField_1;
// System.UInt64 Mapbox.VectorTile.VectorTileLayer::<Version>k__BackingField
uint64_t ___U3CVersionU3Ek__BackingField_2;
// System.UInt64 Mapbox.VectorTile.VectorTileLayer::<Extent>k__BackingField
uint64_t ___U3CExtentU3Ek__BackingField_3;
// System.Collections.Generic.List`1<System.Byte[]> Mapbox.VectorTile.VectorTileLayer::<_FeaturesData>k__BackingField
List_1_t1293755103 * ___U3C_FeaturesDataU3Ek__BackingField_4;
// System.Collections.Generic.List`1<System.Object> Mapbox.VectorTile.VectorTileLayer::<Values>k__BackingField
List_1_t257213610 * ___U3CValuesU3Ek__BackingField_5;
// System.Collections.Generic.List`1<System.String> Mapbox.VectorTile.VectorTileLayer::<Keys>k__BackingField
List_1_t3319525431 * ___U3CKeysU3Ek__BackingField_6;
public:
inline static int32_t get_offset_of_U3CDataU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(VectorTileLayer_t873169949, ___U3CDataU3Ek__BackingField_0)); }
inline ByteU5BU5D_t4116647657* get_U3CDataU3Ek__BackingField_0() const { return ___U3CDataU3Ek__BackingField_0; }
inline ByteU5BU5D_t4116647657** get_address_of_U3CDataU3Ek__BackingField_0() { return &___U3CDataU3Ek__BackingField_0; }
inline void set_U3CDataU3Ek__BackingField_0(ByteU5BU5D_t4116647657* value)
{
___U3CDataU3Ek__BackingField_0 = value;
Il2CppCodeGenWriteBarrier((&___U3CDataU3Ek__BackingField_0), value);
}
inline static int32_t get_offset_of_U3CNameU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(VectorTileLayer_t873169949, ___U3CNameU3Ek__BackingField_1)); }
inline String_t* get_U3CNameU3Ek__BackingField_1() const { return ___U3CNameU3Ek__BackingField_1; }
inline String_t** get_address_of_U3CNameU3Ek__BackingField_1() { return &___U3CNameU3Ek__BackingField_1; }
inline void set_U3CNameU3Ek__BackingField_1(String_t* value)
{
___U3CNameU3Ek__BackingField_1 = value;
Il2CppCodeGenWriteBarrier((&___U3CNameU3Ek__BackingField_1), value);
}
inline static int32_t get_offset_of_U3CVersionU3Ek__BackingField_2() { return static_cast<int32_t>(offsetof(VectorTileLayer_t873169949, ___U3CVersionU3Ek__BackingField_2)); }
inline uint64_t get_U3CVersionU3Ek__BackingField_2() const { return ___U3CVersionU3Ek__BackingField_2; }
inline uint64_t* get_address_of_U3CVersionU3Ek__BackingField_2() { return &___U3CVersionU3Ek__BackingField_2; }
inline void set_U3CVersionU3Ek__BackingField_2(uint64_t value)
{
___U3CVersionU3Ek__BackingField_2 = value;
}
inline static int32_t get_offset_of_U3CExtentU3Ek__BackingField_3() { return static_cast<int32_t>(offsetof(VectorTileLayer_t873169949, ___U3CExtentU3Ek__BackingField_3)); }
inline uint64_t get_U3CExtentU3Ek__BackingField_3() const { return ___U3CExtentU3Ek__BackingField_3; }
inline uint64_t* get_address_of_U3CExtentU3Ek__BackingField_3() { return &___U3CExtentU3Ek__BackingField_3; }
inline void set_U3CExtentU3Ek__BackingField_3(uint64_t value)
{
___U3CExtentU3Ek__BackingField_3 = value;
}
inline static int32_t get_offset_of_U3C_FeaturesDataU3Ek__BackingField_4() { return static_cast<int32_t>(offsetof(VectorTileLayer_t873169949, ___U3C_FeaturesDataU3Ek__BackingField_4)); }
inline List_1_t1293755103 * get_U3C_FeaturesDataU3Ek__BackingField_4() const { return ___U3C_FeaturesDataU3Ek__BackingField_4; }
inline List_1_t1293755103 ** get_address_of_U3C_FeaturesDataU3Ek__BackingField_4() { return &___U3C_FeaturesDataU3Ek__BackingField_4; }
inline void set_U3C_FeaturesDataU3Ek__BackingField_4(List_1_t1293755103 * value)
{
___U3C_FeaturesDataU3Ek__BackingField_4 = value;
Il2CppCodeGenWriteBarrier((&___U3C_FeaturesDataU3Ek__BackingField_4), value);
}
inline static int32_t get_offset_of_U3CValuesU3Ek__BackingField_5() { return static_cast<int32_t>(offsetof(VectorTileLayer_t873169949, ___U3CValuesU3Ek__BackingField_5)); }
inline List_1_t257213610 * get_U3CValuesU3Ek__BackingField_5() const { return ___U3CValuesU3Ek__BackingField_5; }
inline List_1_t257213610 ** get_address_of_U3CValuesU3Ek__BackingField_5() { return &___U3CValuesU3Ek__BackingField_5; }
inline void set_U3CValuesU3Ek__BackingField_5(List_1_t257213610 * value)
{
___U3CValuesU3Ek__BackingField_5 = value;
Il2CppCodeGenWriteBarrier((&___U3CValuesU3Ek__BackingField_5), value);
}
inline static int32_t get_offset_of_U3CKeysU3Ek__BackingField_6() { return static_cast<int32_t>(offsetof(VectorTileLayer_t873169949, ___U3CKeysU3Ek__BackingField_6)); }
inline List_1_t3319525431 * get_U3CKeysU3Ek__BackingField_6() const { return ___U3CKeysU3Ek__BackingField_6; }
inline List_1_t3319525431 ** get_address_of_U3CKeysU3Ek__BackingField_6() { return &___U3CKeysU3Ek__BackingField_6; }
inline void set_U3CKeysU3Ek__BackingField_6(List_1_t3319525431 * value)
{
___U3CKeysU3Ek__BackingField_6 = value;
Il2CppCodeGenWriteBarrier((&___U3CKeysU3Ek__BackingField_6), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VECTORTILELAYER_T873169949_H
#ifndef JSONCONVERTERS_T1015645604_H
#define JSONCONVERTERS_T1015645604_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Utils.JsonConverters.JsonConverters
struct JsonConverters_t1015645604 : public RuntimeObject
{
public:
public:
};
struct JsonConverters_t1015645604_StaticFields
{
public:
// Mapbox.Json.JsonConverter[] Mapbox.Utils.JsonConverters.JsonConverters::converters
JsonConverterU5BU5D_t1616679288* ___converters_0;
public:
inline static int32_t get_offset_of_converters_0() { return static_cast<int32_t>(offsetof(JsonConverters_t1015645604_StaticFields, ___converters_0)); }
inline JsonConverterU5BU5D_t1616679288* get_converters_0() const { return ___converters_0; }
inline JsonConverterU5BU5D_t1616679288** get_address_of_converters_0() { return &___converters_0; }
inline void set_converters_0(JsonConverterU5BU5D_t1616679288* value)
{
___converters_0 = value;
Il2CppCodeGenWriteBarrier((&___converters_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // JSONCONVERTERS_T1015645604_H
#ifndef VECTORTILEFEATUREEXTENSIONS_T4023769631_H
#define VECTORTILEFEATUREEXTENSIONS_T4023769631_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.ExtensionMethods.VectorTileFeatureExtensions
struct VectorTileFeatureExtensions_t4023769631 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VECTORTILEFEATUREEXTENSIONS_T4023769631_H
#ifndef POLYLINEUTILS_T2997409923_H
#define POLYLINEUTILS_T2997409923_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Utils.PolylineUtils
struct PolylineUtils_t2997409923 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // POLYLINEUTILS_T2997409923_H
#ifndef UNIXTIMESTAMPUTILS_T2933311910_H
#define UNIXTIMESTAMPUTILS_T2933311910_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Utils.UnixTimestampUtils
struct UnixTimestampUtils_t2933311910 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // UNIXTIMESTAMPUTILS_T2933311910_H
#ifndef INTERNALCLIPPER_T4127247543_H
#define INTERNALCLIPPER_T4127247543_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper
struct InternalClipper_t4127247543 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INTERNALCLIPPER_T4127247543_H
#ifndef U3CGEOMETRYASWGS84U3EC__ANONSTOREY0_T3901700684_H
#define U3CGEOMETRYASWGS84U3EC__ANONSTOREY0_T3901700684_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.ExtensionMethods.VectorTileFeatureExtensions/<GeometryAsWgs84>c__AnonStorey0
struct U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684 : public RuntimeObject
{
public:
// System.UInt64 Mapbox.VectorTile.ExtensionMethods.VectorTileFeatureExtensions/<GeometryAsWgs84>c__AnonStorey0::zoom
uint64_t ___zoom_0;
// System.UInt64 Mapbox.VectorTile.ExtensionMethods.VectorTileFeatureExtensions/<GeometryAsWgs84>c__AnonStorey0::tileColumn
uint64_t ___tileColumn_1;
// System.UInt64 Mapbox.VectorTile.ExtensionMethods.VectorTileFeatureExtensions/<GeometryAsWgs84>c__AnonStorey0::tileRow
uint64_t ___tileRow_2;
// Mapbox.VectorTile.VectorTileFeature Mapbox.VectorTile.ExtensionMethods.VectorTileFeatureExtensions/<GeometryAsWgs84>c__AnonStorey0::feature
VectorTileFeature_t4093669591 * ___feature_3;
public:
inline static int32_t get_offset_of_zoom_0() { return static_cast<int32_t>(offsetof(U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684, ___zoom_0)); }
inline uint64_t get_zoom_0() const { return ___zoom_0; }
inline uint64_t* get_address_of_zoom_0() { return &___zoom_0; }
inline void set_zoom_0(uint64_t value)
{
___zoom_0 = value;
}
inline static int32_t get_offset_of_tileColumn_1() { return static_cast<int32_t>(offsetof(U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684, ___tileColumn_1)); }
inline uint64_t get_tileColumn_1() const { return ___tileColumn_1; }
inline uint64_t* get_address_of_tileColumn_1() { return &___tileColumn_1; }
inline void set_tileColumn_1(uint64_t value)
{
___tileColumn_1 = value;
}
inline static int32_t get_offset_of_tileRow_2() { return static_cast<int32_t>(offsetof(U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684, ___tileRow_2)); }
inline uint64_t get_tileRow_2() const { return ___tileRow_2; }
inline uint64_t* get_address_of_tileRow_2() { return &___tileRow_2; }
inline void set_tileRow_2(uint64_t value)
{
___tileRow_2 = value;
}
inline static int32_t get_offset_of_feature_3() { return static_cast<int32_t>(offsetof(U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684, ___feature_3)); }
inline VectorTileFeature_t4093669591 * get_feature_3() const { return ___feature_3; }
inline VectorTileFeature_t4093669591 ** get_address_of_feature_3() { return &___feature_3; }
inline void set_feature_3(VectorTileFeature_t4093669591 * value)
{
___feature_3 = value;
Il2CppCodeGenWriteBarrier((&___feature_3), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // U3CGEOMETRYASWGS84U3EC__ANONSTOREY0_T3901700684_H
#ifndef ENUMEXTENSIONS_T2644584491_H
#define ENUMEXTENSIONS_T2644584491_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.ExtensionMethods.EnumExtensions
struct EnumExtensions_t2644584491 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ENUMEXTENSIONS_T2644584491_H
#ifndef VECTORTILEEXTENSIONS_T4243590528_H
#define VECTORTILEEXTENSIONS_T4243590528_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.ExtensionMethods.VectorTileExtensions
struct VectorTileExtensions_t4243590528 : public RuntimeObject
{
public:
public:
};
struct VectorTileExtensions_t4243590528_StaticFields
{
public:
// System.Func`2<System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.LatLng>,System.Collections.Generic.IEnumerable`1<Mapbox.VectorTile.Geometry.LatLng>> Mapbox.VectorTile.ExtensionMethods.VectorTileExtensions::<>f__am$cache0
Func_2_t1001585409 * ___U3CU3Ef__amU24cache0_0;
// System.Func`2<Mapbox.VectorTile.Geometry.LatLng,System.String> Mapbox.VectorTile.ExtensionMethods.VectorTileExtensions::<>f__am$cache1
Func_2_t3663939823 * ___U3CU3Ef__amU24cache1_1;
// System.Func`2<Mapbox.VectorTile.Geometry.LatLng,System.String> Mapbox.VectorTile.ExtensionMethods.VectorTileExtensions::<>f__am$cache2
Func_2_t3663939823 * ___U3CU3Ef__amU24cache2_2;
// System.Func`2<Mapbox.VectorTile.Geometry.LatLng,System.String> Mapbox.VectorTile.ExtensionMethods.VectorTileExtensions::<>f__am$cache3
Func_2_t3663939823 * ___U3CU3Ef__amU24cache3_3;
// System.Func`2<Mapbox.VectorTile.Geometry.LatLng,System.String> Mapbox.VectorTile.ExtensionMethods.VectorTileExtensions::<>f__am$cache4
Func_2_t3663939823 * ___U3CU3Ef__amU24cache4_4;
// System.Func`2<Mapbox.VectorTile.Geometry.LatLng,System.String> Mapbox.VectorTile.ExtensionMethods.VectorTileExtensions::<>f__am$cache5
Func_2_t3663939823 * ___U3CU3Ef__amU24cache5_5;
public:
inline static int32_t get_offset_of_U3CU3Ef__amU24cache0_0() { return static_cast<int32_t>(offsetof(VectorTileExtensions_t4243590528_StaticFields, ___U3CU3Ef__amU24cache0_0)); }
inline Func_2_t1001585409 * get_U3CU3Ef__amU24cache0_0() const { return ___U3CU3Ef__amU24cache0_0; }
inline Func_2_t1001585409 ** get_address_of_U3CU3Ef__amU24cache0_0() { return &___U3CU3Ef__amU24cache0_0; }
inline void set_U3CU3Ef__amU24cache0_0(Func_2_t1001585409 * value)
{
___U3CU3Ef__amU24cache0_0 = value;
Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache0_0), value);
}
inline static int32_t get_offset_of_U3CU3Ef__amU24cache1_1() { return static_cast<int32_t>(offsetof(VectorTileExtensions_t4243590528_StaticFields, ___U3CU3Ef__amU24cache1_1)); }
inline Func_2_t3663939823 * get_U3CU3Ef__amU24cache1_1() const { return ___U3CU3Ef__amU24cache1_1; }
inline Func_2_t3663939823 ** get_address_of_U3CU3Ef__amU24cache1_1() { return &___U3CU3Ef__amU24cache1_1; }
inline void set_U3CU3Ef__amU24cache1_1(Func_2_t3663939823 * value)
{
___U3CU3Ef__amU24cache1_1 = value;
Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache1_1), value);
}
inline static int32_t get_offset_of_U3CU3Ef__amU24cache2_2() { return static_cast<int32_t>(offsetof(VectorTileExtensions_t4243590528_StaticFields, ___U3CU3Ef__amU24cache2_2)); }
inline Func_2_t3663939823 * get_U3CU3Ef__amU24cache2_2() const { return ___U3CU3Ef__amU24cache2_2; }
inline Func_2_t3663939823 ** get_address_of_U3CU3Ef__amU24cache2_2() { return &___U3CU3Ef__amU24cache2_2; }
inline void set_U3CU3Ef__amU24cache2_2(Func_2_t3663939823 * value)
{
___U3CU3Ef__amU24cache2_2 = value;
Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache2_2), value);
}
inline static int32_t get_offset_of_U3CU3Ef__amU24cache3_3() { return static_cast<int32_t>(offsetof(VectorTileExtensions_t4243590528_StaticFields, ___U3CU3Ef__amU24cache3_3)); }
inline Func_2_t3663939823 * get_U3CU3Ef__amU24cache3_3() const { return ___U3CU3Ef__amU24cache3_3; }
inline Func_2_t3663939823 ** get_address_of_U3CU3Ef__amU24cache3_3() { return &___U3CU3Ef__amU24cache3_3; }
inline void set_U3CU3Ef__amU24cache3_3(Func_2_t3663939823 * value)
{
___U3CU3Ef__amU24cache3_3 = value;
Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache3_3), value);
}
inline static int32_t get_offset_of_U3CU3Ef__amU24cache4_4() { return static_cast<int32_t>(offsetof(VectorTileExtensions_t4243590528_StaticFields, ___U3CU3Ef__amU24cache4_4)); }
inline Func_2_t3663939823 * get_U3CU3Ef__amU24cache4_4() const { return ___U3CU3Ef__amU24cache4_4; }
inline Func_2_t3663939823 ** get_address_of_U3CU3Ef__amU24cache4_4() { return &___U3CU3Ef__amU24cache4_4; }
inline void set_U3CU3Ef__amU24cache4_4(Func_2_t3663939823 * value)
{
___U3CU3Ef__amU24cache4_4 = value;
Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache4_4), value);
}
inline static int32_t get_offset_of_U3CU3Ef__amU24cache5_5() { return static_cast<int32_t>(offsetof(VectorTileExtensions_t4243590528_StaticFields, ___U3CU3Ef__amU24cache5_5)); }
inline Func_2_t3663939823 * get_U3CU3Ef__amU24cache5_5() const { return ___U3CU3Ef__amU24cache5_5; }
inline Func_2_t3663939823 ** get_address_of_U3CU3Ef__amU24cache5_5() { return &___U3CU3Ef__amU24cache5_5; }
inline void set_U3CU3Ef__amU24cache5_5(Func_2_t3663939823 * value)
{
___U3CU3Ef__amU24cache5_5 = value;
Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache5_5), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VECTORTILEEXTENSIONS_T4243590528_H
#ifndef CONSTANTS_T3518929206_H
#define CONSTANTS_T3518929206_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Utils.Constants
struct Constants_t3518929206 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CONSTANTS_T3518929206_H
#ifndef CUSTOMCREATIONCONVERTER_1_T1604133405_H
#define CUSTOMCREATIONCONVERTER_1_T1604133405_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Json.Converters.CustomCreationConverter`1<System.Collections.Generic.List`1<Mapbox.Utils.Vector2d>>
struct CustomCreationConverter_1_t1604133405 : public JsonConverter_t472504469
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CUSTOMCREATIONCONVERTER_1_T1604133405_H
#ifndef MATHD_T279629051_H
#define MATHD_T279629051_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Utils.Mathd
struct Mathd_t279629051
{
public:
union
{
struct
{
};
uint8_t Mathd_t279629051__padding[1];
};
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MATHD_T279629051_H
#ifndef VECTOR2D_T1865246568_H
#define VECTOR2D_T1865246568_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Utils.Vector2d
struct Vector2d_t1865246568
{
public:
// System.Double Mapbox.Utils.Vector2d::x
double ___x_1;
// System.Double Mapbox.Utils.Vector2d::y
double ___y_2;
public:
inline static int32_t get_offset_of_x_1() { return static_cast<int32_t>(offsetof(Vector2d_t1865246568, ___x_1)); }
inline double get_x_1() const { return ___x_1; }
inline double* get_address_of_x_1() { return &___x_1; }
inline void set_x_1(double value)
{
___x_1 = value;
}
inline static int32_t get_offset_of_y_2() { return static_cast<int32_t>(offsetof(Vector2d_t1865246568, ___y_2)); }
inline double get_y_2() const { return ___y_2; }
inline double* get_address_of_y_2() { return &___y_2; }
inline void set_y_2(double value)
{
___y_2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VECTOR2D_T1865246568_H
#ifndef VECTOR3_T3722313464_H
#define VECTOR3_T3722313464_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Vector3
struct Vector3_t3722313464
{
public:
// System.Single UnityEngine.Vector3::x
float ___x_1;
// System.Single UnityEngine.Vector3::y
float ___y_2;
// System.Single UnityEngine.Vector3::z
float ___z_3;
public:
inline static int32_t get_offset_of_x_1() { return static_cast<int32_t>(offsetof(Vector3_t3722313464, ___x_1)); }
inline float get_x_1() const { return ___x_1; }
inline float* get_address_of_x_1() { return &___x_1; }
inline void set_x_1(float value)
{
___x_1 = value;
}
inline static int32_t get_offset_of_y_2() { return static_cast<int32_t>(offsetof(Vector3_t3722313464, ___y_2)); }
inline float get_y_2() const { return ___y_2; }
inline float* get_address_of_y_2() { return &___y_2; }
inline void set_y_2(float value)
{
___y_2 = value;
}
inline static int32_t get_offset_of_z_3() { return static_cast<int32_t>(offsetof(Vector3_t3722313464, ___z_3)); }
inline float get_z_3() const { return ___z_3; }
inline float* get_address_of_z_3() { return &___z_3; }
inline void set_z_3(float value)
{
___z_3 = value;
}
};
struct Vector3_t3722313464_StaticFields
{
public:
// UnityEngine.Vector3 UnityEngine.Vector3::zeroVector
Vector3_t3722313464 ___zeroVector_4;
// UnityEngine.Vector3 UnityEngine.Vector3::oneVector
Vector3_t3722313464 ___oneVector_5;
// UnityEngine.Vector3 UnityEngine.Vector3::upVector
Vector3_t3722313464 ___upVector_6;
// UnityEngine.Vector3 UnityEngine.Vector3::downVector
Vector3_t3722313464 ___downVector_7;
// UnityEngine.Vector3 UnityEngine.Vector3::leftVector
Vector3_t3722313464 ___leftVector_8;
// UnityEngine.Vector3 UnityEngine.Vector3::rightVector
Vector3_t3722313464 ___rightVector_9;
// UnityEngine.Vector3 UnityEngine.Vector3::forwardVector
Vector3_t3722313464 ___forwardVector_10;
// UnityEngine.Vector3 UnityEngine.Vector3::backVector
Vector3_t3722313464 ___backVector_11;
// UnityEngine.Vector3 UnityEngine.Vector3::positiveInfinityVector
Vector3_t3722313464 ___positiveInfinityVector_12;
// UnityEngine.Vector3 UnityEngine.Vector3::negativeInfinityVector
Vector3_t3722313464 ___negativeInfinityVector_13;
public:
inline static int32_t get_offset_of_zeroVector_4() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___zeroVector_4)); }
inline Vector3_t3722313464 get_zeroVector_4() const { return ___zeroVector_4; }
inline Vector3_t3722313464 * get_address_of_zeroVector_4() { return &___zeroVector_4; }
inline void set_zeroVector_4(Vector3_t3722313464 value)
{
___zeroVector_4 = value;
}
inline static int32_t get_offset_of_oneVector_5() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___oneVector_5)); }
inline Vector3_t3722313464 get_oneVector_5() const { return ___oneVector_5; }
inline Vector3_t3722313464 * get_address_of_oneVector_5() { return &___oneVector_5; }
inline void set_oneVector_5(Vector3_t3722313464 value)
{
___oneVector_5 = value;
}
inline static int32_t get_offset_of_upVector_6() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___upVector_6)); }
inline Vector3_t3722313464 get_upVector_6() const { return ___upVector_6; }
inline Vector3_t3722313464 * get_address_of_upVector_6() { return &___upVector_6; }
inline void set_upVector_6(Vector3_t3722313464 value)
{
___upVector_6 = value;
}
inline static int32_t get_offset_of_downVector_7() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___downVector_7)); }
inline Vector3_t3722313464 get_downVector_7() const { return ___downVector_7; }
inline Vector3_t3722313464 * get_address_of_downVector_7() { return &___downVector_7; }
inline void set_downVector_7(Vector3_t3722313464 value)
{
___downVector_7 = value;
}
inline static int32_t get_offset_of_leftVector_8() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___leftVector_8)); }
inline Vector3_t3722313464 get_leftVector_8() const { return ___leftVector_8; }
inline Vector3_t3722313464 * get_address_of_leftVector_8() { return &___leftVector_8; }
inline void set_leftVector_8(Vector3_t3722313464 value)
{
___leftVector_8 = value;
}
inline static int32_t get_offset_of_rightVector_9() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___rightVector_9)); }
inline Vector3_t3722313464 get_rightVector_9() const { return ___rightVector_9; }
inline Vector3_t3722313464 * get_address_of_rightVector_9() { return &___rightVector_9; }
inline void set_rightVector_9(Vector3_t3722313464 value)
{
___rightVector_9 = value;
}
inline static int32_t get_offset_of_forwardVector_10() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___forwardVector_10)); }
inline Vector3_t3722313464 get_forwardVector_10() const { return ___forwardVector_10; }
inline Vector3_t3722313464 * get_address_of_forwardVector_10() { return &___forwardVector_10; }
inline void set_forwardVector_10(Vector3_t3722313464 value)
{
___forwardVector_10 = value;
}
inline static int32_t get_offset_of_backVector_11() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___backVector_11)); }
inline Vector3_t3722313464 get_backVector_11() const { return ___backVector_11; }
inline Vector3_t3722313464 * get_address_of_backVector_11() { return &___backVector_11; }
inline void set_backVector_11(Vector3_t3722313464 value)
{
___backVector_11 = value;
}
inline static int32_t get_offset_of_positiveInfinityVector_12() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___positiveInfinityVector_12)); }
inline Vector3_t3722313464 get_positiveInfinityVector_12() const { return ___positiveInfinityVector_12; }
inline Vector3_t3722313464 * get_address_of_positiveInfinityVector_12() { return &___positiveInfinityVector_12; }
inline void set_positiveInfinityVector_12(Vector3_t3722313464 value)
{
___positiveInfinityVector_12 = value;
}
inline static int32_t get_offset_of_negativeInfinityVector_13() { return static_cast<int32_t>(offsetof(Vector3_t3722313464_StaticFields, ___negativeInfinityVector_13)); }
inline Vector3_t3722313464 get_negativeInfinityVector_13() const { return ___negativeInfinityVector_13; }
inline Vector3_t3722313464 * get_address_of_negativeInfinityVector_13() { return &___negativeInfinityVector_13; }
inline void set_negativeInfinityVector_13(Vector3_t3722313464 value)
{
___negativeInfinityVector_13 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VECTOR3_T3722313464_H
#ifndef QUATERNION_T2301928331_H
#define QUATERNION_T2301928331_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Quaternion
struct Quaternion_t2301928331
{
public:
// System.Single UnityEngine.Quaternion::x
float ___x_0;
// System.Single UnityEngine.Quaternion::y
float ___y_1;
// System.Single UnityEngine.Quaternion::z
float ___z_2;
// System.Single UnityEngine.Quaternion::w
float ___w_3;
public:
inline static int32_t get_offset_of_x_0() { return static_cast<int32_t>(offsetof(Quaternion_t2301928331, ___x_0)); }
inline float get_x_0() const { return ___x_0; }
inline float* get_address_of_x_0() { return &___x_0; }
inline void set_x_0(float value)
{
___x_0 = value;
}
inline static int32_t get_offset_of_y_1() { return static_cast<int32_t>(offsetof(Quaternion_t2301928331, ___y_1)); }
inline float get_y_1() const { return ___y_1; }
inline float* get_address_of_y_1() { return &___y_1; }
inline void set_y_1(float value)
{
___y_1 = value;
}
inline static int32_t get_offset_of_z_2() { return static_cast<int32_t>(offsetof(Quaternion_t2301928331, ___z_2)); }
inline float get_z_2() const { return ___z_2; }
inline float* get_address_of_z_2() { return &___z_2; }
inline void set_z_2(float value)
{
___z_2 = value;
}
inline static int32_t get_offset_of_w_3() { return static_cast<int32_t>(offsetof(Quaternion_t2301928331, ___w_3)); }
inline float get_w_3() const { return ___w_3; }
inline float* get_address_of_w_3() { return &___w_3; }
inline void set_w_3(float value)
{
___w_3 = value;
}
};
struct Quaternion_t2301928331_StaticFields
{
public:
// UnityEngine.Quaternion UnityEngine.Quaternion::identityQuaternion
Quaternion_t2301928331 ___identityQuaternion_4;
public:
inline static int32_t get_offset_of_identityQuaternion_4() { return static_cast<int32_t>(offsetof(Quaternion_t2301928331_StaticFields, ___identityQuaternion_4)); }
inline Quaternion_t2301928331 get_identityQuaternion_4() const { return ___identityQuaternion_4; }
inline Quaternion_t2301928331 * get_address_of_identityQuaternion_4() { return &___identityQuaternion_4; }
inline void set_identityQuaternion_4(Quaternion_t2301928331 value)
{
___identityQuaternion_4 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // QUATERNION_T2301928331_H
#ifndef LATLNG_T1304626312_H
#define LATLNG_T1304626312_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.LatLng
struct LatLng_t1304626312
{
public:
union
{
struct
{
// System.Double Mapbox.VectorTile.Geometry.LatLng::<Lat>k__BackingField
double ___U3CLatU3Ek__BackingField_0;
// System.Double Mapbox.VectorTile.Geometry.LatLng::<Lng>k__BackingField
double ___U3CLngU3Ek__BackingField_1;
};
uint8_t LatLng_t1304626312__padding[1];
};
public:
inline static int32_t get_offset_of_U3CLatU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(LatLng_t1304626312, ___U3CLatU3Ek__BackingField_0)); }
inline double get_U3CLatU3Ek__BackingField_0() const { return ___U3CLatU3Ek__BackingField_0; }
inline double* get_address_of_U3CLatU3Ek__BackingField_0() { return &___U3CLatU3Ek__BackingField_0; }
inline void set_U3CLatU3Ek__BackingField_0(double value)
{
___U3CLatU3Ek__BackingField_0 = value;
}
inline static int32_t get_offset_of_U3CLngU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(LatLng_t1304626312, ___U3CLngU3Ek__BackingField_1)); }
inline double get_U3CLngU3Ek__BackingField_1() const { return ___U3CLngU3Ek__BackingField_1; }
inline double* get_address_of_U3CLngU3Ek__BackingField_1() { return &___U3CLngU3Ek__BackingField_1; }
inline void set_U3CLngU3Ek__BackingField_1(double value)
{
___U3CLngU3Ek__BackingField_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // LATLNG_T1304626312_H
#ifndef COLOR_T2555686324_H
#define COLOR_T2555686324_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Color
struct Color_t2555686324
{
public:
// System.Single UnityEngine.Color::r
float ___r_0;
// System.Single UnityEngine.Color::g
float ___g_1;
// System.Single UnityEngine.Color::b
float ___b_2;
// System.Single UnityEngine.Color::a
float ___a_3;
public:
inline static int32_t get_offset_of_r_0() { return static_cast<int32_t>(offsetof(Color_t2555686324, ___r_0)); }
inline float get_r_0() const { return ___r_0; }
inline float* get_address_of_r_0() { return &___r_0; }
inline void set_r_0(float value)
{
___r_0 = value;
}
inline static int32_t get_offset_of_g_1() { return static_cast<int32_t>(offsetof(Color_t2555686324, ___g_1)); }
inline float get_g_1() const { return ___g_1; }
inline float* get_address_of_g_1() { return &___g_1; }
inline void set_g_1(float value)
{
___g_1 = value;
}
inline static int32_t get_offset_of_b_2() { return static_cast<int32_t>(offsetof(Color_t2555686324, ___b_2)); }
inline float get_b_2() const { return ___b_2; }
inline float* get_address_of_b_2() { return &___b_2; }
inline void set_b_2(float value)
{
___b_2 = value;
}
inline static int32_t get_offset_of_a_3() { return static_cast<int32_t>(offsetof(Color_t2555686324, ___a_3)); }
inline float get_a_3() const { return ___a_3; }
inline float* get_address_of_a_3() { return &___a_3; }
inline void set_a_3(float value)
{
___a_3 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // COLOR_T2555686324_H
#ifndef CUSTOMCREATIONCONVERTER_1_T132058663_H
#define CUSTOMCREATIONCONVERTER_1_T132058663_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Json.Converters.CustomCreationConverter`1<Mapbox.Utils.Vector2d>
struct CustomCreationConverter_1_t132058663 : public JsonConverter_t472504469
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CUSTOMCREATIONCONVERTER_1_T132058663_H
#ifndef CUSTOMCREATIONCONVERTER_1_T241653040_H
#define CUSTOMCREATIONCONVERTER_1_T241653040_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Json.Converters.CustomCreationConverter`1<Mapbox.Utils.Vector2dBounds>
struct CustomCreationConverter_1_t241653040 : public JsonConverter_t472504469
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CUSTOMCREATIONCONVERTER_1_T241653040_H
#ifndef ENUM_T4135868527_H
#define ENUM_T4135868527_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Enum
struct Enum_t4135868527 : public ValueType_t3640485471
{
public:
public:
};
struct Enum_t4135868527_StaticFields
{
public:
// System.Char[] System.Enum::split_char
CharU5BU5D_t3528271667* ___split_char_0;
public:
inline static int32_t get_offset_of_split_char_0() { return static_cast<int32_t>(offsetof(Enum_t4135868527_StaticFields, ___split_char_0)); }
inline CharU5BU5D_t3528271667* get_split_char_0() const { return ___split_char_0; }
inline CharU5BU5D_t3528271667** get_address_of_split_char_0() { return &___split_char_0; }
inline void set_split_char_0(CharU5BU5D_t3528271667* value)
{
___split_char_0 = value;
Il2CppCodeGenWriteBarrier((&___split_char_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.Enum
struct Enum_t4135868527_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.Enum
struct Enum_t4135868527_marshaled_com
{
};
#endif // ENUM_T4135868527_H
#ifndef INTPTR_T_H
#define INTPTR_T_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.IntPtr
struct IntPtr_t
{
public:
// System.Void* System.IntPtr::m_value
void* ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(IntPtr_t, ___m_value_0)); }
inline void* get_m_value_0() const { return ___m_value_0; }
inline void** get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(void* value)
{
___m_value_0 = value;
}
};
struct IntPtr_t_StaticFields
{
public:
// System.IntPtr System.IntPtr::Zero
intptr_t ___Zero_1;
public:
inline static int32_t get_offset_of_Zero_1() { return static_cast<int32_t>(offsetof(IntPtr_t_StaticFields, ___Zero_1)); }
inline intptr_t get_Zero_1() const { return ___Zero_1; }
inline intptr_t* get_address_of_Zero_1() { return &___Zero_1; }
inline void set_Zero_1(intptr_t value)
{
___Zero_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INTPTR_T_H
#ifndef NULLABLE_1_T4282624060_H
#define NULLABLE_1_T4282624060_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Nullable`1<System.UInt32>
struct Nullable_1_t4282624060
{
public:
// T System.Nullable`1::value
uint32_t ___value_0;
// System.Boolean System.Nullable`1::has_value
bool ___has_value_1;
public:
inline static int32_t get_offset_of_value_0() { return static_cast<int32_t>(offsetof(Nullable_1_t4282624060, ___value_0)); }
inline uint32_t get_value_0() const { return ___value_0; }
inline uint32_t* get_address_of_value_0() { return &___value_0; }
inline void set_value_0(uint32_t value)
{
___value_0 = value;
}
inline static int32_t get_offset_of_has_value_1() { return static_cast<int32_t>(offsetof(Nullable_1_t4282624060, ___has_value_1)); }
inline bool get_has_value_1() const { return ___has_value_1; }
inline bool* get_address_of_has_value_1() { return &___has_value_1; }
inline void set_has_value_1(bool value)
{
___has_value_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // NULLABLE_1_T4282624060_H
#ifndef NULLABLE_1_T3119828856_H
#define NULLABLE_1_T3119828856_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Nullable`1<System.Single>
struct Nullable_1_t3119828856
{
public:
// T System.Nullable`1::value
float ___value_0;
// System.Boolean System.Nullable`1::has_value
bool ___has_value_1;
public:
inline static int32_t get_offset_of_value_0() { return static_cast<int32_t>(offsetof(Nullable_1_t3119828856, ___value_0)); }
inline float get_value_0() const { return ___value_0; }
inline float* get_address_of_value_0() { return &___value_0; }
inline void set_value_0(float value)
{
___value_0 = value;
}
inline static int32_t get_offset_of_has_value_1() { return static_cast<int32_t>(offsetof(Nullable_1_t3119828856, ___has_value_1)); }
inline bool get_has_value_1() const { return ___has_value_1; }
inline bool* get_address_of_has_value_1() { return &___has_value_1; }
inline void set_has_value_1(bool value)
{
___has_value_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // NULLABLE_1_T3119828856_H
#ifndef INTPOINT_T2327573135_H
#define INTPOINT_T2327573135_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint
struct IntPoint_t2327573135
{
public:
// System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint::X
int64_t ___X_0;
// System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint::Y
int64_t ___Y_1;
public:
inline static int32_t get_offset_of_X_0() { return static_cast<int32_t>(offsetof(IntPoint_t2327573135, ___X_0)); }
inline int64_t get_X_0() const { return ___X_0; }
inline int64_t* get_address_of_X_0() { return &___X_0; }
inline void set_X_0(int64_t value)
{
___X_0 = value;
}
inline static int32_t get_offset_of_Y_1() { return static_cast<int32_t>(offsetof(IntPoint_t2327573135, ___Y_1)); }
inline int64_t get_Y_1() const { return ___Y_1; }
inline int64_t* get_address_of_Y_1() { return &___Y_1; }
inline void set_Y_1(int64_t value)
{
___Y_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INTPOINT_T2327573135_H
#ifndef INTRECT_T752847524_H
#define INTRECT_T752847524_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntRect
struct IntRect_t752847524
{
public:
// System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntRect::left
int64_t ___left_0;
// System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntRect::top
int64_t ___top_1;
// System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntRect::right
int64_t ___right_2;
// System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntRect::bottom
int64_t ___bottom_3;
public:
inline static int32_t get_offset_of_left_0() { return static_cast<int32_t>(offsetof(IntRect_t752847524, ___left_0)); }
inline int64_t get_left_0() const { return ___left_0; }
inline int64_t* get_address_of_left_0() { return &___left_0; }
inline void set_left_0(int64_t value)
{
___left_0 = value;
}
inline static int32_t get_offset_of_top_1() { return static_cast<int32_t>(offsetof(IntRect_t752847524, ___top_1)); }
inline int64_t get_top_1() const { return ___top_1; }
inline int64_t* get_address_of_top_1() { return &___top_1; }
inline void set_top_1(int64_t value)
{
___top_1 = value;
}
inline static int32_t get_offset_of_right_2() { return static_cast<int32_t>(offsetof(IntRect_t752847524, ___right_2)); }
inline int64_t get_right_2() const { return ___right_2; }
inline int64_t* get_address_of_right_2() { return &___right_2; }
inline void set_right_2(int64_t value)
{
___right_2 = value;
}
inline static int32_t get_offset_of_bottom_3() { return static_cast<int32_t>(offsetof(IntRect_t752847524, ___bottom_3)); }
inline int64_t get_bottom_3() const { return ___bottom_3; }
inline int64_t* get_address_of_bottom_3() { return &___bottom_3; }
inline void set_bottom_3(int64_t value)
{
___bottom_3 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INTRECT_T752847524_H
#ifndef INT128_T2615162842_H
#define INT128_T2615162842_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Int128
struct Int128_t2615162842
{
public:
// System.Int64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Int128::hi
int64_t ___hi_0;
// System.UInt64 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Int128::lo
uint64_t ___lo_1;
public:
inline static int32_t get_offset_of_hi_0() { return static_cast<int32_t>(offsetof(Int128_t2615162842, ___hi_0)); }
inline int64_t get_hi_0() const { return ___hi_0; }
inline int64_t* get_address_of_hi_0() { return &___hi_0; }
inline void set_hi_0(int64_t value)
{
___hi_0 = value;
}
inline static int32_t get_offset_of_lo_1() { return static_cast<int32_t>(offsetof(Int128_t2615162842, ___lo_1)); }
inline uint64_t get_lo_1() const { return ___lo_1; }
inline uint64_t* get_address_of_lo_1() { return &___lo_1; }
inline void set_lo_1(uint64_t value)
{
___lo_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INT128_T2615162842_H
#ifndef DOUBLEPOINT_T1607927371_H
#define DOUBLEPOINT_T1607927371_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/DoublePoint
struct DoublePoint_t1607927371
{
public:
// System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/DoublePoint::X
double ___X_0;
// System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/DoublePoint::Y
double ___Y_1;
public:
inline static int32_t get_offset_of_X_0() { return static_cast<int32_t>(offsetof(DoublePoint_t1607927371, ___X_0)); }
inline double get_X_0() const { return ___X_0; }
inline double* get_address_of_X_0() { return &___X_0; }
inline void set_X_0(double value)
{
___X_0 = value;
}
inline static int32_t get_offset_of_Y_1() { return static_cast<int32_t>(offsetof(DoublePoint_t1607927371, ___Y_1)); }
inline double get_Y_1() const { return ___Y_1; }
inline double* get_address_of_Y_1() { return &___Y_1; }
inline void set_Y_1(double value)
{
___Y_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DOUBLEPOINT_T1607927371_H
#ifndef CLIPPEREXCEPTION_T3118674656_H
#define CLIPPEREXCEPTION_T3118674656_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperException
struct ClipperException_t3118674656 : public Exception_t
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CLIPPEREXCEPTION_T3118674656_H
#ifndef NODETYPE_T363087472_H
#define NODETYPE_T363087472_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper/NodeType
struct NodeType_t363087472
{
public:
// System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper/NodeType::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(NodeType_t363087472, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // NODETYPE_T363087472_H
#ifndef INTERSECTNODE_T3379514219_H
#define INTERSECTNODE_T3379514219_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntersectNode
struct IntersectNode_t3379514219 : public RuntimeObject
{
public:
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntersectNode::Edge1
TEdge_t1694054893 * ___Edge1_0;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntersectNode::Edge2
TEdge_t1694054893 * ___Edge2_1;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntersectNode::Pt
IntPoint_t2327573135 ___Pt_2;
public:
inline static int32_t get_offset_of_Edge1_0() { return static_cast<int32_t>(offsetof(IntersectNode_t3379514219, ___Edge1_0)); }
inline TEdge_t1694054893 * get_Edge1_0() const { return ___Edge1_0; }
inline TEdge_t1694054893 ** get_address_of_Edge1_0() { return &___Edge1_0; }
inline void set_Edge1_0(TEdge_t1694054893 * value)
{
___Edge1_0 = value;
Il2CppCodeGenWriteBarrier((&___Edge1_0), value);
}
inline static int32_t get_offset_of_Edge2_1() { return static_cast<int32_t>(offsetof(IntersectNode_t3379514219, ___Edge2_1)); }
inline TEdge_t1694054893 * get_Edge2_1() const { return ___Edge2_1; }
inline TEdge_t1694054893 ** get_address_of_Edge2_1() { return &___Edge2_1; }
inline void set_Edge2_1(TEdge_t1694054893 * value)
{
___Edge2_1 = value;
Il2CppCodeGenWriteBarrier((&___Edge2_1), value);
}
inline static int32_t get_offset_of_Pt_2() { return static_cast<int32_t>(offsetof(IntersectNode_t3379514219, ___Pt_2)); }
inline IntPoint_t2327573135 get_Pt_2() const { return ___Pt_2; }
inline IntPoint_t2327573135 * get_address_of_Pt_2() { return &___Pt_2; }
inline void set_Pt_2(IntPoint_t2327573135 value)
{
___Pt_2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INTERSECTNODE_T3379514219_H
#ifndef BBOXTOVECTOR2DBOUNDSCONVERTER_T1118841236_H
#define BBOXTOVECTOR2DBOUNDSCONVERTER_T1118841236_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Utils.JsonConverters.BboxToVector2dBoundsConverter
struct BboxToVector2dBoundsConverter_t1118841236 : public CustomCreationConverter_1_t241653040
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // BBOXTOVECTOR2DBOUNDSCONVERTER_T1118841236_H
#ifndef POLYLINETOVECTOR2DLISTCONVERTER_T1416161534_H
#define POLYLINETOVECTOR2DLISTCONVERTER_T1416161534_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Utils.JsonConverters.PolylineToVector2dListConverter
struct PolylineToVector2dListConverter_t1416161534 : public CustomCreationConverter_1_t1604133405
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // POLYLINETOVECTOR2DLISTCONVERTER_T1416161534_H
#ifndef GEOMTYPE_T3056663235_H
#define GEOMTYPE_T3056663235_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.GeomType
struct GeomType_t3056663235
{
public:
// System.Int32 Mapbox.VectorTile.Geometry.GeomType::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(GeomType_t3056663235, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // GEOMTYPE_T3056663235_H
#ifndef VOXELCOLORMAPPER_T2180346717_H
#define VOXELCOLORMAPPER_T2180346717_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.Voxels.VoxelColorMapper
struct VoxelColorMapper_t2180346717 : public RuntimeObject
{
public:
// UnityEngine.Color Mapbox.Examples.Voxels.VoxelColorMapper::Color
Color_t2555686324 ___Color_0;
// UnityEngine.GameObject Mapbox.Examples.Voxels.VoxelColorMapper::Voxel
GameObject_t1113636619 * ___Voxel_1;
public:
inline static int32_t get_offset_of_Color_0() { return static_cast<int32_t>(offsetof(VoxelColorMapper_t2180346717, ___Color_0)); }
inline Color_t2555686324 get_Color_0() const { return ___Color_0; }
inline Color_t2555686324 * get_address_of_Color_0() { return &___Color_0; }
inline void set_Color_0(Color_t2555686324 value)
{
___Color_0 = value;
}
inline static int32_t get_offset_of_Voxel_1() { return static_cast<int32_t>(offsetof(VoxelColorMapper_t2180346717, ___Voxel_1)); }
inline GameObject_t1113636619 * get_Voxel_1() const { return ___Voxel_1; }
inline GameObject_t1113636619 ** get_address_of_Voxel_1() { return &___Voxel_1; }
inline void set_Voxel_1(GameObject_t1113636619 * value)
{
___Voxel_1 = value;
Il2CppCodeGenWriteBarrier((&___Voxel_1), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VOXELCOLORMAPPER_T2180346717_H
#ifndef VOXELDATA_T2248882184_H
#define VOXELDATA_T2248882184_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.Voxels.VoxelData
struct VoxelData_t2248882184 : public RuntimeObject
{
public:
// UnityEngine.Vector3 Mapbox.Examples.Voxels.VoxelData::Position
Vector3_t3722313464 ___Position_0;
// UnityEngine.GameObject Mapbox.Examples.Voxels.VoxelData::Prefab
GameObject_t1113636619 * ___Prefab_1;
public:
inline static int32_t get_offset_of_Position_0() { return static_cast<int32_t>(offsetof(VoxelData_t2248882184, ___Position_0)); }
inline Vector3_t3722313464 get_Position_0() const { return ___Position_0; }
inline Vector3_t3722313464 * get_address_of_Position_0() { return &___Position_0; }
inline void set_Position_0(Vector3_t3722313464 value)
{
___Position_0 = value;
}
inline static int32_t get_offset_of_Prefab_1() { return static_cast<int32_t>(offsetof(VoxelData_t2248882184, ___Prefab_1)); }
inline GameObject_t1113636619 * get_Prefab_1() const { return ___Prefab_1; }
inline GameObject_t1113636619 ** get_address_of_Prefab_1() { return &___Prefab_1; }
inline void set_Prefab_1(GameObject_t1113636619 * value)
{
___Prefab_1 = value;
Il2CppCodeGenWriteBarrier((&___Prefab_1), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VOXELDATA_T2248882184_H
#ifndef CLIPTYPE_T1616702040_H
#define CLIPTYPE_T1616702040_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipType
struct ClipType_t1616702040
{
public:
// System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipType::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(ClipType_t1616702040, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CLIPTYPE_T1616702040_H
#ifndef EDGESIDE_T2739901735_H
#define EDGESIDE_T2739901735_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/EdgeSide
struct EdgeSide_t2739901735
{
public:
// System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/EdgeSide::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(EdgeSide_t2739901735, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // EDGESIDE_T2739901735_H
#ifndef VECTOR2DBOUNDS_T1974840945_H
#define VECTOR2DBOUNDS_T1974840945_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Utils.Vector2dBounds
struct Vector2dBounds_t1974840945
{
public:
// Mapbox.Utils.Vector2d Mapbox.Utils.Vector2dBounds::SouthWest
Vector2d_t1865246568 ___SouthWest_0;
// Mapbox.Utils.Vector2d Mapbox.Utils.Vector2dBounds::NorthEast
Vector2d_t1865246568 ___NorthEast_1;
public:
inline static int32_t get_offset_of_SouthWest_0() { return static_cast<int32_t>(offsetof(Vector2dBounds_t1974840945, ___SouthWest_0)); }
inline Vector2d_t1865246568 get_SouthWest_0() const { return ___SouthWest_0; }
inline Vector2d_t1865246568 * get_address_of_SouthWest_0() { return &___SouthWest_0; }
inline void set_SouthWest_0(Vector2d_t1865246568 value)
{
___SouthWest_0 = value;
}
inline static int32_t get_offset_of_NorthEast_1() { return static_cast<int32_t>(offsetof(Vector2dBounds_t1974840945, ___NorthEast_1)); }
inline Vector2d_t1865246568 get_NorthEast_1() const { return ___NorthEast_1; }
inline Vector2d_t1865246568 * get_address_of_NorthEast_1() { return &___NorthEast_1; }
inline void set_NorthEast_1(Vector2d_t1865246568 value)
{
___NorthEast_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VECTOR2DBOUNDS_T1974840945_H
#ifndef ENDTYPE_T3515135373_H
#define ENDTYPE_T3515135373_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/EndType
struct EndType_t3515135373
{
public:
// System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/EndType::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(EndType_t3515135373, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ENDTYPE_T3515135373_H
#ifndef JOINTYPE_T3449044149_H
#define JOINTYPE_T3449044149_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/JoinType
struct JoinType_t3449044149
{
public:
// System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/JoinType::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(JoinType_t3449044149, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // JOINTYPE_T3449044149_H
#ifndef PROFILE_T1584301659_H
#define PROFILE_T1584301659_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.MapMatching.Profile
struct Profile_t1584301659
{
public:
// System.Int32 Mapbox.MapMatching.Profile::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(Profile_t1584301659, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // PROFILE_T1584301659_H
#ifndef POLYFILLTYPE_T2091732334_H
#define POLYFILLTYPE_T2091732334_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyFillType
struct PolyFillType_t2091732334
{
public:
// System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyFillType::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(PolyFillType_t2091732334, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // POLYFILLTYPE_T2091732334_H
#ifndef POLYTYPE_T1741373358_H
#define POLYTYPE_T1741373358_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyType
struct PolyType_t1741373358
{
public:
// System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyType::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(PolyType_t1741373358, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // POLYTYPE_T1741373358_H
#ifndef LONLATTOVECTOR2DCONVERTER_T2933574141_H
#define LONLATTOVECTOR2DCONVERTER_T2933574141_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Utils.JsonConverters.LonLatToVector2dConverter
struct LonLatToVector2dConverter_t2933574141 : public CustomCreationConverter_1_t132058663
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // LONLATTOVECTOR2DCONVERTER_T2933574141_H
#ifndef JOIN_T2349011362_H
#define JOIN_T2349011362_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Join
struct Join_t2349011362 : public RuntimeObject
{
public:
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Join::OutPt1
OutPt_t2591102706 * ___OutPt1_0;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Join::OutPt2
OutPt_t2591102706 * ___OutPt2_1;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Join::OffPt
IntPoint_t2327573135 ___OffPt_2;
public:
inline static int32_t get_offset_of_OutPt1_0() { return static_cast<int32_t>(offsetof(Join_t2349011362, ___OutPt1_0)); }
inline OutPt_t2591102706 * get_OutPt1_0() const { return ___OutPt1_0; }
inline OutPt_t2591102706 ** get_address_of_OutPt1_0() { return &___OutPt1_0; }
inline void set_OutPt1_0(OutPt_t2591102706 * value)
{
___OutPt1_0 = value;
Il2CppCodeGenWriteBarrier((&___OutPt1_0), value);
}
inline static int32_t get_offset_of_OutPt2_1() { return static_cast<int32_t>(offsetof(Join_t2349011362, ___OutPt2_1)); }
inline OutPt_t2591102706 * get_OutPt2_1() const { return ___OutPt2_1; }
inline OutPt_t2591102706 ** get_address_of_OutPt2_1() { return &___OutPt2_1; }
inline void set_OutPt2_1(OutPt_t2591102706 * value)
{
___OutPt2_1 = value;
Il2CppCodeGenWriteBarrier((&___OutPt2_1), value);
}
inline static int32_t get_offset_of_OffPt_2() { return static_cast<int32_t>(offsetof(Join_t2349011362, ___OffPt_2)); }
inline IntPoint_t2327573135 get_OffPt_2() const { return ___OffPt_2; }
inline IntPoint_t2327573135 * get_address_of_OffPt_2() { return &___OffPt_2; }
inline void set_OffPt_2(IntPoint_t2327573135 value)
{
___OffPt_2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // JOIN_T2349011362_H
#ifndef VALUETYPE_T2776630785_H
#define VALUETYPE_T2776630785_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Contants.ValueType
struct ValueType_t2776630785
{
public:
// System.Int32 Mapbox.VectorTile.Contants.ValueType::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(ValueType_t2776630785, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VALUETYPE_T2776630785_H
#ifndef FEATURETYPE_T2360609914_H
#define FEATURETYPE_T2360609914_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Contants.FeatureType
struct FeatureType_t2360609914
{
public:
// System.Int32 Mapbox.VectorTile.Contants.FeatureType::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(FeatureType_t2360609914, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // FEATURETYPE_T2360609914_H
#ifndef LAYERTYPE_T1746409905_H
#define LAYERTYPE_T1746409905_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Contants.LayerType
struct LayerType_t1746409905
{
public:
// System.Int32 Mapbox.VectorTile.Contants.LayerType::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(LayerType_t1746409905, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // LAYERTYPE_T1746409905_H
#ifndef TILETYPE_T3106966029_H
#define TILETYPE_T3106966029_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Contants.TileType
struct TileType_t3106966029
{
public:
// System.Int32 Mapbox.VectorTile.Contants.TileType::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(TileType_t3106966029, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // TILETYPE_T3106966029_H
#ifndef COMMANDS_T1803779524_H
#define COMMANDS_T1803779524_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Contants.Commands
struct Commands_t1803779524
{
public:
// System.Int32 Mapbox.VectorTile.Contants.Commands::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(Commands_t1803779524, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // COMMANDS_T1803779524_H
#ifndef WIRETYPES_T1504741901_H
#define WIRETYPES_T1504741901_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Contants.WireTypes
struct WireTypes_t1504741901
{
public:
// System.Int32 Mapbox.VectorTile.Contants.WireTypes::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(WireTypes_t1504741901, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // WIRETYPES_T1504741901_H
#ifndef OUTPT_T2591102706_H
#define OUTPT_T2591102706_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt
struct OutPt_t2591102706 : public RuntimeObject
{
public:
// System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt::Idx
int32_t ___Idx_0;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt::Pt
IntPoint_t2327573135 ___Pt_1;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt::Next
OutPt_t2591102706 * ___Next_2;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/OutPt::Prev
OutPt_t2591102706 * ___Prev_3;
public:
inline static int32_t get_offset_of_Idx_0() { return static_cast<int32_t>(offsetof(OutPt_t2591102706, ___Idx_0)); }
inline int32_t get_Idx_0() const { return ___Idx_0; }
inline int32_t* get_address_of_Idx_0() { return &___Idx_0; }
inline void set_Idx_0(int32_t value)
{
___Idx_0 = value;
}
inline static int32_t get_offset_of_Pt_1() { return static_cast<int32_t>(offsetof(OutPt_t2591102706, ___Pt_1)); }
inline IntPoint_t2327573135 get_Pt_1() const { return ___Pt_1; }
inline IntPoint_t2327573135 * get_address_of_Pt_1() { return &___Pt_1; }
inline void set_Pt_1(IntPoint_t2327573135 value)
{
___Pt_1 = value;
}
inline static int32_t get_offset_of_Next_2() { return static_cast<int32_t>(offsetof(OutPt_t2591102706, ___Next_2)); }
inline OutPt_t2591102706 * get_Next_2() const { return ___Next_2; }
inline OutPt_t2591102706 ** get_address_of_Next_2() { return &___Next_2; }
inline void set_Next_2(OutPt_t2591102706 * value)
{
___Next_2 = value;
Il2CppCodeGenWriteBarrier((&___Next_2), value);
}
inline static int32_t get_offset_of_Prev_3() { return static_cast<int32_t>(offsetof(OutPt_t2591102706, ___Prev_3)); }
inline OutPt_t2591102706 * get_Prev_3() const { return ___Prev_3; }
inline OutPt_t2591102706 ** get_address_of_Prev_3() { return &___Prev_3; }
inline void set_Prev_3(OutPt_t2591102706 * value)
{
___Prev_3 = value;
Il2CppCodeGenWriteBarrier((&___Prev_3), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // OUTPT_T2591102706_H
#ifndef CLIPPEROFFSET_T3668738110_H
#define CLIPPEROFFSET_T3668738110_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset
struct ClipperOffset_t3668738110 : public RuntimeObject
{
public:
// System.Collections.Generic.List`1<System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint>> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_destPolys
List_1_t976755323 * ___m_destPolys_0;
// System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_srcPoly
List_1_t3799647877 * ___m_srcPoly_1;
// System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_destPoly
List_1_t3799647877 * ___m_destPoly_2;
// System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/DoublePoint> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_normals
List_1_t3080002113 * ___m_normals_3;
// System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_delta
double ___m_delta_4;
// System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_sinA
double ___m_sinA_5;
// System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_sin
double ___m_sin_6;
// System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_cos
double ___m_cos_7;
// System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_miterLim
double ___m_miterLim_8;
// System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_StepsPerRad
double ___m_StepsPerRad_9;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_lowest
IntPoint_t2327573135 ___m_lowest_10;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::m_polyNodes
PolyNode_t1300984468 * ___m_polyNodes_11;
// System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::<ArcTolerance>k__BackingField
double ___U3CArcToleranceU3Ek__BackingField_12;
// System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipperOffset::<MiterLimit>k__BackingField
double ___U3CMiterLimitU3Ek__BackingField_13;
public:
inline static int32_t get_offset_of_m_destPolys_0() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_destPolys_0)); }
inline List_1_t976755323 * get_m_destPolys_0() const { return ___m_destPolys_0; }
inline List_1_t976755323 ** get_address_of_m_destPolys_0() { return &___m_destPolys_0; }
inline void set_m_destPolys_0(List_1_t976755323 * value)
{
___m_destPolys_0 = value;
Il2CppCodeGenWriteBarrier((&___m_destPolys_0), value);
}
inline static int32_t get_offset_of_m_srcPoly_1() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_srcPoly_1)); }
inline List_1_t3799647877 * get_m_srcPoly_1() const { return ___m_srcPoly_1; }
inline List_1_t3799647877 ** get_address_of_m_srcPoly_1() { return &___m_srcPoly_1; }
inline void set_m_srcPoly_1(List_1_t3799647877 * value)
{
___m_srcPoly_1 = value;
Il2CppCodeGenWriteBarrier((&___m_srcPoly_1), value);
}
inline static int32_t get_offset_of_m_destPoly_2() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_destPoly_2)); }
inline List_1_t3799647877 * get_m_destPoly_2() const { return ___m_destPoly_2; }
inline List_1_t3799647877 ** get_address_of_m_destPoly_2() { return &___m_destPoly_2; }
inline void set_m_destPoly_2(List_1_t3799647877 * value)
{
___m_destPoly_2 = value;
Il2CppCodeGenWriteBarrier((&___m_destPoly_2), value);
}
inline static int32_t get_offset_of_m_normals_3() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_normals_3)); }
inline List_1_t3080002113 * get_m_normals_3() const { return ___m_normals_3; }
inline List_1_t3080002113 ** get_address_of_m_normals_3() { return &___m_normals_3; }
inline void set_m_normals_3(List_1_t3080002113 * value)
{
___m_normals_3 = value;
Il2CppCodeGenWriteBarrier((&___m_normals_3), value);
}
inline static int32_t get_offset_of_m_delta_4() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_delta_4)); }
inline double get_m_delta_4() const { return ___m_delta_4; }
inline double* get_address_of_m_delta_4() { return &___m_delta_4; }
inline void set_m_delta_4(double value)
{
___m_delta_4 = value;
}
inline static int32_t get_offset_of_m_sinA_5() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_sinA_5)); }
inline double get_m_sinA_5() const { return ___m_sinA_5; }
inline double* get_address_of_m_sinA_5() { return &___m_sinA_5; }
inline void set_m_sinA_5(double value)
{
___m_sinA_5 = value;
}
inline static int32_t get_offset_of_m_sin_6() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_sin_6)); }
inline double get_m_sin_6() const { return ___m_sin_6; }
inline double* get_address_of_m_sin_6() { return &___m_sin_6; }
inline void set_m_sin_6(double value)
{
___m_sin_6 = value;
}
inline static int32_t get_offset_of_m_cos_7() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_cos_7)); }
inline double get_m_cos_7() const { return ___m_cos_7; }
inline double* get_address_of_m_cos_7() { return &___m_cos_7; }
inline void set_m_cos_7(double value)
{
___m_cos_7 = value;
}
inline static int32_t get_offset_of_m_miterLim_8() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_miterLim_8)); }
inline double get_m_miterLim_8() const { return ___m_miterLim_8; }
inline double* get_address_of_m_miterLim_8() { return &___m_miterLim_8; }
inline void set_m_miterLim_8(double value)
{
___m_miterLim_8 = value;
}
inline static int32_t get_offset_of_m_StepsPerRad_9() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_StepsPerRad_9)); }
inline double get_m_StepsPerRad_9() const { return ___m_StepsPerRad_9; }
inline double* get_address_of_m_StepsPerRad_9() { return &___m_StepsPerRad_9; }
inline void set_m_StepsPerRad_9(double value)
{
___m_StepsPerRad_9 = value;
}
inline static int32_t get_offset_of_m_lowest_10() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_lowest_10)); }
inline IntPoint_t2327573135 get_m_lowest_10() const { return ___m_lowest_10; }
inline IntPoint_t2327573135 * get_address_of_m_lowest_10() { return &___m_lowest_10; }
inline void set_m_lowest_10(IntPoint_t2327573135 value)
{
___m_lowest_10 = value;
}
inline static int32_t get_offset_of_m_polyNodes_11() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___m_polyNodes_11)); }
inline PolyNode_t1300984468 * get_m_polyNodes_11() const { return ___m_polyNodes_11; }
inline PolyNode_t1300984468 ** get_address_of_m_polyNodes_11() { return &___m_polyNodes_11; }
inline void set_m_polyNodes_11(PolyNode_t1300984468 * value)
{
___m_polyNodes_11 = value;
Il2CppCodeGenWriteBarrier((&___m_polyNodes_11), value);
}
inline static int32_t get_offset_of_U3CArcToleranceU3Ek__BackingField_12() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___U3CArcToleranceU3Ek__BackingField_12)); }
inline double get_U3CArcToleranceU3Ek__BackingField_12() const { return ___U3CArcToleranceU3Ek__BackingField_12; }
inline double* get_address_of_U3CArcToleranceU3Ek__BackingField_12() { return &___U3CArcToleranceU3Ek__BackingField_12; }
inline void set_U3CArcToleranceU3Ek__BackingField_12(double value)
{
___U3CArcToleranceU3Ek__BackingField_12 = value;
}
inline static int32_t get_offset_of_U3CMiterLimitU3Ek__BackingField_13() { return static_cast<int32_t>(offsetof(ClipperOffset_t3668738110, ___U3CMiterLimitU3Ek__BackingField_13)); }
inline double get_U3CMiterLimitU3Ek__BackingField_13() const { return ___U3CMiterLimitU3Ek__BackingField_13; }
inline double* get_address_of_U3CMiterLimitU3Ek__BackingField_13() { return &___U3CMiterLimitU3Ek__BackingField_13; }
inline void set_U3CMiterLimitU3Ek__BackingField_13(double value)
{
___U3CMiterLimitU3Ek__BackingField_13 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CLIPPEROFFSET_T3668738110_H
#ifndef OBJECT_T631007953_H
#define OBJECT_T631007953_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Object
struct Object_t631007953 : public RuntimeObject
{
public:
// System.IntPtr UnityEngine.Object::m_CachedPtr
intptr_t ___m_CachedPtr_0;
public:
inline static int32_t get_offset_of_m_CachedPtr_0() { return static_cast<int32_t>(offsetof(Object_t631007953, ___m_CachedPtr_0)); }
inline intptr_t get_m_CachedPtr_0() const { return ___m_CachedPtr_0; }
inline intptr_t* get_address_of_m_CachedPtr_0() { return &___m_CachedPtr_0; }
inline void set_m_CachedPtr_0(intptr_t value)
{
___m_CachedPtr_0 = value;
}
};
struct Object_t631007953_StaticFields
{
public:
// System.Int32 UnityEngine.Object::OffsetOfInstanceIDInCPlusPlusObject
int32_t ___OffsetOfInstanceIDInCPlusPlusObject_1;
public:
inline static int32_t get_offset_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return static_cast<int32_t>(offsetof(Object_t631007953_StaticFields, ___OffsetOfInstanceIDInCPlusPlusObject_1)); }
inline int32_t get_OffsetOfInstanceIDInCPlusPlusObject_1() const { return ___OffsetOfInstanceIDInCPlusPlusObject_1; }
inline int32_t* get_address_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return &___OffsetOfInstanceIDInCPlusPlusObject_1; }
inline void set_OffsetOfInstanceIDInCPlusPlusObject_1(int32_t value)
{
___OffsetOfInstanceIDInCPlusPlusObject_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of UnityEngine.Object
struct Object_t631007953_marshaled_pinvoke
{
intptr_t ___m_CachedPtr_0;
};
// Native definition for COM marshalling of UnityEngine.Object
struct Object_t631007953_marshaled_com
{
intptr_t ___m_CachedPtr_0;
};
#endif // OBJECT_T631007953_H
#ifndef DIRECTION_T4237952965_H
#define DIRECTION_T4237952965_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Direction
struct Direction_t4237952965
{
public:
// System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Direction::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(Direction_t4237952965, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DIRECTION_T4237952965_H
#ifndef RECTD_T151583371_H
#define RECTD_T151583371_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Utils.RectD
struct RectD_t151583371
{
public:
union
{
struct
{
// Mapbox.Utils.Vector2d Mapbox.Utils.RectD::<Min>k__BackingField
Vector2d_t1865246568 ___U3CMinU3Ek__BackingField_0;
// Mapbox.Utils.Vector2d Mapbox.Utils.RectD::<Max>k__BackingField
Vector2d_t1865246568 ___U3CMaxU3Ek__BackingField_1;
// Mapbox.Utils.Vector2d Mapbox.Utils.RectD::<Size>k__BackingField
Vector2d_t1865246568 ___U3CSizeU3Ek__BackingField_2;
// Mapbox.Utils.Vector2d Mapbox.Utils.RectD::<Center>k__BackingField
Vector2d_t1865246568 ___U3CCenterU3Ek__BackingField_3;
};
uint8_t RectD_t151583371__padding[1];
};
public:
inline static int32_t get_offset_of_U3CMinU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(RectD_t151583371, ___U3CMinU3Ek__BackingField_0)); }
inline Vector2d_t1865246568 get_U3CMinU3Ek__BackingField_0() const { return ___U3CMinU3Ek__BackingField_0; }
inline Vector2d_t1865246568 * get_address_of_U3CMinU3Ek__BackingField_0() { return &___U3CMinU3Ek__BackingField_0; }
inline void set_U3CMinU3Ek__BackingField_0(Vector2d_t1865246568 value)
{
___U3CMinU3Ek__BackingField_0 = value;
}
inline static int32_t get_offset_of_U3CMaxU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(RectD_t151583371, ___U3CMaxU3Ek__BackingField_1)); }
inline Vector2d_t1865246568 get_U3CMaxU3Ek__BackingField_1() const { return ___U3CMaxU3Ek__BackingField_1; }
inline Vector2d_t1865246568 * get_address_of_U3CMaxU3Ek__BackingField_1() { return &___U3CMaxU3Ek__BackingField_1; }
inline void set_U3CMaxU3Ek__BackingField_1(Vector2d_t1865246568 value)
{
___U3CMaxU3Ek__BackingField_1 = value;
}
inline static int32_t get_offset_of_U3CSizeU3Ek__BackingField_2() { return static_cast<int32_t>(offsetof(RectD_t151583371, ___U3CSizeU3Ek__BackingField_2)); }
inline Vector2d_t1865246568 get_U3CSizeU3Ek__BackingField_2() const { return ___U3CSizeU3Ek__BackingField_2; }
inline Vector2d_t1865246568 * get_address_of_U3CSizeU3Ek__BackingField_2() { return &___U3CSizeU3Ek__BackingField_2; }
inline void set_U3CSizeU3Ek__BackingField_2(Vector2d_t1865246568 value)
{
___U3CSizeU3Ek__BackingField_2 = value;
}
inline static int32_t get_offset_of_U3CCenterU3Ek__BackingField_3() { return static_cast<int32_t>(offsetof(RectD_t151583371, ___U3CCenterU3Ek__BackingField_3)); }
inline Vector2d_t1865246568 get_U3CCenterU3Ek__BackingField_3() const { return ___U3CCenterU3Ek__BackingField_3; }
inline Vector2d_t1865246568 * get_address_of_U3CCenterU3Ek__BackingField_3() { return &___U3CCenterU3Ek__BackingField_3; }
inline void set_U3CCenterU3Ek__BackingField_3(Vector2d_t1865246568 value)
{
___U3CCenterU3Ek__BackingField_3 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // RECTD_T151583371_H
#ifndef POLYNODE_T1300984468_H
#define POLYNODE_T1300984468_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode
struct PolyNode_t1300984468 : public RuntimeObject
{
public:
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode::m_Parent
PolyNode_t1300984468 * ___m_Parent_0;
// System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode::m_polygon
List_1_t3799647877 * ___m_polygon_1;
// System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode::m_Index
int32_t ___m_Index_2;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/JoinType Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode::m_jointype
int32_t ___m_jointype_3;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/EndType Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode::m_endtype
int32_t ___m_endtype_4;
// System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode::m_Childs
List_1_t2773059210 * ___m_Childs_5;
// System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode::<IsOpen>k__BackingField
bool ___U3CIsOpenU3Ek__BackingField_6;
public:
inline static int32_t get_offset_of_m_Parent_0() { return static_cast<int32_t>(offsetof(PolyNode_t1300984468, ___m_Parent_0)); }
inline PolyNode_t1300984468 * get_m_Parent_0() const { return ___m_Parent_0; }
inline PolyNode_t1300984468 ** get_address_of_m_Parent_0() { return &___m_Parent_0; }
inline void set_m_Parent_0(PolyNode_t1300984468 * value)
{
___m_Parent_0 = value;
Il2CppCodeGenWriteBarrier((&___m_Parent_0), value);
}
inline static int32_t get_offset_of_m_polygon_1() { return static_cast<int32_t>(offsetof(PolyNode_t1300984468, ___m_polygon_1)); }
inline List_1_t3799647877 * get_m_polygon_1() const { return ___m_polygon_1; }
inline List_1_t3799647877 ** get_address_of_m_polygon_1() { return &___m_polygon_1; }
inline void set_m_polygon_1(List_1_t3799647877 * value)
{
___m_polygon_1 = value;
Il2CppCodeGenWriteBarrier((&___m_polygon_1), value);
}
inline static int32_t get_offset_of_m_Index_2() { return static_cast<int32_t>(offsetof(PolyNode_t1300984468, ___m_Index_2)); }
inline int32_t get_m_Index_2() const { return ___m_Index_2; }
inline int32_t* get_address_of_m_Index_2() { return &___m_Index_2; }
inline void set_m_Index_2(int32_t value)
{
___m_Index_2 = value;
}
inline static int32_t get_offset_of_m_jointype_3() { return static_cast<int32_t>(offsetof(PolyNode_t1300984468, ___m_jointype_3)); }
inline int32_t get_m_jointype_3() const { return ___m_jointype_3; }
inline int32_t* get_address_of_m_jointype_3() { return &___m_jointype_3; }
inline void set_m_jointype_3(int32_t value)
{
___m_jointype_3 = value;
}
inline static int32_t get_offset_of_m_endtype_4() { return static_cast<int32_t>(offsetof(PolyNode_t1300984468, ___m_endtype_4)); }
inline int32_t get_m_endtype_4() const { return ___m_endtype_4; }
inline int32_t* get_address_of_m_endtype_4() { return &___m_endtype_4; }
inline void set_m_endtype_4(int32_t value)
{
___m_endtype_4 = value;
}
inline static int32_t get_offset_of_m_Childs_5() { return static_cast<int32_t>(offsetof(PolyNode_t1300984468, ___m_Childs_5)); }
inline List_1_t2773059210 * get_m_Childs_5() const { return ___m_Childs_5; }
inline List_1_t2773059210 ** get_address_of_m_Childs_5() { return &___m_Childs_5; }
inline void set_m_Childs_5(List_1_t2773059210 * value)
{
___m_Childs_5 = value;
Il2CppCodeGenWriteBarrier((&___m_Childs_5), value);
}
inline static int32_t get_offset_of_U3CIsOpenU3Ek__BackingField_6() { return static_cast<int32_t>(offsetof(PolyNode_t1300984468, ___U3CIsOpenU3Ek__BackingField_6)); }
inline bool get_U3CIsOpenU3Ek__BackingField_6() const { return ___U3CIsOpenU3Ek__BackingField_6; }
inline bool* get_address_of_U3CIsOpenU3Ek__BackingField_6() { return &___U3CIsOpenU3Ek__BackingField_6; }
inline void set_U3CIsOpenU3Ek__BackingField_6(bool value)
{
___U3CIsOpenU3Ek__BackingField_6 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // POLYNODE_T1300984468_H
#ifndef COMPONENT_T1923634451_H
#define COMPONENT_T1923634451_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Component
struct Component_t1923634451 : public Object_t631007953
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // COMPONENT_T1923634451_H
#ifndef SCRIPTABLEOBJECT_T2528358522_H
#define SCRIPTABLEOBJECT_T2528358522_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.ScriptableObject
struct ScriptableObject_t2528358522 : public Object_t631007953
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of UnityEngine.ScriptableObject
struct ScriptableObject_t2528358522_marshaled_pinvoke : public Object_t631007953_marshaled_pinvoke
{
};
// Native definition for COM marshalling of UnityEngine.ScriptableObject
struct ScriptableObject_t2528358522_marshaled_com : public Object_t631007953_marshaled_com
{
};
#endif // SCRIPTABLEOBJECT_T2528358522_H
#ifndef PBFREADER_T1662343237_H
#define PBFREADER_T1662343237_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.PbfReader
struct PbfReader_t1662343237 : public RuntimeObject
{
public:
// System.Int32 Mapbox.VectorTile.PbfReader::<Tag>k__BackingField
int32_t ___U3CTagU3Ek__BackingField_0;
// System.UInt64 Mapbox.VectorTile.PbfReader::<Value>k__BackingField
uint64_t ___U3CValueU3Ek__BackingField_1;
// Mapbox.VectorTile.Contants.WireTypes Mapbox.VectorTile.PbfReader::<WireType>k__BackingField
int32_t ___U3CWireTypeU3Ek__BackingField_2;
// System.Byte[] Mapbox.VectorTile.PbfReader::_buffer
ByteU5BU5D_t4116647657* ____buffer_3;
// System.UInt64 Mapbox.VectorTile.PbfReader::_length
uint64_t ____length_4;
// System.UInt64 Mapbox.VectorTile.PbfReader::_pos
uint64_t ____pos_5;
public:
inline static int32_t get_offset_of_U3CTagU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(PbfReader_t1662343237, ___U3CTagU3Ek__BackingField_0)); }
inline int32_t get_U3CTagU3Ek__BackingField_0() const { return ___U3CTagU3Ek__BackingField_0; }
inline int32_t* get_address_of_U3CTagU3Ek__BackingField_0() { return &___U3CTagU3Ek__BackingField_0; }
inline void set_U3CTagU3Ek__BackingField_0(int32_t value)
{
___U3CTagU3Ek__BackingField_0 = value;
}
inline static int32_t get_offset_of_U3CValueU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(PbfReader_t1662343237, ___U3CValueU3Ek__BackingField_1)); }
inline uint64_t get_U3CValueU3Ek__BackingField_1() const { return ___U3CValueU3Ek__BackingField_1; }
inline uint64_t* get_address_of_U3CValueU3Ek__BackingField_1() { return &___U3CValueU3Ek__BackingField_1; }
inline void set_U3CValueU3Ek__BackingField_1(uint64_t value)
{
___U3CValueU3Ek__BackingField_1 = value;
}
inline static int32_t get_offset_of_U3CWireTypeU3Ek__BackingField_2() { return static_cast<int32_t>(offsetof(PbfReader_t1662343237, ___U3CWireTypeU3Ek__BackingField_2)); }
inline int32_t get_U3CWireTypeU3Ek__BackingField_2() const { return ___U3CWireTypeU3Ek__BackingField_2; }
inline int32_t* get_address_of_U3CWireTypeU3Ek__BackingField_2() { return &___U3CWireTypeU3Ek__BackingField_2; }
inline void set_U3CWireTypeU3Ek__BackingField_2(int32_t value)
{
___U3CWireTypeU3Ek__BackingField_2 = value;
}
inline static int32_t get_offset_of__buffer_3() { return static_cast<int32_t>(offsetof(PbfReader_t1662343237, ____buffer_3)); }
inline ByteU5BU5D_t4116647657* get__buffer_3() const { return ____buffer_3; }
inline ByteU5BU5D_t4116647657** get_address_of__buffer_3() { return &____buffer_3; }
inline void set__buffer_3(ByteU5BU5D_t4116647657* value)
{
____buffer_3 = value;
Il2CppCodeGenWriteBarrier((&____buffer_3), value);
}
inline static int32_t get_offset_of__length_4() { return static_cast<int32_t>(offsetof(PbfReader_t1662343237, ____length_4)); }
inline uint64_t get__length_4() const { return ____length_4; }
inline uint64_t* get_address_of__length_4() { return &____length_4; }
inline void set__length_4(uint64_t value)
{
____length_4 = value;
}
inline static int32_t get_offset_of__pos_5() { return static_cast<int32_t>(offsetof(PbfReader_t1662343237, ____pos_5)); }
inline uint64_t get__pos_5() const { return ____pos_5; }
inline uint64_t* get_address_of__pos_5() { return &____pos_5; }
inline void set__pos_5(uint64_t value)
{
____pos_5 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // PBFREADER_T1662343237_H
#ifndef TEDGE_T1694054893_H
#define TEDGE_T1694054893_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge
struct TEdge_t1694054893 : public RuntimeObject
{
public:
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::Bot
IntPoint_t2327573135 ___Bot_0;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::Curr
IntPoint_t2327573135 ___Curr_1;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::Top
IntPoint_t2327573135 ___Top_2;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntPoint Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::Delta
IntPoint_t2327573135 ___Delta_3;
// System.Double Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::Dx
double ___Dx_4;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyType Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::PolyTyp
int32_t ___PolyTyp_5;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/EdgeSide Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::Side
int32_t ___Side_6;
// System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::WindDelta
int32_t ___WindDelta_7;
// System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::WindCnt
int32_t ___WindCnt_8;
// System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::WindCnt2
int32_t ___WindCnt2_9;
// System.Int32 Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::OutIdx
int32_t ___OutIdx_10;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::Next
TEdge_t1694054893 * ___Next_11;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::Prev
TEdge_t1694054893 * ___Prev_12;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::NextInLML
TEdge_t1694054893 * ___NextInLML_13;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::NextInAEL
TEdge_t1694054893 * ___NextInAEL_14;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::PrevInAEL
TEdge_t1694054893 * ___PrevInAEL_15;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::NextInSEL
TEdge_t1694054893 * ___NextInSEL_16;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge::PrevInSEL
TEdge_t1694054893 * ___PrevInSEL_17;
public:
inline static int32_t get_offset_of_Bot_0() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___Bot_0)); }
inline IntPoint_t2327573135 get_Bot_0() const { return ___Bot_0; }
inline IntPoint_t2327573135 * get_address_of_Bot_0() { return &___Bot_0; }
inline void set_Bot_0(IntPoint_t2327573135 value)
{
___Bot_0 = value;
}
inline static int32_t get_offset_of_Curr_1() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___Curr_1)); }
inline IntPoint_t2327573135 get_Curr_1() const { return ___Curr_1; }
inline IntPoint_t2327573135 * get_address_of_Curr_1() { return &___Curr_1; }
inline void set_Curr_1(IntPoint_t2327573135 value)
{
___Curr_1 = value;
}
inline static int32_t get_offset_of_Top_2() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___Top_2)); }
inline IntPoint_t2327573135 get_Top_2() const { return ___Top_2; }
inline IntPoint_t2327573135 * get_address_of_Top_2() { return &___Top_2; }
inline void set_Top_2(IntPoint_t2327573135 value)
{
___Top_2 = value;
}
inline static int32_t get_offset_of_Delta_3() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___Delta_3)); }
inline IntPoint_t2327573135 get_Delta_3() const { return ___Delta_3; }
inline IntPoint_t2327573135 * get_address_of_Delta_3() { return &___Delta_3; }
inline void set_Delta_3(IntPoint_t2327573135 value)
{
___Delta_3 = value;
}
inline static int32_t get_offset_of_Dx_4() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___Dx_4)); }
inline double get_Dx_4() const { return ___Dx_4; }
inline double* get_address_of_Dx_4() { return &___Dx_4; }
inline void set_Dx_4(double value)
{
___Dx_4 = value;
}
inline static int32_t get_offset_of_PolyTyp_5() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___PolyTyp_5)); }
inline int32_t get_PolyTyp_5() const { return ___PolyTyp_5; }
inline int32_t* get_address_of_PolyTyp_5() { return &___PolyTyp_5; }
inline void set_PolyTyp_5(int32_t value)
{
___PolyTyp_5 = value;
}
inline static int32_t get_offset_of_Side_6() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___Side_6)); }
inline int32_t get_Side_6() const { return ___Side_6; }
inline int32_t* get_address_of_Side_6() { return &___Side_6; }
inline void set_Side_6(int32_t value)
{
___Side_6 = value;
}
inline static int32_t get_offset_of_WindDelta_7() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___WindDelta_7)); }
inline int32_t get_WindDelta_7() const { return ___WindDelta_7; }
inline int32_t* get_address_of_WindDelta_7() { return &___WindDelta_7; }
inline void set_WindDelta_7(int32_t value)
{
___WindDelta_7 = value;
}
inline static int32_t get_offset_of_WindCnt_8() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___WindCnt_8)); }
inline int32_t get_WindCnt_8() const { return ___WindCnt_8; }
inline int32_t* get_address_of_WindCnt_8() { return &___WindCnt_8; }
inline void set_WindCnt_8(int32_t value)
{
___WindCnt_8 = value;
}
inline static int32_t get_offset_of_WindCnt2_9() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___WindCnt2_9)); }
inline int32_t get_WindCnt2_9() const { return ___WindCnt2_9; }
inline int32_t* get_address_of_WindCnt2_9() { return &___WindCnt2_9; }
inline void set_WindCnt2_9(int32_t value)
{
___WindCnt2_9 = value;
}
inline static int32_t get_offset_of_OutIdx_10() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___OutIdx_10)); }
inline int32_t get_OutIdx_10() const { return ___OutIdx_10; }
inline int32_t* get_address_of_OutIdx_10() { return &___OutIdx_10; }
inline void set_OutIdx_10(int32_t value)
{
___OutIdx_10 = value;
}
inline static int32_t get_offset_of_Next_11() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___Next_11)); }
inline TEdge_t1694054893 * get_Next_11() const { return ___Next_11; }
inline TEdge_t1694054893 ** get_address_of_Next_11() { return &___Next_11; }
inline void set_Next_11(TEdge_t1694054893 * value)
{
___Next_11 = value;
Il2CppCodeGenWriteBarrier((&___Next_11), value);
}
inline static int32_t get_offset_of_Prev_12() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___Prev_12)); }
inline TEdge_t1694054893 * get_Prev_12() const { return ___Prev_12; }
inline TEdge_t1694054893 ** get_address_of_Prev_12() { return &___Prev_12; }
inline void set_Prev_12(TEdge_t1694054893 * value)
{
___Prev_12 = value;
Il2CppCodeGenWriteBarrier((&___Prev_12), value);
}
inline static int32_t get_offset_of_NextInLML_13() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___NextInLML_13)); }
inline TEdge_t1694054893 * get_NextInLML_13() const { return ___NextInLML_13; }
inline TEdge_t1694054893 ** get_address_of_NextInLML_13() { return &___NextInLML_13; }
inline void set_NextInLML_13(TEdge_t1694054893 * value)
{
___NextInLML_13 = value;
Il2CppCodeGenWriteBarrier((&___NextInLML_13), value);
}
inline static int32_t get_offset_of_NextInAEL_14() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___NextInAEL_14)); }
inline TEdge_t1694054893 * get_NextInAEL_14() const { return ___NextInAEL_14; }
inline TEdge_t1694054893 ** get_address_of_NextInAEL_14() { return &___NextInAEL_14; }
inline void set_NextInAEL_14(TEdge_t1694054893 * value)
{
___NextInAEL_14 = value;
Il2CppCodeGenWriteBarrier((&___NextInAEL_14), value);
}
inline static int32_t get_offset_of_PrevInAEL_15() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___PrevInAEL_15)); }
inline TEdge_t1694054893 * get_PrevInAEL_15() const { return ___PrevInAEL_15; }
inline TEdge_t1694054893 ** get_address_of_PrevInAEL_15() { return &___PrevInAEL_15; }
inline void set_PrevInAEL_15(TEdge_t1694054893 * value)
{
___PrevInAEL_15 = value;
Il2CppCodeGenWriteBarrier((&___PrevInAEL_15), value);
}
inline static int32_t get_offset_of_NextInSEL_16() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___NextInSEL_16)); }
inline TEdge_t1694054893 * get_NextInSEL_16() const { return ___NextInSEL_16; }
inline TEdge_t1694054893 ** get_address_of_NextInSEL_16() { return &___NextInSEL_16; }
inline void set_NextInSEL_16(TEdge_t1694054893 * value)
{
___NextInSEL_16 = value;
Il2CppCodeGenWriteBarrier((&___NextInSEL_16), value);
}
inline static int32_t get_offset_of_PrevInSEL_17() { return static_cast<int32_t>(offsetof(TEdge_t1694054893, ___PrevInSEL_17)); }
inline TEdge_t1694054893 * get_PrevInSEL_17() const { return ___PrevInSEL_17; }
inline TEdge_t1694054893 ** get_address_of_PrevInSEL_17() { return &___PrevInSEL_17; }
inline void set_PrevInSEL_17(TEdge_t1694054893 * value)
{
___PrevInSEL_17 = value;
Il2CppCodeGenWriteBarrier((&___PrevInSEL_17), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // TEDGE_T1694054893_H
#ifndef CLIPPER_T4158555122_H
#define CLIPPER_T4158555122_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper
struct Clipper_t4158555122 : public ClipperBase_t2411222589
{
public:
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/ClipType Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_ClipType
int32_t ___m_ClipType_18;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Maxima Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_Maxima
Maxima_t4278896992 * ___m_Maxima_19;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/TEdge Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_SortedEdges
TEdge_t1694054893 * ___m_SortedEdges_20;
// System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntersectNode> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_IntersectList
List_1_t556621665 * ___m_IntersectList_21;
// System.Collections.Generic.IComparer`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/IntersectNode> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_IntersectNodeComparer
RuntimeObject* ___m_IntersectNodeComparer_22;
// System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_ExecuteLocked
bool ___m_ExecuteLocked_23;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyFillType Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_ClipFillType
int32_t ___m_ClipFillType_24;
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyFillType Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_SubjFillType
int32_t ___m_SubjFillType_25;
// System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Join> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_Joins
List_1_t3821086104 * ___m_Joins_26;
// System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Join> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_GhostJoins
List_1_t3821086104 * ___m_GhostJoins_27;
// System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::m_UsingPolyTree
bool ___m_UsingPolyTree_28;
// System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::<ReverseSolution>k__BackingField
bool ___U3CReverseSolutionU3Ek__BackingField_29;
// System.Boolean Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/Clipper::<StrictlySimple>k__BackingField
bool ___U3CStrictlySimpleU3Ek__BackingField_30;
public:
inline static int32_t get_offset_of_m_ClipType_18() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_ClipType_18)); }
inline int32_t get_m_ClipType_18() const { return ___m_ClipType_18; }
inline int32_t* get_address_of_m_ClipType_18() { return &___m_ClipType_18; }
inline void set_m_ClipType_18(int32_t value)
{
___m_ClipType_18 = value;
}
inline static int32_t get_offset_of_m_Maxima_19() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_Maxima_19)); }
inline Maxima_t4278896992 * get_m_Maxima_19() const { return ___m_Maxima_19; }
inline Maxima_t4278896992 ** get_address_of_m_Maxima_19() { return &___m_Maxima_19; }
inline void set_m_Maxima_19(Maxima_t4278896992 * value)
{
___m_Maxima_19 = value;
Il2CppCodeGenWriteBarrier((&___m_Maxima_19), value);
}
inline static int32_t get_offset_of_m_SortedEdges_20() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_SortedEdges_20)); }
inline TEdge_t1694054893 * get_m_SortedEdges_20() const { return ___m_SortedEdges_20; }
inline TEdge_t1694054893 ** get_address_of_m_SortedEdges_20() { return &___m_SortedEdges_20; }
inline void set_m_SortedEdges_20(TEdge_t1694054893 * value)
{
___m_SortedEdges_20 = value;
Il2CppCodeGenWriteBarrier((&___m_SortedEdges_20), value);
}
inline static int32_t get_offset_of_m_IntersectList_21() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_IntersectList_21)); }
inline List_1_t556621665 * get_m_IntersectList_21() const { return ___m_IntersectList_21; }
inline List_1_t556621665 ** get_address_of_m_IntersectList_21() { return &___m_IntersectList_21; }
inline void set_m_IntersectList_21(List_1_t556621665 * value)
{
___m_IntersectList_21 = value;
Il2CppCodeGenWriteBarrier((&___m_IntersectList_21), value);
}
inline static int32_t get_offset_of_m_IntersectNodeComparer_22() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_IntersectNodeComparer_22)); }
inline RuntimeObject* get_m_IntersectNodeComparer_22() const { return ___m_IntersectNodeComparer_22; }
inline RuntimeObject** get_address_of_m_IntersectNodeComparer_22() { return &___m_IntersectNodeComparer_22; }
inline void set_m_IntersectNodeComparer_22(RuntimeObject* value)
{
___m_IntersectNodeComparer_22 = value;
Il2CppCodeGenWriteBarrier((&___m_IntersectNodeComparer_22), value);
}
inline static int32_t get_offset_of_m_ExecuteLocked_23() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_ExecuteLocked_23)); }
inline bool get_m_ExecuteLocked_23() const { return ___m_ExecuteLocked_23; }
inline bool* get_address_of_m_ExecuteLocked_23() { return &___m_ExecuteLocked_23; }
inline void set_m_ExecuteLocked_23(bool value)
{
___m_ExecuteLocked_23 = value;
}
inline static int32_t get_offset_of_m_ClipFillType_24() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_ClipFillType_24)); }
inline int32_t get_m_ClipFillType_24() const { return ___m_ClipFillType_24; }
inline int32_t* get_address_of_m_ClipFillType_24() { return &___m_ClipFillType_24; }
inline void set_m_ClipFillType_24(int32_t value)
{
___m_ClipFillType_24 = value;
}
inline static int32_t get_offset_of_m_SubjFillType_25() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_SubjFillType_25)); }
inline int32_t get_m_SubjFillType_25() const { return ___m_SubjFillType_25; }
inline int32_t* get_address_of_m_SubjFillType_25() { return &___m_SubjFillType_25; }
inline void set_m_SubjFillType_25(int32_t value)
{
___m_SubjFillType_25 = value;
}
inline static int32_t get_offset_of_m_Joins_26() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_Joins_26)); }
inline List_1_t3821086104 * get_m_Joins_26() const { return ___m_Joins_26; }
inline List_1_t3821086104 ** get_address_of_m_Joins_26() { return &___m_Joins_26; }
inline void set_m_Joins_26(List_1_t3821086104 * value)
{
___m_Joins_26 = value;
Il2CppCodeGenWriteBarrier((&___m_Joins_26), value);
}
inline static int32_t get_offset_of_m_GhostJoins_27() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_GhostJoins_27)); }
inline List_1_t3821086104 * get_m_GhostJoins_27() const { return ___m_GhostJoins_27; }
inline List_1_t3821086104 ** get_address_of_m_GhostJoins_27() { return &___m_GhostJoins_27; }
inline void set_m_GhostJoins_27(List_1_t3821086104 * value)
{
___m_GhostJoins_27 = value;
Il2CppCodeGenWriteBarrier((&___m_GhostJoins_27), value);
}
inline static int32_t get_offset_of_m_UsingPolyTree_28() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___m_UsingPolyTree_28)); }
inline bool get_m_UsingPolyTree_28() const { return ___m_UsingPolyTree_28; }
inline bool* get_address_of_m_UsingPolyTree_28() { return &___m_UsingPolyTree_28; }
inline void set_m_UsingPolyTree_28(bool value)
{
___m_UsingPolyTree_28 = value;
}
inline static int32_t get_offset_of_U3CReverseSolutionU3Ek__BackingField_29() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___U3CReverseSolutionU3Ek__BackingField_29)); }
inline bool get_U3CReverseSolutionU3Ek__BackingField_29() const { return ___U3CReverseSolutionU3Ek__BackingField_29; }
inline bool* get_address_of_U3CReverseSolutionU3Ek__BackingField_29() { return &___U3CReverseSolutionU3Ek__BackingField_29; }
inline void set_U3CReverseSolutionU3Ek__BackingField_29(bool value)
{
___U3CReverseSolutionU3Ek__BackingField_29 = value;
}
inline static int32_t get_offset_of_U3CStrictlySimpleU3Ek__BackingField_30() { return static_cast<int32_t>(offsetof(Clipper_t4158555122, ___U3CStrictlySimpleU3Ek__BackingField_30)); }
inline bool get_U3CStrictlySimpleU3Ek__BackingField_30() const { return ___U3CStrictlySimpleU3Ek__BackingField_30; }
inline bool* get_address_of_U3CStrictlySimpleU3Ek__BackingField_30() { return &___U3CStrictlySimpleU3Ek__BackingField_30; }
inline void set_U3CStrictlySimpleU3Ek__BackingField_30(bool value)
{
___U3CStrictlySimpleU3Ek__BackingField_30 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CLIPPER_T4158555122_H
#ifndef VECTORTILEFEATURE_T4093669591_H
#define VECTORTILEFEATURE_T4093669591_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.VectorTileFeature
struct VectorTileFeature_t4093669591 : public RuntimeObject
{
public:
// Mapbox.VectorTile.VectorTileLayer Mapbox.VectorTile.VectorTileFeature::_layer
VectorTileLayer_t873169949 * ____layer_0;
// System.Object Mapbox.VectorTile.VectorTileFeature::_cachedGeometry
RuntimeObject * ____cachedGeometry_1;
// System.Nullable`1<System.UInt32> Mapbox.VectorTile.VectorTileFeature::_clipBuffer
Nullable_1_t4282624060 ____clipBuffer_2;
// System.Nullable`1<System.Single> Mapbox.VectorTile.VectorTileFeature::_scale
Nullable_1_t3119828856 ____scale_3;
// System.Nullable`1<System.Single> Mapbox.VectorTile.VectorTileFeature::_previousScale
Nullable_1_t3119828856 ____previousScale_4;
// System.UInt64 Mapbox.VectorTile.VectorTileFeature::<Id>k__BackingField
uint64_t ___U3CIdU3Ek__BackingField_5;
// Mapbox.VectorTile.Geometry.GeomType Mapbox.VectorTile.VectorTileFeature::<GeometryType>k__BackingField
int32_t ___U3CGeometryTypeU3Ek__BackingField_6;
// System.Collections.Generic.List`1<System.UInt32> Mapbox.VectorTile.VectorTileFeature::<GeometryCommands>k__BackingField
List_1_t4032136720 * ___U3CGeometryCommandsU3Ek__BackingField_7;
// System.Collections.Generic.List`1<System.Int32> Mapbox.VectorTile.VectorTileFeature::<Tags>k__BackingField
List_1_t128053199 * ___U3CTagsU3Ek__BackingField_8;
public:
inline static int32_t get_offset_of__layer_0() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ____layer_0)); }
inline VectorTileLayer_t873169949 * get__layer_0() const { return ____layer_0; }
inline VectorTileLayer_t873169949 ** get_address_of__layer_0() { return &____layer_0; }
inline void set__layer_0(VectorTileLayer_t873169949 * value)
{
____layer_0 = value;
Il2CppCodeGenWriteBarrier((&____layer_0), value);
}
inline static int32_t get_offset_of__cachedGeometry_1() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ____cachedGeometry_1)); }
inline RuntimeObject * get__cachedGeometry_1() const { return ____cachedGeometry_1; }
inline RuntimeObject ** get_address_of__cachedGeometry_1() { return &____cachedGeometry_1; }
inline void set__cachedGeometry_1(RuntimeObject * value)
{
____cachedGeometry_1 = value;
Il2CppCodeGenWriteBarrier((&____cachedGeometry_1), value);
}
inline static int32_t get_offset_of__clipBuffer_2() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ____clipBuffer_2)); }
inline Nullable_1_t4282624060 get__clipBuffer_2() const { return ____clipBuffer_2; }
inline Nullable_1_t4282624060 * get_address_of__clipBuffer_2() { return &____clipBuffer_2; }
inline void set__clipBuffer_2(Nullable_1_t4282624060 value)
{
____clipBuffer_2 = value;
}
inline static int32_t get_offset_of__scale_3() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ____scale_3)); }
inline Nullable_1_t3119828856 get__scale_3() const { return ____scale_3; }
inline Nullable_1_t3119828856 * get_address_of__scale_3() { return &____scale_3; }
inline void set__scale_3(Nullable_1_t3119828856 value)
{
____scale_3 = value;
}
inline static int32_t get_offset_of__previousScale_4() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ____previousScale_4)); }
inline Nullable_1_t3119828856 get__previousScale_4() const { return ____previousScale_4; }
inline Nullable_1_t3119828856 * get_address_of__previousScale_4() { return &____previousScale_4; }
inline void set__previousScale_4(Nullable_1_t3119828856 value)
{
____previousScale_4 = value;
}
inline static int32_t get_offset_of_U3CIdU3Ek__BackingField_5() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ___U3CIdU3Ek__BackingField_5)); }
inline uint64_t get_U3CIdU3Ek__BackingField_5() const { return ___U3CIdU3Ek__BackingField_5; }
inline uint64_t* get_address_of_U3CIdU3Ek__BackingField_5() { return &___U3CIdU3Ek__BackingField_5; }
inline void set_U3CIdU3Ek__BackingField_5(uint64_t value)
{
___U3CIdU3Ek__BackingField_5 = value;
}
inline static int32_t get_offset_of_U3CGeometryTypeU3Ek__BackingField_6() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ___U3CGeometryTypeU3Ek__BackingField_6)); }
inline int32_t get_U3CGeometryTypeU3Ek__BackingField_6() const { return ___U3CGeometryTypeU3Ek__BackingField_6; }
inline int32_t* get_address_of_U3CGeometryTypeU3Ek__BackingField_6() { return &___U3CGeometryTypeU3Ek__BackingField_6; }
inline void set_U3CGeometryTypeU3Ek__BackingField_6(int32_t value)
{
___U3CGeometryTypeU3Ek__BackingField_6 = value;
}
inline static int32_t get_offset_of_U3CGeometryCommandsU3Ek__BackingField_7() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ___U3CGeometryCommandsU3Ek__BackingField_7)); }
inline List_1_t4032136720 * get_U3CGeometryCommandsU3Ek__BackingField_7() const { return ___U3CGeometryCommandsU3Ek__BackingField_7; }
inline List_1_t4032136720 ** get_address_of_U3CGeometryCommandsU3Ek__BackingField_7() { return &___U3CGeometryCommandsU3Ek__BackingField_7; }
inline void set_U3CGeometryCommandsU3Ek__BackingField_7(List_1_t4032136720 * value)
{
___U3CGeometryCommandsU3Ek__BackingField_7 = value;
Il2CppCodeGenWriteBarrier((&___U3CGeometryCommandsU3Ek__BackingField_7), value);
}
inline static int32_t get_offset_of_U3CTagsU3Ek__BackingField_8() { return static_cast<int32_t>(offsetof(VectorTileFeature_t4093669591, ___U3CTagsU3Ek__BackingField_8)); }
inline List_1_t128053199 * get_U3CTagsU3Ek__BackingField_8() const { return ___U3CTagsU3Ek__BackingField_8; }
inline List_1_t128053199 ** get_address_of_U3CTagsU3Ek__BackingField_8() { return &___U3CTagsU3Ek__BackingField_8; }
inline void set_U3CTagsU3Ek__BackingField_8(List_1_t128053199 * value)
{
___U3CTagsU3Ek__BackingField_8 = value;
Il2CppCodeGenWriteBarrier((&___U3CTagsU3Ek__BackingField_8), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VECTORTILEFEATURE_T4093669591_H
#ifndef POLYTREE_T3708317675_H
#define POLYTREE_T3708317675_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyTree
struct PolyTree_t3708317675 : public PolyNode_t1300984468
{
public:
// System.Collections.Generic.List`1<Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyNode> Mapbox.VectorTile.Geometry.InteralClipperLib.InternalClipper/PolyTree::m_AllPolys
List_1_t2773059210 * ___m_AllPolys_7;
public:
inline static int32_t get_offset_of_m_AllPolys_7() { return static_cast<int32_t>(offsetof(PolyTree_t3708317675, ___m_AllPolys_7)); }
inline List_1_t2773059210 * get_m_AllPolys_7() const { return ___m_AllPolys_7; }
inline List_1_t2773059210 ** get_address_of_m_AllPolys_7() { return &___m_AllPolys_7; }
inline void set_m_AllPolys_7(List_1_t2773059210 * value)
{
___m_AllPolys_7 = value;
Il2CppCodeGenWriteBarrier((&___m_AllPolys_7), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // POLYTREE_T3708317675_H
#ifndef MODIFIERBASE_T1320963181_H
#define MODIFIERBASE_T1320963181_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Unity.MeshGeneration.Modifiers.ModifierBase
struct ModifierBase_t1320963181 : public ScriptableObject_t2528358522
{
public:
// System.Boolean Mapbox.Unity.MeshGeneration.Modifiers.ModifierBase::Active
bool ___Active_2;
public:
inline static int32_t get_offset_of_Active_2() { return static_cast<int32_t>(offsetof(ModifierBase_t1320963181, ___Active_2)); }
inline bool get_Active_2() const { return ___Active_2; }
inline bool* get_address_of_Active_2() { return &___Active_2; }
inline void set_Active_2(bool value)
{
___Active_2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MODIFIERBASE_T1320963181_H
#ifndef BEHAVIOUR_T1437897464_H
#define BEHAVIOUR_T1437897464_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Behaviour
struct Behaviour_t1437897464 : public Component_t1923634451
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // BEHAVIOUR_T1437897464_H
#ifndef GAMEOBJECTMODIFIER_T609190006_H
#define GAMEOBJECTMODIFIER_T609190006_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Unity.MeshGeneration.Modifiers.GameObjectModifier
struct GameObjectModifier_t609190006 : public ModifierBase_t1320963181
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // GAMEOBJECTMODIFIER_T609190006_H
#ifndef MONOBEHAVIOUR_T3962482529_H
#define MONOBEHAVIOUR_T3962482529_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.MonoBehaviour
struct MonoBehaviour_t3962482529 : public Behaviour_t1437897464
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MONOBEHAVIOUR_T3962482529_H
#ifndef ABSTRACTALIGNMENTSTRATEGY_T2689440908_H
#define ABSTRACTALIGNMENTSTRATEGY_T2689440908_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Unity.Ar.AbstractAlignmentStrategy
struct AbstractAlignmentStrategy_t2689440908 : public MonoBehaviour_t3962482529
{
public:
// UnityEngine.Transform Mapbox.Unity.Ar.AbstractAlignmentStrategy::_transform
Transform_t3600365921 * ____transform_2;
public:
inline static int32_t get_offset_of__transform_2() { return static_cast<int32_t>(offsetof(AbstractAlignmentStrategy_t2689440908, ____transform_2)); }
inline Transform_t3600365921 * get__transform_2() const { return ____transform_2; }
inline Transform_t3600365921 ** get_address_of__transform_2() { return &____transform_2; }
inline void set__transform_2(Transform_t3600365921 * value)
{
____transform_2 = value;
Il2CppCodeGenWriteBarrier((&____transform_2), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ABSTRACTALIGNMENTSTRATEGY_T2689440908_H
#ifndef ROTATEWITHLOCATIONPROVIDER_T2777253481_H
#define ROTATEWITHLOCATIONPROVIDER_T2777253481_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.RotateWithLocationProvider
struct RotateWithLocationProvider_t2777253481 : public MonoBehaviour_t3962482529
{
public:
// System.Single Mapbox.Examples.RotateWithLocationProvider::_rotationFollowFactor
float ____rotationFollowFactor_2;
// System.Boolean Mapbox.Examples.RotateWithLocationProvider::_rotateZ
bool ____rotateZ_3;
// System.Boolean Mapbox.Examples.RotateWithLocationProvider::_useTransformLocationProvider
bool ____useTransformLocationProvider_4;
// UnityEngine.Quaternion Mapbox.Examples.RotateWithLocationProvider::_targetRotation
Quaternion_t2301928331 ____targetRotation_5;
// Mapbox.Unity.Location.ILocationProvider Mapbox.Examples.RotateWithLocationProvider::_locationProvider
RuntimeObject* ____locationProvider_6;
// UnityEngine.Vector3 Mapbox.Examples.RotateWithLocationProvider::_targetPosition
Vector3_t3722313464 ____targetPosition_7;
public:
inline static int32_t get_offset_of__rotationFollowFactor_2() { return static_cast<int32_t>(offsetof(RotateWithLocationProvider_t2777253481, ____rotationFollowFactor_2)); }
inline float get__rotationFollowFactor_2() const { return ____rotationFollowFactor_2; }
inline float* get_address_of__rotationFollowFactor_2() { return &____rotationFollowFactor_2; }
inline void set__rotationFollowFactor_2(float value)
{
____rotationFollowFactor_2 = value;
}
inline static int32_t get_offset_of__rotateZ_3() { return static_cast<int32_t>(offsetof(RotateWithLocationProvider_t2777253481, ____rotateZ_3)); }
inline bool get__rotateZ_3() const { return ____rotateZ_3; }
inline bool* get_address_of__rotateZ_3() { return &____rotateZ_3; }
inline void set__rotateZ_3(bool value)
{
____rotateZ_3 = value;
}
inline static int32_t get_offset_of__useTransformLocationProvider_4() { return static_cast<int32_t>(offsetof(RotateWithLocationProvider_t2777253481, ____useTransformLocationProvider_4)); }
inline bool get__useTransformLocationProvider_4() const { return ____useTransformLocationProvider_4; }
inline bool* get_address_of__useTransformLocationProvider_4() { return &____useTransformLocationProvider_4; }
inline void set__useTransformLocationProvider_4(bool value)
{
____useTransformLocationProvider_4 = value;
}
inline static int32_t get_offset_of__targetRotation_5() { return static_cast<int32_t>(offsetof(RotateWithLocationProvider_t2777253481, ____targetRotation_5)); }
inline Quaternion_t2301928331 get__targetRotation_5() const { return ____targetRotation_5; }
inline Quaternion_t2301928331 * get_address_of__targetRotation_5() { return &____targetRotation_5; }
inline void set__targetRotation_5(Quaternion_t2301928331 value)
{
____targetRotation_5 = value;
}
inline static int32_t get_offset_of__locationProvider_6() { return static_cast<int32_t>(offsetof(RotateWithLocationProvider_t2777253481, ____locationProvider_6)); }
inline RuntimeObject* get__locationProvider_6() const { return ____locationProvider_6; }
inline RuntimeObject** get_address_of__locationProvider_6() { return &____locationProvider_6; }
inline void set__locationProvider_6(RuntimeObject* value)
{
____locationProvider_6 = value;
Il2CppCodeGenWriteBarrier((&____locationProvider_6), value);
}
inline static int32_t get_offset_of__targetPosition_7() { return static_cast<int32_t>(offsetof(RotateWithLocationProvider_t2777253481, ____targetPosition_7)); }
inline Vector3_t3722313464 get__targetPosition_7() const { return ____targetPosition_7; }
inline Vector3_t3722313464 * get_address_of__targetPosition_7() { return &____targetPosition_7; }
inline void set__targetPosition_7(Vector3_t3722313464 value)
{
____targetPosition_7 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ROTATEWITHLOCATIONPROVIDER_T2777253481_H
#ifndef REVERSEGEOCODEUSERINPUT_T2632079094_H
#define REVERSEGEOCODEUSERINPUT_T2632079094_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.ReverseGeocodeUserInput
struct ReverseGeocodeUserInput_t2632079094 : public MonoBehaviour_t3962482529
{
public:
// UnityEngine.UI.InputField Mapbox.Examples.ReverseGeocodeUserInput::_inputField
InputField_t3762917431 * ____inputField_2;
// Mapbox.Geocoding.ReverseGeocodeResource Mapbox.Examples.ReverseGeocodeUserInput::_resource
ReverseGeocodeResource_t2777886177 * ____resource_3;
// Mapbox.Geocoding.Geocoder Mapbox.Examples.ReverseGeocodeUserInput::_geocoder
Geocoder_t3195298050 * ____geocoder_4;
// Mapbox.Utils.Vector2d Mapbox.Examples.ReverseGeocodeUserInput::_coordinate
Vector2d_t1865246568 ____coordinate_5;
// System.Boolean Mapbox.Examples.ReverseGeocodeUserInput::_hasResponse
bool ____hasResponse_6;
// Mapbox.Geocoding.ReverseGeocodeResponse Mapbox.Examples.ReverseGeocodeUserInput::<Response>k__BackingField
ReverseGeocodeResponse_t3723437562 * ___U3CResponseU3Ek__BackingField_7;
// System.EventHandler`1<System.EventArgs> Mapbox.Examples.ReverseGeocodeUserInput::OnGeocoderResponse
EventHandler_1_t1515976428 * ___OnGeocoderResponse_8;
public:
inline static int32_t get_offset_of__inputField_2() { return static_cast<int32_t>(offsetof(ReverseGeocodeUserInput_t2632079094, ____inputField_2)); }
inline InputField_t3762917431 * get__inputField_2() const { return ____inputField_2; }
inline InputField_t3762917431 ** get_address_of__inputField_2() { return &____inputField_2; }
inline void set__inputField_2(InputField_t3762917431 * value)
{
____inputField_2 = value;
Il2CppCodeGenWriteBarrier((&____inputField_2), value);
}
inline static int32_t get_offset_of__resource_3() { return static_cast<int32_t>(offsetof(ReverseGeocodeUserInput_t2632079094, ____resource_3)); }
inline ReverseGeocodeResource_t2777886177 * get__resource_3() const { return ____resource_3; }
inline ReverseGeocodeResource_t2777886177 ** get_address_of__resource_3() { return &____resource_3; }
inline void set__resource_3(ReverseGeocodeResource_t2777886177 * value)
{
____resource_3 = value;
Il2CppCodeGenWriteBarrier((&____resource_3), value);
}
inline static int32_t get_offset_of__geocoder_4() { return static_cast<int32_t>(offsetof(ReverseGeocodeUserInput_t2632079094, ____geocoder_4)); }
inline Geocoder_t3195298050 * get__geocoder_4() const { return ____geocoder_4; }
inline Geocoder_t3195298050 ** get_address_of__geocoder_4() { return &____geocoder_4; }
inline void set__geocoder_4(Geocoder_t3195298050 * value)
{
____geocoder_4 = value;
Il2CppCodeGenWriteBarrier((&____geocoder_4), value);
}
inline static int32_t get_offset_of__coordinate_5() { return static_cast<int32_t>(offsetof(ReverseGeocodeUserInput_t2632079094, ____coordinate_5)); }
inline Vector2d_t1865246568 get__coordinate_5() const { return ____coordinate_5; }
inline Vector2d_t1865246568 * get_address_of__coordinate_5() { return &____coordinate_5; }
inline void set__coordinate_5(Vector2d_t1865246568 value)
{
____coordinate_5 = value;
}
inline static int32_t get_offset_of__hasResponse_6() { return static_cast<int32_t>(offsetof(ReverseGeocodeUserInput_t2632079094, ____hasResponse_6)); }
inline bool get__hasResponse_6() const { return ____hasResponse_6; }
inline bool* get_address_of__hasResponse_6() { return &____hasResponse_6; }
inline void set__hasResponse_6(bool value)
{
____hasResponse_6 = value;
}
inline static int32_t get_offset_of_U3CResponseU3Ek__BackingField_7() { return static_cast<int32_t>(offsetof(ReverseGeocodeUserInput_t2632079094, ___U3CResponseU3Ek__BackingField_7)); }
inline ReverseGeocodeResponse_t3723437562 * get_U3CResponseU3Ek__BackingField_7() const { return ___U3CResponseU3Ek__BackingField_7; }
inline ReverseGeocodeResponse_t3723437562 ** get_address_of_U3CResponseU3Ek__BackingField_7() { return &___U3CResponseU3Ek__BackingField_7; }
inline void set_U3CResponseU3Ek__BackingField_7(ReverseGeocodeResponse_t3723437562 * value)
{
___U3CResponseU3Ek__BackingField_7 = value;
Il2CppCodeGenWriteBarrier((&___U3CResponseU3Ek__BackingField_7), value);
}
inline static int32_t get_offset_of_OnGeocoderResponse_8() { return static_cast<int32_t>(offsetof(ReverseGeocodeUserInput_t2632079094, ___OnGeocoderResponse_8)); }
inline EventHandler_1_t1515976428 * get_OnGeocoderResponse_8() const { return ___OnGeocoderResponse_8; }
inline EventHandler_1_t1515976428 ** get_address_of_OnGeocoderResponse_8() { return &___OnGeocoderResponse_8; }
inline void set_OnGeocoderResponse_8(EventHandler_1_t1515976428 * value)
{
___OnGeocoderResponse_8 = value;
Il2CppCodeGenWriteBarrier((&___OnGeocoderResponse_8), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // REVERSEGEOCODEUSERINPUT_T2632079094_H
#ifndef RELOADMAP_T3484436943_H
#define RELOADMAP_T3484436943_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.ReloadMap
struct ReloadMap_t3484436943 : public MonoBehaviour_t3962482529
{
public:
// UnityEngine.Camera Mapbox.Examples.ReloadMap::_camera
Camera_t4157153871 * ____camera_2;
// UnityEngine.Vector3 Mapbox.Examples.ReloadMap::_cameraStartPos
Vector3_t3722313464 ____cameraStartPos_3;
// Mapbox.Unity.Map.AbstractMap Mapbox.Examples.ReloadMap::_map
AbstractMap_t3082917158 * ____map_4;
// Mapbox.Examples.ForwardGeocodeUserInput Mapbox.Examples.ReloadMap::_forwardGeocoder
ForwardGeocodeUserInput_t2575136032 * ____forwardGeocoder_5;
// UnityEngine.UI.Slider Mapbox.Examples.ReloadMap::_zoomSlider
Slider_t3903728902 * ____zoomSlider_6;
// UnityEngine.Coroutine Mapbox.Examples.ReloadMap::_reloadRoutine
Coroutine_t3829159415 * ____reloadRoutine_7;
// UnityEngine.WaitForSeconds Mapbox.Examples.ReloadMap::_wait
WaitForSeconds_t1699091251 * ____wait_8;
public:
inline static int32_t get_offset_of__camera_2() { return static_cast<int32_t>(offsetof(ReloadMap_t3484436943, ____camera_2)); }
inline Camera_t4157153871 * get__camera_2() const { return ____camera_2; }
inline Camera_t4157153871 ** get_address_of__camera_2() { return &____camera_2; }
inline void set__camera_2(Camera_t4157153871 * value)
{
____camera_2 = value;
Il2CppCodeGenWriteBarrier((&____camera_2), value);
}
inline static int32_t get_offset_of__cameraStartPos_3() { return static_cast<int32_t>(offsetof(ReloadMap_t3484436943, ____cameraStartPos_3)); }
inline Vector3_t3722313464 get__cameraStartPos_3() const { return ____cameraStartPos_3; }
inline Vector3_t3722313464 * get_address_of__cameraStartPos_3() { return &____cameraStartPos_3; }
inline void set__cameraStartPos_3(Vector3_t3722313464 value)
{
____cameraStartPos_3 = value;
}
inline static int32_t get_offset_of__map_4() { return static_cast<int32_t>(offsetof(ReloadMap_t3484436943, ____map_4)); }
inline AbstractMap_t3082917158 * get__map_4() const { return ____map_4; }
inline AbstractMap_t3082917158 ** get_address_of__map_4() { return &____map_4; }
inline void set__map_4(AbstractMap_t3082917158 * value)
{
____map_4 = value;
Il2CppCodeGenWriteBarrier((&____map_4), value);
}
inline static int32_t get_offset_of__forwardGeocoder_5() { return static_cast<int32_t>(offsetof(ReloadMap_t3484436943, ____forwardGeocoder_5)); }
inline ForwardGeocodeUserInput_t2575136032 * get__forwardGeocoder_5() const { return ____forwardGeocoder_5; }
inline ForwardGeocodeUserInput_t2575136032 ** get_address_of__forwardGeocoder_5() { return &____forwardGeocoder_5; }
inline void set__forwardGeocoder_5(ForwardGeocodeUserInput_t2575136032 * value)
{
____forwardGeocoder_5 = value;
Il2CppCodeGenWriteBarrier((&____forwardGeocoder_5), value);
}
inline static int32_t get_offset_of__zoomSlider_6() { return static_cast<int32_t>(offsetof(ReloadMap_t3484436943, ____zoomSlider_6)); }
inline Slider_t3903728902 * get__zoomSlider_6() const { return ____zoomSlider_6; }
inline Slider_t3903728902 ** get_address_of__zoomSlider_6() { return &____zoomSlider_6; }
inline void set__zoomSlider_6(Slider_t3903728902 * value)
{
____zoomSlider_6 = value;
Il2CppCodeGenWriteBarrier((&____zoomSlider_6), value);
}
inline static int32_t get_offset_of__reloadRoutine_7() { return static_cast<int32_t>(offsetof(ReloadMap_t3484436943, ____reloadRoutine_7)); }
inline Coroutine_t3829159415 * get__reloadRoutine_7() const { return ____reloadRoutine_7; }
inline Coroutine_t3829159415 ** get_address_of__reloadRoutine_7() { return &____reloadRoutine_7; }
inline void set__reloadRoutine_7(Coroutine_t3829159415 * value)
{
____reloadRoutine_7 = value;
Il2CppCodeGenWriteBarrier((&____reloadRoutine_7), value);
}
inline static int32_t get_offset_of__wait_8() { return static_cast<int32_t>(offsetof(ReloadMap_t3484436943, ____wait_8)); }
inline WaitForSeconds_t1699091251 * get__wait_8() const { return ____wait_8; }
inline WaitForSeconds_t1699091251 ** get_address_of__wait_8() { return &____wait_8; }
inline void set__wait_8(WaitForSeconds_t1699091251 * value)
{
____wait_8 = value;
Il2CppCodeGenWriteBarrier((&____wait_8), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // RELOADMAP_T3484436943_H
#ifndef CAMERABILLBOARD_T2325764960_H
#define CAMERABILLBOARD_T2325764960_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.CameraBillboard
struct CameraBillboard_t2325764960 : public MonoBehaviour_t3962482529
{
public:
// UnityEngine.Camera Mapbox.Examples.CameraBillboard::_camera
Camera_t4157153871 * ____camera_2;
public:
inline static int32_t get_offset_of__camera_2() { return static_cast<int32_t>(offsetof(CameraBillboard_t2325764960, ____camera_2)); }
inline Camera_t4157153871 * get__camera_2() const { return ____camera_2; }
inline Camera_t4157153871 ** get_address_of__camera_2() { return &____camera_2; }
inline void set__camera_2(Camera_t4157153871 * value)
{
____camera_2 = value;
Il2CppCodeGenWriteBarrier((&____camera_2), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CAMERABILLBOARD_T2325764960_H
#ifndef VECTORTILEEXAMPLE_T4002429299_H
#define VECTORTILEEXAMPLE_T4002429299_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.Playground.VectorTileExample
struct VectorTileExample_t4002429299 : public MonoBehaviour_t3962482529
{
public:
// Mapbox.Examples.ForwardGeocodeUserInput Mapbox.Examples.Playground.VectorTileExample::_searchLocation
ForwardGeocodeUserInput_t2575136032 * ____searchLocation_2;
// UnityEngine.UI.Text Mapbox.Examples.Playground.VectorTileExample::_resultsText
Text_t1901882714 * ____resultsText_3;
// Mapbox.Map.Map`1<Mapbox.Map.VectorTile> Mapbox.Examples.Playground.VectorTileExample::_map
Map_1_t3054239837 * ____map_4;
public:
inline static int32_t get_offset_of__searchLocation_2() { return static_cast<int32_t>(offsetof(VectorTileExample_t4002429299, ____searchLocation_2)); }
inline ForwardGeocodeUserInput_t2575136032 * get__searchLocation_2() const { return ____searchLocation_2; }
inline ForwardGeocodeUserInput_t2575136032 ** get_address_of__searchLocation_2() { return &____searchLocation_2; }
inline void set__searchLocation_2(ForwardGeocodeUserInput_t2575136032 * value)
{
____searchLocation_2 = value;
Il2CppCodeGenWriteBarrier((&____searchLocation_2), value);
}
inline static int32_t get_offset_of__resultsText_3() { return static_cast<int32_t>(offsetof(VectorTileExample_t4002429299, ____resultsText_3)); }
inline Text_t1901882714 * get__resultsText_3() const { return ____resultsText_3; }
inline Text_t1901882714 ** get_address_of__resultsText_3() { return &____resultsText_3; }
inline void set__resultsText_3(Text_t1901882714 * value)
{
____resultsText_3 = value;
Il2CppCodeGenWriteBarrier((&____resultsText_3), value);
}
inline static int32_t get_offset_of__map_4() { return static_cast<int32_t>(offsetof(VectorTileExample_t4002429299, ____map_4)); }
inline Map_1_t3054239837 * get__map_4() const { return ____map_4; }
inline Map_1_t3054239837 ** get_address_of__map_4() { return &____map_4; }
inline void set__map_4(Map_1_t3054239837 * value)
{
____map_4 = value;
Il2CppCodeGenWriteBarrier((&____map_4), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VECTORTILEEXAMPLE_T4002429299_H
#ifndef REVERSEGEOCODEREXAMPLE_T1816435679_H
#define REVERSEGEOCODEREXAMPLE_T1816435679_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.Playground.ReverseGeocoderExample
struct ReverseGeocoderExample_t1816435679 : public MonoBehaviour_t3962482529
{
public:
// Mapbox.Examples.ReverseGeocodeUserInput Mapbox.Examples.Playground.ReverseGeocoderExample::_searchLocation
ReverseGeocodeUserInput_t2632079094 * ____searchLocation_2;
// UnityEngine.UI.Text Mapbox.Examples.Playground.ReverseGeocoderExample::_resultsText
Text_t1901882714 * ____resultsText_3;
public:
inline static int32_t get_offset_of__searchLocation_2() { return static_cast<int32_t>(offsetof(ReverseGeocoderExample_t1816435679, ____searchLocation_2)); }
inline ReverseGeocodeUserInput_t2632079094 * get__searchLocation_2() const { return ____searchLocation_2; }
inline ReverseGeocodeUserInput_t2632079094 ** get_address_of__searchLocation_2() { return &____searchLocation_2; }
inline void set__searchLocation_2(ReverseGeocodeUserInput_t2632079094 * value)
{
____searchLocation_2 = value;
Il2CppCodeGenWriteBarrier((&____searchLocation_2), value);
}
inline static int32_t get_offset_of__resultsText_3() { return static_cast<int32_t>(offsetof(ReverseGeocoderExample_t1816435679, ____resultsText_3)); }
inline Text_t1901882714 * get__resultsText_3() const { return ____resultsText_3; }
inline Text_t1901882714 ** get_address_of__resultsText_3() { return &____resultsText_3; }
inline void set__resultsText_3(Text_t1901882714 * value)
{
____resultsText_3 = value;
Il2CppCodeGenWriteBarrier((&____resultsText_3), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // REVERSEGEOCODEREXAMPLE_T1816435679_H
#ifndef RASTERTILEEXAMPLE_T3949613556_H
#define RASTERTILEEXAMPLE_T3949613556_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.Playground.RasterTileExample
struct RasterTileExample_t3949613556 : public MonoBehaviour_t3962482529
{
public:
// Mapbox.Examples.ForwardGeocodeUserInput Mapbox.Examples.Playground.RasterTileExample::_searchLocation
ForwardGeocodeUserInput_t2575136032 * ____searchLocation_2;
// UnityEngine.UI.Slider Mapbox.Examples.Playground.RasterTileExample::_zoomSlider
Slider_t3903728902 * ____zoomSlider_3;
// UnityEngine.UI.Dropdown Mapbox.Examples.Playground.RasterTileExample::_stylesDropdown
Dropdown_t2274391225 * ____stylesDropdown_4;
// UnityEngine.UI.RawImage Mapbox.Examples.Playground.RasterTileExample::_imageContainer
RawImage_t3182918964 * ____imageContainer_5;
// Mapbox.Map.Map`1<Mapbox.Map.RasterTile> Mapbox.Examples.Playground.RasterTileExample::_map
Map_1_t1665010825 * ____map_6;
// System.String Mapbox.Examples.Playground.RasterTileExample::_latLon
String_t* ____latLon_7;
// System.String[] Mapbox.Examples.Playground.RasterTileExample::_mapboxStyles
StringU5BU5D_t1281789340* ____mapboxStyles_8;
// Mapbox.Utils.Vector2d Mapbox.Examples.Playground.RasterTileExample::_startLoc
Vector2d_t1865246568 ____startLoc_9;
// System.Int32 Mapbox.Examples.Playground.RasterTileExample::_mapstyle
int32_t ____mapstyle_10;
public:
inline static int32_t get_offset_of__searchLocation_2() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____searchLocation_2)); }
inline ForwardGeocodeUserInput_t2575136032 * get__searchLocation_2() const { return ____searchLocation_2; }
inline ForwardGeocodeUserInput_t2575136032 ** get_address_of__searchLocation_2() { return &____searchLocation_2; }
inline void set__searchLocation_2(ForwardGeocodeUserInput_t2575136032 * value)
{
____searchLocation_2 = value;
Il2CppCodeGenWriteBarrier((&____searchLocation_2), value);
}
inline static int32_t get_offset_of__zoomSlider_3() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____zoomSlider_3)); }
inline Slider_t3903728902 * get__zoomSlider_3() const { return ____zoomSlider_3; }
inline Slider_t3903728902 ** get_address_of__zoomSlider_3() { return &____zoomSlider_3; }
inline void set__zoomSlider_3(Slider_t3903728902 * value)
{
____zoomSlider_3 = value;
Il2CppCodeGenWriteBarrier((&____zoomSlider_3), value);
}
inline static int32_t get_offset_of__stylesDropdown_4() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____stylesDropdown_4)); }
inline Dropdown_t2274391225 * get__stylesDropdown_4() const { return ____stylesDropdown_4; }
inline Dropdown_t2274391225 ** get_address_of__stylesDropdown_4() { return &____stylesDropdown_4; }
inline void set__stylesDropdown_4(Dropdown_t2274391225 * value)
{
____stylesDropdown_4 = value;
Il2CppCodeGenWriteBarrier((&____stylesDropdown_4), value);
}
inline static int32_t get_offset_of__imageContainer_5() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____imageContainer_5)); }
inline RawImage_t3182918964 * get__imageContainer_5() const { return ____imageContainer_5; }
inline RawImage_t3182918964 ** get_address_of__imageContainer_5() { return &____imageContainer_5; }
inline void set__imageContainer_5(RawImage_t3182918964 * value)
{
____imageContainer_5 = value;
Il2CppCodeGenWriteBarrier((&____imageContainer_5), value);
}
inline static int32_t get_offset_of__map_6() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____map_6)); }
inline Map_1_t1665010825 * get__map_6() const { return ____map_6; }
inline Map_1_t1665010825 ** get_address_of__map_6() { return &____map_6; }
inline void set__map_6(Map_1_t1665010825 * value)
{
____map_6 = value;
Il2CppCodeGenWriteBarrier((&____map_6), value);
}
inline static int32_t get_offset_of__latLon_7() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____latLon_7)); }
inline String_t* get__latLon_7() const { return ____latLon_7; }
inline String_t** get_address_of__latLon_7() { return &____latLon_7; }
inline void set__latLon_7(String_t* value)
{
____latLon_7 = value;
Il2CppCodeGenWriteBarrier((&____latLon_7), value);
}
inline static int32_t get_offset_of__mapboxStyles_8() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____mapboxStyles_8)); }
inline StringU5BU5D_t1281789340* get__mapboxStyles_8() const { return ____mapboxStyles_8; }
inline StringU5BU5D_t1281789340** get_address_of__mapboxStyles_8() { return &____mapboxStyles_8; }
inline void set__mapboxStyles_8(StringU5BU5D_t1281789340* value)
{
____mapboxStyles_8 = value;
Il2CppCodeGenWriteBarrier((&____mapboxStyles_8), value);
}
inline static int32_t get_offset_of__startLoc_9() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____startLoc_9)); }
inline Vector2d_t1865246568 get__startLoc_9() const { return ____startLoc_9; }
inline Vector2d_t1865246568 * get_address_of__startLoc_9() { return &____startLoc_9; }
inline void set__startLoc_9(Vector2d_t1865246568 value)
{
____startLoc_9 = value;
}
inline static int32_t get_offset_of__mapstyle_10() { return static_cast<int32_t>(offsetof(RasterTileExample_t3949613556, ____mapstyle_10)); }
inline int32_t get__mapstyle_10() const { return ____mapstyle_10; }
inline int32_t* get_address_of__mapstyle_10() { return &____mapstyle_10; }
inline void set__mapstyle_10(int32_t value)
{
____mapstyle_10 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // RASTERTILEEXAMPLE_T3949613556_H
#ifndef FORWARDGEOCODEREXAMPLE_T595455162_H
#define FORWARDGEOCODEREXAMPLE_T595455162_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.Playground.ForwardGeocoderExample
struct ForwardGeocoderExample_t595455162 : public MonoBehaviour_t3962482529
{
public:
// Mapbox.Examples.ForwardGeocodeUserInput Mapbox.Examples.Playground.ForwardGeocoderExample::_searchLocation
ForwardGeocodeUserInput_t2575136032 * ____searchLocation_2;
// UnityEngine.UI.Text Mapbox.Examples.Playground.ForwardGeocoderExample::_resultsText
Text_t1901882714 * ____resultsText_3;
public:
inline static int32_t get_offset_of__searchLocation_2() { return static_cast<int32_t>(offsetof(ForwardGeocoderExample_t595455162, ____searchLocation_2)); }
inline ForwardGeocodeUserInput_t2575136032 * get__searchLocation_2() const { return ____searchLocation_2; }
inline ForwardGeocodeUserInput_t2575136032 ** get_address_of__searchLocation_2() { return &____searchLocation_2; }
inline void set__searchLocation_2(ForwardGeocodeUserInput_t2575136032 * value)
{
____searchLocation_2 = value;
Il2CppCodeGenWriteBarrier((&____searchLocation_2), value);
}
inline static int32_t get_offset_of__resultsText_3() { return static_cast<int32_t>(offsetof(ForwardGeocoderExample_t595455162, ____resultsText_3)); }
inline Text_t1901882714 * get__resultsText_3() const { return ____resultsText_3; }
inline Text_t1901882714 ** get_address_of__resultsText_3() { return &____resultsText_3; }
inline void set__resultsText_3(Text_t1901882714 * value)
{
____resultsText_3 = value;
Il2CppCodeGenWriteBarrier((&____resultsText_3), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // FORWARDGEOCODEREXAMPLE_T595455162_H
#ifndef DIRECTIONSEXAMPLE_T2773998098_H
#define DIRECTIONSEXAMPLE_T2773998098_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.Playground.DirectionsExample
struct DirectionsExample_t2773998098 : public MonoBehaviour_t3962482529
{
public:
// UnityEngine.UI.Text Mapbox.Examples.Playground.DirectionsExample::_resultsText
Text_t1901882714 * ____resultsText_2;
// Mapbox.Examples.ForwardGeocodeUserInput Mapbox.Examples.Playground.DirectionsExample::_startLocationGeocoder
ForwardGeocodeUserInput_t2575136032 * ____startLocationGeocoder_3;
// Mapbox.Examples.ForwardGeocodeUserInput Mapbox.Examples.Playground.DirectionsExample::_endLocationGeocoder
ForwardGeocodeUserInput_t2575136032 * ____endLocationGeocoder_4;
// Mapbox.Directions.Directions Mapbox.Examples.Playground.DirectionsExample::_directions
Directions_t1397515081 * ____directions_5;
// Mapbox.Utils.Vector2d[] Mapbox.Examples.Playground.DirectionsExample::_coordinates
Vector2dU5BU5D_t852968953* ____coordinates_6;
// Mapbox.Directions.DirectionResource Mapbox.Examples.Playground.DirectionsExample::_directionResource
DirectionResource_t3837219169 * ____directionResource_7;
public:
inline static int32_t get_offset_of__resultsText_2() { return static_cast<int32_t>(offsetof(DirectionsExample_t2773998098, ____resultsText_2)); }
inline Text_t1901882714 * get__resultsText_2() const { return ____resultsText_2; }
inline Text_t1901882714 ** get_address_of__resultsText_2() { return &____resultsText_2; }
inline void set__resultsText_2(Text_t1901882714 * value)
{
____resultsText_2 = value;
Il2CppCodeGenWriteBarrier((&____resultsText_2), value);
}
inline static int32_t get_offset_of__startLocationGeocoder_3() { return static_cast<int32_t>(offsetof(DirectionsExample_t2773998098, ____startLocationGeocoder_3)); }
inline ForwardGeocodeUserInput_t2575136032 * get__startLocationGeocoder_3() const { return ____startLocationGeocoder_3; }
inline ForwardGeocodeUserInput_t2575136032 ** get_address_of__startLocationGeocoder_3() { return &____startLocationGeocoder_3; }
inline void set__startLocationGeocoder_3(ForwardGeocodeUserInput_t2575136032 * value)
{
____startLocationGeocoder_3 = value;
Il2CppCodeGenWriteBarrier((&____startLocationGeocoder_3), value);
}
inline static int32_t get_offset_of__endLocationGeocoder_4() { return static_cast<int32_t>(offsetof(DirectionsExample_t2773998098, ____endLocationGeocoder_4)); }
inline ForwardGeocodeUserInput_t2575136032 * get__endLocationGeocoder_4() const { return ____endLocationGeocoder_4; }
inline ForwardGeocodeUserInput_t2575136032 ** get_address_of__endLocationGeocoder_4() { return &____endLocationGeocoder_4; }
inline void set__endLocationGeocoder_4(ForwardGeocodeUserInput_t2575136032 * value)
{
____endLocationGeocoder_4 = value;
Il2CppCodeGenWriteBarrier((&____endLocationGeocoder_4), value);
}
inline static int32_t get_offset_of__directions_5() { return static_cast<int32_t>(offsetof(DirectionsExample_t2773998098, ____directions_5)); }
inline Directions_t1397515081 * get__directions_5() const { return ____directions_5; }
inline Directions_t1397515081 ** get_address_of__directions_5() { return &____directions_5; }
inline void set__directions_5(Directions_t1397515081 * value)
{
____directions_5 = value;
Il2CppCodeGenWriteBarrier((&____directions_5), value);
}
inline static int32_t get_offset_of__coordinates_6() { return static_cast<int32_t>(offsetof(DirectionsExample_t2773998098, ____coordinates_6)); }
inline Vector2dU5BU5D_t852968953* get__coordinates_6() const { return ____coordinates_6; }
inline Vector2dU5BU5D_t852968953** get_address_of__coordinates_6() { return &____coordinates_6; }
inline void set__coordinates_6(Vector2dU5BU5D_t852968953* value)
{
____coordinates_6 = value;
Il2CppCodeGenWriteBarrier((&____coordinates_6), value);
}
inline static int32_t get_offset_of__directionResource_7() { return static_cast<int32_t>(offsetof(DirectionsExample_t2773998098, ____directionResource_7)); }
inline DirectionResource_t3837219169 * get__directionResource_7() const { return ____directionResource_7; }
inline DirectionResource_t3837219169 ** get_address_of__directionResource_7() { return &____directionResource_7; }
inline void set__directionResource_7(DirectionResource_t3837219169 * value)
{
____directionResource_7 = value;
Il2CppCodeGenWriteBarrier((&____directionResource_7), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DIRECTIONSEXAMPLE_T2773998098_H
#ifndef MAPMATCHINGEXAMPLE_T325328315_H
#define MAPMATCHINGEXAMPLE_T325328315_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.MapMatchingExample
struct MapMatchingExample_t325328315 : public MonoBehaviour_t3962482529
{
public:
// Mapbox.Unity.Map.AbstractMap Mapbox.Examples.MapMatchingExample::_map
AbstractMap_t3082917158 * ____map_2;
// UnityEngine.LineRenderer Mapbox.Examples.MapMatchingExample::_originalRoute
LineRenderer_t3154350270 * ____originalRoute_3;
// UnityEngine.LineRenderer Mapbox.Examples.MapMatchingExample::_mapMatchRoute
LineRenderer_t3154350270 * ____mapMatchRoute_4;
// System.Boolean Mapbox.Examples.MapMatchingExample::_useTransformLocationProvider
bool ____useTransformLocationProvider_5;
// Mapbox.MapMatching.Profile Mapbox.Examples.MapMatchingExample::_profile
int32_t ____profile_6;
// System.Single Mapbox.Examples.MapMatchingExample::_lineHeight
float ____lineHeight_7;
// System.Collections.Generic.List`1<Mapbox.Unity.Location.Location> Mapbox.Examples.MapMatchingExample::_locations
List_1_t3502158253 * ____locations_8;
// Mapbox.MapMatching.MapMatcher Mapbox.Examples.MapMatchingExample::_mapMatcher
MapMatcher_t3570695288 * ____mapMatcher_9;
// Mapbox.Unity.Location.ILocationProvider Mapbox.Examples.MapMatchingExample::_locationProvider
RuntimeObject* ____locationProvider_10;
public:
inline static int32_t get_offset_of__map_2() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____map_2)); }
inline AbstractMap_t3082917158 * get__map_2() const { return ____map_2; }
inline AbstractMap_t3082917158 ** get_address_of__map_2() { return &____map_2; }
inline void set__map_2(AbstractMap_t3082917158 * value)
{
____map_2 = value;
Il2CppCodeGenWriteBarrier((&____map_2), value);
}
inline static int32_t get_offset_of__originalRoute_3() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____originalRoute_3)); }
inline LineRenderer_t3154350270 * get__originalRoute_3() const { return ____originalRoute_3; }
inline LineRenderer_t3154350270 ** get_address_of__originalRoute_3() { return &____originalRoute_3; }
inline void set__originalRoute_3(LineRenderer_t3154350270 * value)
{
____originalRoute_3 = value;
Il2CppCodeGenWriteBarrier((&____originalRoute_3), value);
}
inline static int32_t get_offset_of__mapMatchRoute_4() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____mapMatchRoute_4)); }
inline LineRenderer_t3154350270 * get__mapMatchRoute_4() const { return ____mapMatchRoute_4; }
inline LineRenderer_t3154350270 ** get_address_of__mapMatchRoute_4() { return &____mapMatchRoute_4; }
inline void set__mapMatchRoute_4(LineRenderer_t3154350270 * value)
{
____mapMatchRoute_4 = value;
Il2CppCodeGenWriteBarrier((&____mapMatchRoute_4), value);
}
inline static int32_t get_offset_of__useTransformLocationProvider_5() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____useTransformLocationProvider_5)); }
inline bool get__useTransformLocationProvider_5() const { return ____useTransformLocationProvider_5; }
inline bool* get_address_of__useTransformLocationProvider_5() { return &____useTransformLocationProvider_5; }
inline void set__useTransformLocationProvider_5(bool value)
{
____useTransformLocationProvider_5 = value;
}
inline static int32_t get_offset_of__profile_6() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____profile_6)); }
inline int32_t get__profile_6() const { return ____profile_6; }
inline int32_t* get_address_of__profile_6() { return &____profile_6; }
inline void set__profile_6(int32_t value)
{
____profile_6 = value;
}
inline static int32_t get_offset_of__lineHeight_7() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____lineHeight_7)); }
inline float get__lineHeight_7() const { return ____lineHeight_7; }
inline float* get_address_of__lineHeight_7() { return &____lineHeight_7; }
inline void set__lineHeight_7(float value)
{
____lineHeight_7 = value;
}
inline static int32_t get_offset_of__locations_8() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____locations_8)); }
inline List_1_t3502158253 * get__locations_8() const { return ____locations_8; }
inline List_1_t3502158253 ** get_address_of__locations_8() { return &____locations_8; }
inline void set__locations_8(List_1_t3502158253 * value)
{
____locations_8 = value;
Il2CppCodeGenWriteBarrier((&____locations_8), value);
}
inline static int32_t get_offset_of__mapMatcher_9() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____mapMatcher_9)); }
inline MapMatcher_t3570695288 * get__mapMatcher_9() const { return ____mapMatcher_9; }
inline MapMatcher_t3570695288 ** get_address_of__mapMatcher_9() { return &____mapMatcher_9; }
inline void set__mapMatcher_9(MapMatcher_t3570695288 * value)
{
____mapMatcher_9 = value;
Il2CppCodeGenWriteBarrier((&____mapMatcher_9), value);
}
inline static int32_t get_offset_of__locationProvider_10() { return static_cast<int32_t>(offsetof(MapMatchingExample_t325328315, ____locationProvider_10)); }
inline RuntimeObject* get__locationProvider_10() const { return ____locationProvider_10; }
inline RuntimeObject** get_address_of__locationProvider_10() { return &____locationProvider_10; }
inline void set__locationProvider_10(RuntimeObject* value)
{
____locationProvider_10 = value;
Il2CppCodeGenWriteBarrier((&____locationProvider_10), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MAPMATCHINGEXAMPLE_T325328315_H
#ifndef PLOTROUTE_T1165660348_H
#define PLOTROUTE_T1165660348_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.PlotRoute
struct PlotRoute_t1165660348 : public MonoBehaviour_t3962482529
{
public:
// UnityEngine.Transform Mapbox.Examples.PlotRoute::_target
Transform_t3600365921 * ____target_2;
// UnityEngine.Color Mapbox.Examples.PlotRoute::_color
Color_t2555686324 ____color_3;
// System.Single Mapbox.Examples.PlotRoute::_height
float ____height_4;
// System.Single Mapbox.Examples.PlotRoute::_lineWidth
float ____lineWidth_5;
// System.Single Mapbox.Examples.PlotRoute::_updateInterval
float ____updateInterval_6;
// System.Single Mapbox.Examples.PlotRoute::_minDistance
float ____minDistance_7;
// UnityEngine.LineRenderer Mapbox.Examples.PlotRoute::_lineRenderer
LineRenderer_t3154350270 * ____lineRenderer_8;
// System.Single Mapbox.Examples.PlotRoute::_elapsedTime
float ____elapsedTime_9;
// System.Int32 Mapbox.Examples.PlotRoute::_currentIndex
int32_t ____currentIndex_10;
// System.Single Mapbox.Examples.PlotRoute::_sqDistance
float ____sqDistance_11;
// UnityEngine.Vector3 Mapbox.Examples.PlotRoute::_lastPosition
Vector3_t3722313464 ____lastPosition_12;
// System.Boolean Mapbox.Examples.PlotRoute::_isStable
bool ____isStable_13;
public:
inline static int32_t get_offset_of__target_2() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____target_2)); }
inline Transform_t3600365921 * get__target_2() const { return ____target_2; }
inline Transform_t3600365921 ** get_address_of__target_2() { return &____target_2; }
inline void set__target_2(Transform_t3600365921 * value)
{
____target_2 = value;
Il2CppCodeGenWriteBarrier((&____target_2), value);
}
inline static int32_t get_offset_of__color_3() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____color_3)); }
inline Color_t2555686324 get__color_3() const { return ____color_3; }
inline Color_t2555686324 * get_address_of__color_3() { return &____color_3; }
inline void set__color_3(Color_t2555686324 value)
{
____color_3 = value;
}
inline static int32_t get_offset_of__height_4() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____height_4)); }
inline float get__height_4() const { return ____height_4; }
inline float* get_address_of__height_4() { return &____height_4; }
inline void set__height_4(float value)
{
____height_4 = value;
}
inline static int32_t get_offset_of__lineWidth_5() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____lineWidth_5)); }
inline float get__lineWidth_5() const { return ____lineWidth_5; }
inline float* get_address_of__lineWidth_5() { return &____lineWidth_5; }
inline void set__lineWidth_5(float value)
{
____lineWidth_5 = value;
}
inline static int32_t get_offset_of__updateInterval_6() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____updateInterval_6)); }
inline float get__updateInterval_6() const { return ____updateInterval_6; }
inline float* get_address_of__updateInterval_6() { return &____updateInterval_6; }
inline void set__updateInterval_6(float value)
{
____updateInterval_6 = value;
}
inline static int32_t get_offset_of__minDistance_7() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____minDistance_7)); }
inline float get__minDistance_7() const { return ____minDistance_7; }
inline float* get_address_of__minDistance_7() { return &____minDistance_7; }
inline void set__minDistance_7(float value)
{
____minDistance_7 = value;
}
inline static int32_t get_offset_of__lineRenderer_8() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____lineRenderer_8)); }
inline LineRenderer_t3154350270 * get__lineRenderer_8() const { return ____lineRenderer_8; }
inline LineRenderer_t3154350270 ** get_address_of__lineRenderer_8() { return &____lineRenderer_8; }
inline void set__lineRenderer_8(LineRenderer_t3154350270 * value)
{
____lineRenderer_8 = value;
Il2CppCodeGenWriteBarrier((&____lineRenderer_8), value);
}
inline static int32_t get_offset_of__elapsedTime_9() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____elapsedTime_9)); }
inline float get__elapsedTime_9() const { return ____elapsedTime_9; }
inline float* get_address_of__elapsedTime_9() { return &____elapsedTime_9; }
inline void set__elapsedTime_9(float value)
{
____elapsedTime_9 = value;
}
inline static int32_t get_offset_of__currentIndex_10() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____currentIndex_10)); }
inline int32_t get__currentIndex_10() const { return ____currentIndex_10; }
inline int32_t* get_address_of__currentIndex_10() { return &____currentIndex_10; }
inline void set__currentIndex_10(int32_t value)
{
____currentIndex_10 = value;
}
inline static int32_t get_offset_of__sqDistance_11() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____sqDistance_11)); }
inline float get__sqDistance_11() const { return ____sqDistance_11; }
inline float* get_address_of__sqDistance_11() { return &____sqDistance_11; }
inline void set__sqDistance_11(float value)
{
____sqDistance_11 = value;
}
inline static int32_t get_offset_of__lastPosition_12() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____lastPosition_12)); }
inline Vector3_t3722313464 get__lastPosition_12() const { return ____lastPosition_12; }
inline Vector3_t3722313464 * get_address_of__lastPosition_12() { return &____lastPosition_12; }
inline void set__lastPosition_12(Vector3_t3722313464 value)
{
____lastPosition_12 = value;
}
inline static int32_t get_offset_of__isStable_13() { return static_cast<int32_t>(offsetof(PlotRoute_t1165660348, ____isStable_13)); }
inline bool get__isStable_13() const { return ____isStable_13; }
inline bool* get_address_of__isStable_13() { return &____isStable_13; }
inline void set__isStable_13(bool value)
{
____isStable_13 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // PLOTROUTE_T1165660348_H
#ifndef VOXELFETCHER_T3713644963_H
#define VOXELFETCHER_T3713644963_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.Voxels.VoxelFetcher
struct VoxelFetcher_t3713644963 : public MonoBehaviour_t3962482529
{
public:
// Mapbox.Examples.Voxels.VoxelColorMapper[] Mapbox.Examples.Voxels.VoxelFetcher::_voxels
VoxelColorMapperU5BU5D_t1422690960* ____voxels_2;
public:
inline static int32_t get_offset_of__voxels_2() { return static_cast<int32_t>(offsetof(VoxelFetcher_t3713644963, ____voxels_2)); }
inline VoxelColorMapperU5BU5D_t1422690960* get__voxels_2() const { return ____voxels_2; }
inline VoxelColorMapperU5BU5D_t1422690960** get_address_of__voxels_2() { return &____voxels_2; }
inline void set__voxels_2(VoxelColorMapperU5BU5D_t1422690960* value)
{
____voxels_2 = value;
Il2CppCodeGenWriteBarrier((&____voxels_2), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VOXELFETCHER_T3713644963_H
#ifndef VOXELTILE_T1944340880_H
#define VOXELTILE_T1944340880_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.Voxels.VoxelTile
struct VoxelTile_t1944340880 : public MonoBehaviour_t3962482529
{
public:
// Mapbox.Examples.ForwardGeocodeUserInput Mapbox.Examples.Voxels.VoxelTile::_geocodeInput
ForwardGeocodeUserInput_t2575136032 * ____geocodeInput_2;
// System.Int32 Mapbox.Examples.Voxels.VoxelTile::_zoom
int32_t ____zoom_3;
// System.Single Mapbox.Examples.Voxels.VoxelTile::_elevationMultiplier
float ____elevationMultiplier_4;
// System.Int32 Mapbox.Examples.Voxels.VoxelTile::_voxelDepthPadding
int32_t ____voxelDepthPadding_5;
// System.Int32 Mapbox.Examples.Voxels.VoxelTile::_tileWidthInVoxels
int32_t ____tileWidthInVoxels_6;
// Mapbox.Examples.Voxels.VoxelFetcher Mapbox.Examples.Voxels.VoxelTile::_voxelFetcher
VoxelFetcher_t3713644963 * ____voxelFetcher_7;
// UnityEngine.GameObject Mapbox.Examples.Voxels.VoxelTile::_camera
GameObject_t1113636619 * ____camera_8;
// System.Int32 Mapbox.Examples.Voxels.VoxelTile::_voxelBatchCount
int32_t ____voxelBatchCount_9;
// System.String Mapbox.Examples.Voxels.VoxelTile::_styleUrl
String_t* ____styleUrl_10;
// Mapbox.Map.Map`1<Mapbox.Map.RasterTile> Mapbox.Examples.Voxels.VoxelTile::_raster
Map_1_t1665010825 * ____raster_11;
// Mapbox.Map.Map`1<Mapbox.Map.RawPngRasterTile> Mapbox.Examples.Voxels.VoxelTile::_elevation
Map_1_t1070764774 * ____elevation_12;
// UnityEngine.Texture2D Mapbox.Examples.Voxels.VoxelTile::_rasterTexture
Texture2D_t3840446185 * ____rasterTexture_13;
// UnityEngine.Texture2D Mapbox.Examples.Voxels.VoxelTile::_elevationTexture
Texture2D_t3840446185 * ____elevationTexture_14;
// Mapbox.Platform.IFileSource Mapbox.Examples.Voxels.VoxelTile::_fileSource
RuntimeObject* ____fileSource_15;
// System.Collections.Generic.List`1<Mapbox.Examples.Voxels.VoxelData> Mapbox.Examples.Voxels.VoxelTile::_voxels
List_1_t3720956926 * ____voxels_16;
// System.Collections.Generic.List`1<UnityEngine.GameObject> Mapbox.Examples.Voxels.VoxelTile::_instantiatedVoxels
List_1_t2585711361 * ____instantiatedVoxels_17;
// System.Single Mapbox.Examples.Voxels.VoxelTile::_tileScale
float ____tileScale_18;
public:
inline static int32_t get_offset_of__geocodeInput_2() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____geocodeInput_2)); }
inline ForwardGeocodeUserInput_t2575136032 * get__geocodeInput_2() const { return ____geocodeInput_2; }
inline ForwardGeocodeUserInput_t2575136032 ** get_address_of__geocodeInput_2() { return &____geocodeInput_2; }
inline void set__geocodeInput_2(ForwardGeocodeUserInput_t2575136032 * value)
{
____geocodeInput_2 = value;
Il2CppCodeGenWriteBarrier((&____geocodeInput_2), value);
}
inline static int32_t get_offset_of__zoom_3() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____zoom_3)); }
inline int32_t get__zoom_3() const { return ____zoom_3; }
inline int32_t* get_address_of__zoom_3() { return &____zoom_3; }
inline void set__zoom_3(int32_t value)
{
____zoom_3 = value;
}
inline static int32_t get_offset_of__elevationMultiplier_4() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____elevationMultiplier_4)); }
inline float get__elevationMultiplier_4() const { return ____elevationMultiplier_4; }
inline float* get_address_of__elevationMultiplier_4() { return &____elevationMultiplier_4; }
inline void set__elevationMultiplier_4(float value)
{
____elevationMultiplier_4 = value;
}
inline static int32_t get_offset_of__voxelDepthPadding_5() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____voxelDepthPadding_5)); }
inline int32_t get__voxelDepthPadding_5() const { return ____voxelDepthPadding_5; }
inline int32_t* get_address_of__voxelDepthPadding_5() { return &____voxelDepthPadding_5; }
inline void set__voxelDepthPadding_5(int32_t value)
{
____voxelDepthPadding_5 = value;
}
inline static int32_t get_offset_of__tileWidthInVoxels_6() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____tileWidthInVoxels_6)); }
inline int32_t get__tileWidthInVoxels_6() const { return ____tileWidthInVoxels_6; }
inline int32_t* get_address_of__tileWidthInVoxels_6() { return &____tileWidthInVoxels_6; }
inline void set__tileWidthInVoxels_6(int32_t value)
{
____tileWidthInVoxels_6 = value;
}
inline static int32_t get_offset_of__voxelFetcher_7() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____voxelFetcher_7)); }
inline VoxelFetcher_t3713644963 * get__voxelFetcher_7() const { return ____voxelFetcher_7; }
inline VoxelFetcher_t3713644963 ** get_address_of__voxelFetcher_7() { return &____voxelFetcher_7; }
inline void set__voxelFetcher_7(VoxelFetcher_t3713644963 * value)
{
____voxelFetcher_7 = value;
Il2CppCodeGenWriteBarrier((&____voxelFetcher_7), value);
}
inline static int32_t get_offset_of__camera_8() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____camera_8)); }
inline GameObject_t1113636619 * get__camera_8() const { return ____camera_8; }
inline GameObject_t1113636619 ** get_address_of__camera_8() { return &____camera_8; }
inline void set__camera_8(GameObject_t1113636619 * value)
{
____camera_8 = value;
Il2CppCodeGenWriteBarrier((&____camera_8), value);
}
inline static int32_t get_offset_of__voxelBatchCount_9() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____voxelBatchCount_9)); }
inline int32_t get__voxelBatchCount_9() const { return ____voxelBatchCount_9; }
inline int32_t* get_address_of__voxelBatchCount_9() { return &____voxelBatchCount_9; }
inline void set__voxelBatchCount_9(int32_t value)
{
____voxelBatchCount_9 = value;
}
inline static int32_t get_offset_of__styleUrl_10() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____styleUrl_10)); }
inline String_t* get__styleUrl_10() const { return ____styleUrl_10; }
inline String_t** get_address_of__styleUrl_10() { return &____styleUrl_10; }
inline void set__styleUrl_10(String_t* value)
{
____styleUrl_10 = value;
Il2CppCodeGenWriteBarrier((&____styleUrl_10), value);
}
inline static int32_t get_offset_of__raster_11() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____raster_11)); }
inline Map_1_t1665010825 * get__raster_11() const { return ____raster_11; }
inline Map_1_t1665010825 ** get_address_of__raster_11() { return &____raster_11; }
inline void set__raster_11(Map_1_t1665010825 * value)
{
____raster_11 = value;
Il2CppCodeGenWriteBarrier((&____raster_11), value);
}
inline static int32_t get_offset_of__elevation_12() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____elevation_12)); }
inline Map_1_t1070764774 * get__elevation_12() const { return ____elevation_12; }
inline Map_1_t1070764774 ** get_address_of__elevation_12() { return &____elevation_12; }
inline void set__elevation_12(Map_1_t1070764774 * value)
{
____elevation_12 = value;
Il2CppCodeGenWriteBarrier((&____elevation_12), value);
}
inline static int32_t get_offset_of__rasterTexture_13() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____rasterTexture_13)); }
inline Texture2D_t3840446185 * get__rasterTexture_13() const { return ____rasterTexture_13; }
inline Texture2D_t3840446185 ** get_address_of__rasterTexture_13() { return &____rasterTexture_13; }
inline void set__rasterTexture_13(Texture2D_t3840446185 * value)
{
____rasterTexture_13 = value;
Il2CppCodeGenWriteBarrier((&____rasterTexture_13), value);
}
inline static int32_t get_offset_of__elevationTexture_14() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____elevationTexture_14)); }
inline Texture2D_t3840446185 * get__elevationTexture_14() const { return ____elevationTexture_14; }
inline Texture2D_t3840446185 ** get_address_of__elevationTexture_14() { return &____elevationTexture_14; }
inline void set__elevationTexture_14(Texture2D_t3840446185 * value)
{
____elevationTexture_14 = value;
Il2CppCodeGenWriteBarrier((&____elevationTexture_14), value);
}
inline static int32_t get_offset_of__fileSource_15() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____fileSource_15)); }
inline RuntimeObject* get__fileSource_15() const { return ____fileSource_15; }
inline RuntimeObject** get_address_of__fileSource_15() { return &____fileSource_15; }
inline void set__fileSource_15(RuntimeObject* value)
{
____fileSource_15 = value;
Il2CppCodeGenWriteBarrier((&____fileSource_15), value);
}
inline static int32_t get_offset_of__voxels_16() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____voxels_16)); }
inline List_1_t3720956926 * get__voxels_16() const { return ____voxels_16; }
inline List_1_t3720956926 ** get_address_of__voxels_16() { return &____voxels_16; }
inline void set__voxels_16(List_1_t3720956926 * value)
{
____voxels_16 = value;
Il2CppCodeGenWriteBarrier((&____voxels_16), value);
}
inline static int32_t get_offset_of__instantiatedVoxels_17() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____instantiatedVoxels_17)); }
inline List_1_t2585711361 * get__instantiatedVoxels_17() const { return ____instantiatedVoxels_17; }
inline List_1_t2585711361 ** get_address_of__instantiatedVoxels_17() { return &____instantiatedVoxels_17; }
inline void set__instantiatedVoxels_17(List_1_t2585711361 * value)
{
____instantiatedVoxels_17 = value;
Il2CppCodeGenWriteBarrier((&____instantiatedVoxels_17), value);
}
inline static int32_t get_offset_of__tileScale_18() { return static_cast<int32_t>(offsetof(VoxelTile_t1944340880, ____tileScale_18)); }
inline float get__tileScale_18() const { return ____tileScale_18; }
inline float* get_address_of__tileScale_18() { return &____tileScale_18; }
inline void set__tileScale_18(float value)
{
____tileScale_18 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VOXELTILE_T1944340880_H
#ifndef DRAGROTATE_T2912444650_H
#define DRAGROTATE_T2912444650_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.Scripts.Utilities.DragRotate
struct DragRotate_t2912444650 : public MonoBehaviour_t3962482529
{
public:
// UnityEngine.Transform Mapbox.Examples.Scripts.Utilities.DragRotate::_objectToRotate
Transform_t3600365921 * ____objectToRotate_2;
// System.Single Mapbox.Examples.Scripts.Utilities.DragRotate::_multiplier
float ____multiplier_3;
// UnityEngine.Vector3 Mapbox.Examples.Scripts.Utilities.DragRotate::_startTouchPosition
Vector3_t3722313464 ____startTouchPosition_4;
public:
inline static int32_t get_offset_of__objectToRotate_2() { return static_cast<int32_t>(offsetof(DragRotate_t2912444650, ____objectToRotate_2)); }
inline Transform_t3600365921 * get__objectToRotate_2() const { return ____objectToRotate_2; }
inline Transform_t3600365921 ** get_address_of__objectToRotate_2() { return &____objectToRotate_2; }
inline void set__objectToRotate_2(Transform_t3600365921 * value)
{
____objectToRotate_2 = value;
Il2CppCodeGenWriteBarrier((&____objectToRotate_2), value);
}
inline static int32_t get_offset_of__multiplier_3() { return static_cast<int32_t>(offsetof(DragRotate_t2912444650, ____multiplier_3)); }
inline float get__multiplier_3() const { return ____multiplier_3; }
inline float* get_address_of__multiplier_3() { return &____multiplier_3; }
inline void set__multiplier_3(float value)
{
____multiplier_3 = value;
}
inline static int32_t get_offset_of__startTouchPosition_4() { return static_cast<int32_t>(offsetof(DragRotate_t2912444650, ____startTouchPosition_4)); }
inline Vector3_t3722313464 get__startTouchPosition_4() const { return ____startTouchPosition_4; }
inline Vector3_t3722313464 * get_address_of__startTouchPosition_4() { return &____startTouchPosition_4; }
inline void set__startTouchPosition_4(Vector3_t3722313464 value)
{
____startTouchPosition_4 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DRAGROTATE_T2912444650_H
#ifndef SPAWNONGLOBEEXAMPLE_T1835218885_H
#define SPAWNONGLOBEEXAMPLE_T1835218885_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.SpawnOnGlobeExample
struct SpawnOnGlobeExample_t1835218885 : public MonoBehaviour_t3962482529
{
public:
// Mapbox.Unity.MeshGeneration.Factories.FlatSphereTerrainFactory Mapbox.Examples.SpawnOnGlobeExample::_globeFactory
FlatSphereTerrainFactory_t1099794750 * ____globeFactory_2;
// System.String[] Mapbox.Examples.SpawnOnGlobeExample::_locations
StringU5BU5D_t1281789340* ____locations_3;
// System.Single Mapbox.Examples.SpawnOnGlobeExample::_spawnScale
float ____spawnScale_4;
// UnityEngine.GameObject Mapbox.Examples.SpawnOnGlobeExample::_markerPrefab
GameObject_t1113636619 * ____markerPrefab_5;
public:
inline static int32_t get_offset_of__globeFactory_2() { return static_cast<int32_t>(offsetof(SpawnOnGlobeExample_t1835218885, ____globeFactory_2)); }
inline FlatSphereTerrainFactory_t1099794750 * get__globeFactory_2() const { return ____globeFactory_2; }
inline FlatSphereTerrainFactory_t1099794750 ** get_address_of__globeFactory_2() { return &____globeFactory_2; }
inline void set__globeFactory_2(FlatSphereTerrainFactory_t1099794750 * value)
{
____globeFactory_2 = value;
Il2CppCodeGenWriteBarrier((&____globeFactory_2), value);
}
inline static int32_t get_offset_of__locations_3() { return static_cast<int32_t>(offsetof(SpawnOnGlobeExample_t1835218885, ____locations_3)); }
inline StringU5BU5D_t1281789340* get__locations_3() const { return ____locations_3; }
inline StringU5BU5D_t1281789340** get_address_of__locations_3() { return &____locations_3; }
inline void set__locations_3(StringU5BU5D_t1281789340* value)
{
____locations_3 = value;
Il2CppCodeGenWriteBarrier((&____locations_3), value);
}
inline static int32_t get_offset_of__spawnScale_4() { return static_cast<int32_t>(offsetof(SpawnOnGlobeExample_t1835218885, ____spawnScale_4)); }
inline float get__spawnScale_4() const { return ____spawnScale_4; }
inline float* get_address_of__spawnScale_4() { return &____spawnScale_4; }
inline void set__spawnScale_4(float value)
{
____spawnScale_4 = value;
}
inline static int32_t get_offset_of__markerPrefab_5() { return static_cast<int32_t>(offsetof(SpawnOnGlobeExample_t1835218885, ____markerPrefab_5)); }
inline GameObject_t1113636619 * get__markerPrefab_5() const { return ____markerPrefab_5; }
inline GameObject_t1113636619 ** get_address_of__markerPrefab_5() { return &____markerPrefab_5; }
inline void set__markerPrefab_5(GameObject_t1113636619 * value)
{
____markerPrefab_5 = value;
Il2CppCodeGenWriteBarrier((&____markerPrefab_5), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SPAWNONGLOBEEXAMPLE_T1835218885_H
#ifndef CAMERAMOVEMENT_T3562026478_H
#define CAMERAMOVEMENT_T3562026478_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.CameraMovement
struct CameraMovement_t3562026478 : public MonoBehaviour_t3962482529
{
public:
// System.Single Mapbox.Examples.CameraMovement::_panSpeed
float ____panSpeed_2;
// System.Single Mapbox.Examples.CameraMovement::_zoomSpeed
float ____zoomSpeed_3;
// UnityEngine.Camera Mapbox.Examples.CameraMovement::_referenceCamera
Camera_t4157153871 * ____referenceCamera_4;
// UnityEngine.Quaternion Mapbox.Examples.CameraMovement::_originalRotation
Quaternion_t2301928331 ____originalRotation_5;
// UnityEngine.Vector3 Mapbox.Examples.CameraMovement::_origin
Vector3_t3722313464 ____origin_6;
// UnityEngine.Vector3 Mapbox.Examples.CameraMovement::_delta
Vector3_t3722313464 ____delta_7;
// System.Boolean Mapbox.Examples.CameraMovement::_shouldDrag
bool ____shouldDrag_8;
public:
inline static int32_t get_offset_of__panSpeed_2() { return static_cast<int32_t>(offsetof(CameraMovement_t3562026478, ____panSpeed_2)); }
inline float get__panSpeed_2() const { return ____panSpeed_2; }
inline float* get_address_of__panSpeed_2() { return &____panSpeed_2; }
inline void set__panSpeed_2(float value)
{
____panSpeed_2 = value;
}
inline static int32_t get_offset_of__zoomSpeed_3() { return static_cast<int32_t>(offsetof(CameraMovement_t3562026478, ____zoomSpeed_3)); }
inline float get__zoomSpeed_3() const { return ____zoomSpeed_3; }
inline float* get_address_of__zoomSpeed_3() { return &____zoomSpeed_3; }
inline void set__zoomSpeed_3(float value)
{
____zoomSpeed_3 = value;
}
inline static int32_t get_offset_of__referenceCamera_4() { return static_cast<int32_t>(offsetof(CameraMovement_t3562026478, ____referenceCamera_4)); }
inline Camera_t4157153871 * get__referenceCamera_4() const { return ____referenceCamera_4; }
inline Camera_t4157153871 ** get_address_of__referenceCamera_4() { return &____referenceCamera_4; }
inline void set__referenceCamera_4(Camera_t4157153871 * value)
{
____referenceCamera_4 = value;
Il2CppCodeGenWriteBarrier((&____referenceCamera_4), value);
}
inline static int32_t get_offset_of__originalRotation_5() { return static_cast<int32_t>(offsetof(CameraMovement_t3562026478, ____originalRotation_5)); }
inline Quaternion_t2301928331 get__originalRotation_5() const { return ____originalRotation_5; }
inline Quaternion_t2301928331 * get_address_of__originalRotation_5() { return &____originalRotation_5; }
inline void set__originalRotation_5(Quaternion_t2301928331 value)
{
____originalRotation_5 = value;
}
inline static int32_t get_offset_of__origin_6() { return static_cast<int32_t>(offsetof(CameraMovement_t3562026478, ____origin_6)); }
inline Vector3_t3722313464 get__origin_6() const { return ____origin_6; }
inline Vector3_t3722313464 * get_address_of__origin_6() { return &____origin_6; }
inline void set__origin_6(Vector3_t3722313464 value)
{
____origin_6 = value;
}
inline static int32_t get_offset_of__delta_7() { return static_cast<int32_t>(offsetof(CameraMovement_t3562026478, ____delta_7)); }
inline Vector3_t3722313464 get__delta_7() const { return ____delta_7; }
inline Vector3_t3722313464 * get_address_of__delta_7() { return &____delta_7; }
inline void set__delta_7(Vector3_t3722313464 value)
{
____delta_7 = value;
}
inline static int32_t get_offset_of__shouldDrag_8() { return static_cast<int32_t>(offsetof(CameraMovement_t3562026478, ____shouldDrag_8)); }
inline bool get__shouldDrag_8() const { return ____shouldDrag_8; }
inline bool* get_address_of__shouldDrag_8() { return &____shouldDrag_8; }
inline void set__shouldDrag_8(bool value)
{
____shouldDrag_8 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CAMERAMOVEMENT_T3562026478_H
#ifndef LOADINGPANELCONTROLLER_T2494933297_H
#define LOADINGPANELCONTROLLER_T2494933297_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.LoadingPanelController
struct LoadingPanelController_t2494933297 : public MonoBehaviour_t3962482529
{
public:
// UnityEngine.GameObject Mapbox.Examples.LoadingPanelController::_content
GameObject_t1113636619 * ____content_2;
// UnityEngine.UI.Text Mapbox.Examples.LoadingPanelController::_text
Text_t1901882714 * ____text_3;
// UnityEngine.AnimationCurve Mapbox.Examples.LoadingPanelController::_curve
AnimationCurve_t3046754366 * ____curve_4;
public:
inline static int32_t get_offset_of__content_2() { return static_cast<int32_t>(offsetof(LoadingPanelController_t2494933297, ____content_2)); }
inline GameObject_t1113636619 * get__content_2() const { return ____content_2; }
inline GameObject_t1113636619 ** get_address_of__content_2() { return &____content_2; }
inline void set__content_2(GameObject_t1113636619 * value)
{
____content_2 = value;
Il2CppCodeGenWriteBarrier((&____content_2), value);
}
inline static int32_t get_offset_of__text_3() { return static_cast<int32_t>(offsetof(LoadingPanelController_t2494933297, ____text_3)); }
inline Text_t1901882714 * get__text_3() const { return ____text_3; }
inline Text_t1901882714 ** get_address_of__text_3() { return &____text_3; }
inline void set__text_3(Text_t1901882714 * value)
{
____text_3 = value;
Il2CppCodeGenWriteBarrier((&____text_3), value);
}
inline static int32_t get_offset_of__curve_4() { return static_cast<int32_t>(offsetof(LoadingPanelController_t2494933297, ____curve_4)); }
inline AnimationCurve_t3046754366 * get__curve_4() const { return ____curve_4; }
inline AnimationCurve_t3046754366 ** get_address_of__curve_4() { return &____curve_4; }
inline void set__curve_4(AnimationCurve_t3046754366 * value)
{
____curve_4 = value;
Il2CppCodeGenWriteBarrier((&____curve_4), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // LOADINGPANELCONTROLLER_T2494933297_H
#ifndef MAKIHELPER_T3260814930_H
#define MAKIHELPER_T3260814930_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.MakiHelper
struct MakiHelper_t3260814930 : public MonoBehaviour_t3962482529
{
public:
// UnityEngine.GameObject Mapbox.Examples.MakiHelper::_uiObject
GameObject_t1113636619 * ____uiObject_4;
public:
inline static int32_t get_offset_of__uiObject_4() { return static_cast<int32_t>(offsetof(MakiHelper_t3260814930, ____uiObject_4)); }
inline GameObject_t1113636619 * get__uiObject_4() const { return ____uiObject_4; }
inline GameObject_t1113636619 ** get_address_of__uiObject_4() { return &____uiObject_4; }
inline void set__uiObject_4(GameObject_t1113636619 * value)
{
____uiObject_4 = value;
Il2CppCodeGenWriteBarrier((&____uiObject_4), value);
}
};
struct MakiHelper_t3260814930_StaticFields
{
public:
// UnityEngine.RectTransform Mapbox.Examples.MakiHelper::Parent
RectTransform_t3704657025 * ___Parent_2;
// UnityEngine.GameObject Mapbox.Examples.MakiHelper::UiPrefab
GameObject_t1113636619 * ___UiPrefab_3;
public:
inline static int32_t get_offset_of_Parent_2() { return static_cast<int32_t>(offsetof(MakiHelper_t3260814930_StaticFields, ___Parent_2)); }
inline RectTransform_t3704657025 * get_Parent_2() const { return ___Parent_2; }
inline RectTransform_t3704657025 ** get_address_of_Parent_2() { return &___Parent_2; }
inline void set_Parent_2(RectTransform_t3704657025 * value)
{
___Parent_2 = value;
Il2CppCodeGenWriteBarrier((&___Parent_2), value);
}
inline static int32_t get_offset_of_UiPrefab_3() { return static_cast<int32_t>(offsetof(MakiHelper_t3260814930_StaticFields, ___UiPrefab_3)); }
inline GameObject_t1113636619 * get_UiPrefab_3() const { return ___UiPrefab_3; }
inline GameObject_t1113636619 ** get_address_of_UiPrefab_3() { return &___UiPrefab_3; }
inline void set_UiPrefab_3(GameObject_t1113636619 * value)
{
___UiPrefab_3 = value;
Il2CppCodeGenWriteBarrier((&___UiPrefab_3), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MAKIHELPER_T3260814930_H
#ifndef OBJECTINSPECTORMODIFIER_T3950592485_H
#define OBJECTINSPECTORMODIFIER_T3950592485_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.ObjectInspectorModifier
struct ObjectInspectorModifier_t3950592485 : public GameObjectModifier_t609190006
{
public:
// System.Collections.Generic.Dictionary`2<UnityEngine.GameObject,Mapbox.Examples.FeatureSelectionDetector> Mapbox.Examples.ObjectInspectorModifier::_detectors
Dictionary_2_t2340548174 * ____detectors_3;
// Mapbox.Examples.FeatureUiMarker Mapbox.Examples.ObjectInspectorModifier::_marker
FeatureUiMarker_t3847499068 * ____marker_4;
// Mapbox.Examples.FeatureSelectionDetector Mapbox.Examples.ObjectInspectorModifier::_tempDetector
FeatureSelectionDetector_t508482069 * ____tempDetector_5;
public:
inline static int32_t get_offset_of__detectors_3() { return static_cast<int32_t>(offsetof(ObjectInspectorModifier_t3950592485, ____detectors_3)); }
inline Dictionary_2_t2340548174 * get__detectors_3() const { return ____detectors_3; }
inline Dictionary_2_t2340548174 ** get_address_of__detectors_3() { return &____detectors_3; }
inline void set__detectors_3(Dictionary_2_t2340548174 * value)
{
____detectors_3 = value;
Il2CppCodeGenWriteBarrier((&____detectors_3), value);
}
inline static int32_t get_offset_of__marker_4() { return static_cast<int32_t>(offsetof(ObjectInspectorModifier_t3950592485, ____marker_4)); }
inline FeatureUiMarker_t3847499068 * get__marker_4() const { return ____marker_4; }
inline FeatureUiMarker_t3847499068 ** get_address_of__marker_4() { return &____marker_4; }
inline void set__marker_4(FeatureUiMarker_t3847499068 * value)
{
____marker_4 = value;
Il2CppCodeGenWriteBarrier((&____marker_4), value);
}
inline static int32_t get_offset_of__tempDetector_5() { return static_cast<int32_t>(offsetof(ObjectInspectorModifier_t3950592485, ____tempDetector_5)); }
inline FeatureSelectionDetector_t508482069 * get__tempDetector_5() const { return ____tempDetector_5; }
inline FeatureSelectionDetector_t508482069 ** get_address_of__tempDetector_5() { return &____tempDetector_5; }
inline void set__tempDetector_5(FeatureSelectionDetector_t508482069 * value)
{
____tempDetector_5 = value;
Il2CppCodeGenWriteBarrier((&____tempDetector_5), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // OBJECTINSPECTORMODIFIER_T3950592485_H
#ifndef POIMARKERHELPER_T575496201_H
#define POIMARKERHELPER_T575496201_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.PoiMarkerHelper
struct PoiMarkerHelper_t575496201 : public MonoBehaviour_t3962482529
{
public:
// System.Collections.Generic.Dictionary`2<System.String,System.Object> Mapbox.Examples.PoiMarkerHelper::_props
Dictionary_2_t2865362463 * ____props_2;
public:
inline static int32_t get_offset_of__props_2() { return static_cast<int32_t>(offsetof(PoiMarkerHelper_t575496201, ____props_2)); }
inline Dictionary_2_t2865362463 * get__props_2() const { return ____props_2; }
inline Dictionary_2_t2865362463 ** get_address_of__props_2() { return &____props_2; }
inline void set__props_2(Dictionary_2_t2865362463 * value)
{
____props_2 = value;
Il2CppCodeGenWriteBarrier((&____props_2), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // POIMARKERHELPER_T575496201_H
#ifndef POSITIONWITHLOCATIONPROVIDER_T2078499108_H
#define POSITIONWITHLOCATIONPROVIDER_T2078499108_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.PositionWithLocationProvider
struct PositionWithLocationProvider_t2078499108 : public MonoBehaviour_t3962482529
{
public:
// Mapbox.Unity.Map.AbstractMap Mapbox.Examples.PositionWithLocationProvider::_map
AbstractMap_t3082917158 * ____map_2;
// System.Single Mapbox.Examples.PositionWithLocationProvider::_positionFollowFactor
float ____positionFollowFactor_3;
// System.Boolean Mapbox.Examples.PositionWithLocationProvider::_useTransformLocationProvider
bool ____useTransformLocationProvider_4;
// System.Boolean Mapbox.Examples.PositionWithLocationProvider::_isInitialized
bool ____isInitialized_5;
// Mapbox.Unity.Location.ILocationProvider Mapbox.Examples.PositionWithLocationProvider::_locationProvider
RuntimeObject* ____locationProvider_6;
// UnityEngine.Vector3 Mapbox.Examples.PositionWithLocationProvider::_targetPosition
Vector3_t3722313464 ____targetPosition_7;
public:
inline static int32_t get_offset_of__map_2() { return static_cast<int32_t>(offsetof(PositionWithLocationProvider_t2078499108, ____map_2)); }
inline AbstractMap_t3082917158 * get__map_2() const { return ____map_2; }
inline AbstractMap_t3082917158 ** get_address_of__map_2() { return &____map_2; }
inline void set__map_2(AbstractMap_t3082917158 * value)
{
____map_2 = value;
Il2CppCodeGenWriteBarrier((&____map_2), value);
}
inline static int32_t get_offset_of__positionFollowFactor_3() { return static_cast<int32_t>(offsetof(PositionWithLocationProvider_t2078499108, ____positionFollowFactor_3)); }
inline float get__positionFollowFactor_3() const { return ____positionFollowFactor_3; }
inline float* get_address_of__positionFollowFactor_3() { return &____positionFollowFactor_3; }
inline void set__positionFollowFactor_3(float value)
{
____positionFollowFactor_3 = value;
}
inline static int32_t get_offset_of__useTransformLocationProvider_4() { return static_cast<int32_t>(offsetof(PositionWithLocationProvider_t2078499108, ____useTransformLocationProvider_4)); }
inline bool get__useTransformLocationProvider_4() const { return ____useTransformLocationProvider_4; }
inline bool* get_address_of__useTransformLocationProvider_4() { return &____useTransformLocationProvider_4; }
inline void set__useTransformLocationProvider_4(bool value)
{
____useTransformLocationProvider_4 = value;
}
inline static int32_t get_offset_of__isInitialized_5() { return static_cast<int32_t>(offsetof(PositionWithLocationProvider_t2078499108, ____isInitialized_5)); }
inline bool get__isInitialized_5() const { return ____isInitialized_5; }
inline bool* get_address_of__isInitialized_5() { return &____isInitialized_5; }
inline void set__isInitialized_5(bool value)
{
____isInitialized_5 = value;
}
inline static int32_t get_offset_of__locationProvider_6() { return static_cast<int32_t>(offsetof(PositionWithLocationProvider_t2078499108, ____locationProvider_6)); }
inline RuntimeObject* get__locationProvider_6() const { return ____locationProvider_6; }
inline RuntimeObject** get_address_of__locationProvider_6() { return &____locationProvider_6; }
inline void set__locationProvider_6(RuntimeObject* value)
{
____locationProvider_6 = value;
Il2CppCodeGenWriteBarrier((&____locationProvider_6), value);
}
inline static int32_t get_offset_of__targetPosition_7() { return static_cast<int32_t>(offsetof(PositionWithLocationProvider_t2078499108, ____targetPosition_7)); }
inline Vector3_t3722313464 get__targetPosition_7() const { return ____targetPosition_7; }
inline Vector3_t3722313464 * get_address_of__targetPosition_7() { return &____targetPosition_7; }
inline void set__targetPosition_7(Vector3_t3722313464 value)
{
____targetPosition_7 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // POSITIONWITHLOCATIONPROVIDER_T2078499108_H
#ifndef QUADTREECAMERAMOVEMENT_T4261193325_H
#define QUADTREECAMERAMOVEMENT_T4261193325_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.QuadTreeCameraMovement
struct QuadTreeCameraMovement_t4261193325 : public MonoBehaviour_t3962482529
{
public:
// System.Single Mapbox.Examples.QuadTreeCameraMovement::_panSpeed
float ____panSpeed_2;
// System.Single Mapbox.Examples.QuadTreeCameraMovement::_zoomSpeed
float ____zoomSpeed_3;
// UnityEngine.Camera Mapbox.Examples.QuadTreeCameraMovement::_referenceCamera
Camera_t4157153871 * ____referenceCamera_4;
// Mapbox.Unity.Map.QuadTreeTileProvider Mapbox.Examples.QuadTreeCameraMovement::_quadTreeTileProvider
QuadTreeTileProvider_t3777865694 * ____quadTreeTileProvider_5;
// Mapbox.Unity.Map.AbstractMap Mapbox.Examples.QuadTreeCameraMovement::_dynamicZoomMap
AbstractMap_t3082917158 * ____dynamicZoomMap_6;
// System.Boolean Mapbox.Examples.QuadTreeCameraMovement::_useDegreeMethod
bool ____useDegreeMethod_7;
// UnityEngine.Vector3 Mapbox.Examples.QuadTreeCameraMovement::_origin
Vector3_t3722313464 ____origin_8;
// UnityEngine.Vector3 Mapbox.Examples.QuadTreeCameraMovement::_mousePosition
Vector3_t3722313464 ____mousePosition_9;
// UnityEngine.Vector3 Mapbox.Examples.QuadTreeCameraMovement::_mousePositionPrevious
Vector3_t3722313464 ____mousePositionPrevious_10;
// System.Boolean Mapbox.Examples.QuadTreeCameraMovement::_shouldDrag
bool ____shouldDrag_11;
public:
inline static int32_t get_offset_of__panSpeed_2() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____panSpeed_2)); }
inline float get__panSpeed_2() const { return ____panSpeed_2; }
inline float* get_address_of__panSpeed_2() { return &____panSpeed_2; }
inline void set__panSpeed_2(float value)
{
____panSpeed_2 = value;
}
inline static int32_t get_offset_of__zoomSpeed_3() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____zoomSpeed_3)); }
inline float get__zoomSpeed_3() const { return ____zoomSpeed_3; }
inline float* get_address_of__zoomSpeed_3() { return &____zoomSpeed_3; }
inline void set__zoomSpeed_3(float value)
{
____zoomSpeed_3 = value;
}
inline static int32_t get_offset_of__referenceCamera_4() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____referenceCamera_4)); }
inline Camera_t4157153871 * get__referenceCamera_4() const { return ____referenceCamera_4; }
inline Camera_t4157153871 ** get_address_of__referenceCamera_4() { return &____referenceCamera_4; }
inline void set__referenceCamera_4(Camera_t4157153871 * value)
{
____referenceCamera_4 = value;
Il2CppCodeGenWriteBarrier((&____referenceCamera_4), value);
}
inline static int32_t get_offset_of__quadTreeTileProvider_5() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____quadTreeTileProvider_5)); }
inline QuadTreeTileProvider_t3777865694 * get__quadTreeTileProvider_5() const { return ____quadTreeTileProvider_5; }
inline QuadTreeTileProvider_t3777865694 ** get_address_of__quadTreeTileProvider_5() { return &____quadTreeTileProvider_5; }
inline void set__quadTreeTileProvider_5(QuadTreeTileProvider_t3777865694 * value)
{
____quadTreeTileProvider_5 = value;
Il2CppCodeGenWriteBarrier((&____quadTreeTileProvider_5), value);
}
inline static int32_t get_offset_of__dynamicZoomMap_6() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____dynamicZoomMap_6)); }
inline AbstractMap_t3082917158 * get__dynamicZoomMap_6() const { return ____dynamicZoomMap_6; }
inline AbstractMap_t3082917158 ** get_address_of__dynamicZoomMap_6() { return &____dynamicZoomMap_6; }
inline void set__dynamicZoomMap_6(AbstractMap_t3082917158 * value)
{
____dynamicZoomMap_6 = value;
Il2CppCodeGenWriteBarrier((&____dynamicZoomMap_6), value);
}
inline static int32_t get_offset_of__useDegreeMethod_7() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____useDegreeMethod_7)); }
inline bool get__useDegreeMethod_7() const { return ____useDegreeMethod_7; }
inline bool* get_address_of__useDegreeMethod_7() { return &____useDegreeMethod_7; }
inline void set__useDegreeMethod_7(bool value)
{
____useDegreeMethod_7 = value;
}
inline static int32_t get_offset_of__origin_8() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____origin_8)); }
inline Vector3_t3722313464 get__origin_8() const { return ____origin_8; }
inline Vector3_t3722313464 * get_address_of__origin_8() { return &____origin_8; }
inline void set__origin_8(Vector3_t3722313464 value)
{
____origin_8 = value;
}
inline static int32_t get_offset_of__mousePosition_9() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____mousePosition_9)); }
inline Vector3_t3722313464 get__mousePosition_9() const { return ____mousePosition_9; }
inline Vector3_t3722313464 * get_address_of__mousePosition_9() { return &____mousePosition_9; }
inline void set__mousePosition_9(Vector3_t3722313464 value)
{
____mousePosition_9 = value;
}
inline static int32_t get_offset_of__mousePositionPrevious_10() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____mousePositionPrevious_10)); }
inline Vector3_t3722313464 get__mousePositionPrevious_10() const { return ____mousePositionPrevious_10; }
inline Vector3_t3722313464 * get_address_of__mousePositionPrevious_10() { return &____mousePositionPrevious_10; }
inline void set__mousePositionPrevious_10(Vector3_t3722313464 value)
{
____mousePositionPrevious_10 = value;
}
inline static int32_t get_offset_of__shouldDrag_11() { return static_cast<int32_t>(offsetof(QuadTreeCameraMovement_t4261193325, ____shouldDrag_11)); }
inline bool get__shouldDrag_11() const { return ____shouldDrag_11; }
inline bool* get_address_of__shouldDrag_11() { return &____shouldDrag_11; }
inline void set__shouldDrag_11(bool value)
{
____shouldDrag_11 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // QUADTREECAMERAMOVEMENT_T4261193325_H
#ifndef LABELTEXTSETTER_T2340976267_H
#define LABELTEXTSETTER_T2340976267_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.LabelTextSetter
struct LabelTextSetter_t2340976267 : public MonoBehaviour_t3962482529
{
public:
// UnityEngine.TextMesh Mapbox.Examples.LabelTextSetter::_textMesh
TextMesh_t1536577757 * ____textMesh_2;
public:
inline static int32_t get_offset_of__textMesh_2() { return static_cast<int32_t>(offsetof(LabelTextSetter_t2340976267, ____textMesh_2)); }
inline TextMesh_t1536577757 * get__textMesh_2() const { return ____textMesh_2; }
inline TextMesh_t1536577757 ** get_address_of__textMesh_2() { return &____textMesh_2; }
inline void set__textMesh_2(TextMesh_t1536577757 * value)
{
____textMesh_2 = value;
Il2CppCodeGenWriteBarrier((&____textMesh_2), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // LABELTEXTSETTER_T2340976267_H
#ifndef CHANGESHADOWDISTANCE_T4294610605_H
#define CHANGESHADOWDISTANCE_T4294610605_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.ChangeShadowDistance
struct ChangeShadowDistance_t4294610605 : public MonoBehaviour_t3962482529
{
public:
// System.Int32 Mapbox.Examples.ChangeShadowDistance::ShadowDistance
int32_t ___ShadowDistance_2;
public:
inline static int32_t get_offset_of_ShadowDistance_2() { return static_cast<int32_t>(offsetof(ChangeShadowDistance_t4294610605, ___ShadowDistance_2)); }
inline int32_t get_ShadowDistance_2() const { return ___ShadowDistance_2; }
inline int32_t* get_address_of_ShadowDistance_2() { return &___ShadowDistance_2; }
inline void set_ShadowDistance_2(int32_t value)
{
___ShadowDistance_2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CHANGESHADOWDISTANCE_T4294610605_H
#ifndef FEATURESELECTIONDETECTOR_T508482069_H
#define FEATURESELECTIONDETECTOR_T508482069_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.FeatureSelectionDetector
struct FeatureSelectionDetector_t508482069 : public MonoBehaviour_t3962482529
{
public:
// Mapbox.Examples.FeatureUiMarker Mapbox.Examples.FeatureSelectionDetector::_marker
FeatureUiMarker_t3847499068 * ____marker_2;
// VectorEntity Mapbox.Examples.FeatureSelectionDetector::_feature
VectorEntity_t1410759464 * ____feature_3;
public:
inline static int32_t get_offset_of__marker_2() { return static_cast<int32_t>(offsetof(FeatureSelectionDetector_t508482069, ____marker_2)); }
inline FeatureUiMarker_t3847499068 * get__marker_2() const { return ____marker_2; }
inline FeatureUiMarker_t3847499068 ** get_address_of__marker_2() { return &____marker_2; }
inline void set__marker_2(FeatureUiMarker_t3847499068 * value)
{
____marker_2 = value;
Il2CppCodeGenWriteBarrier((&____marker_2), value);
}
inline static int32_t get_offset_of__feature_3() { return static_cast<int32_t>(offsetof(FeatureSelectionDetector_t508482069, ____feature_3)); }
inline VectorEntity_t1410759464 * get__feature_3() const { return ____feature_3; }
inline VectorEntity_t1410759464 ** get_address_of__feature_3() { return &____feature_3; }
inline void set__feature_3(VectorEntity_t1410759464 * value)
{
____feature_3 = value;
Il2CppCodeGenWriteBarrier((&____feature_3), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // FEATURESELECTIONDETECTOR_T508482069_H
#ifndef FEATUREUIMARKER_T3847499068_H
#define FEATUREUIMARKER_T3847499068_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.FeatureUiMarker
struct FeatureUiMarker_t3847499068 : public MonoBehaviour_t3962482529
{
public:
// UnityEngine.Transform Mapbox.Examples.FeatureUiMarker::_wrapperMarker
Transform_t3600365921 * ____wrapperMarker_2;
// UnityEngine.Transform Mapbox.Examples.FeatureUiMarker::_infoPanel
Transform_t3600365921 * ____infoPanel_3;
// UnityEngine.UI.Text Mapbox.Examples.FeatureUiMarker::_info
Text_t1901882714 * ____info_4;
// UnityEngine.Vector3[] Mapbox.Examples.FeatureUiMarker::_targetVerts
Vector3U5BU5D_t1718750761* ____targetVerts_5;
// VectorEntity Mapbox.Examples.FeatureUiMarker::_selectedFeature
VectorEntity_t1410759464 * ____selectedFeature_6;
public:
inline static int32_t get_offset_of__wrapperMarker_2() { return static_cast<int32_t>(offsetof(FeatureUiMarker_t3847499068, ____wrapperMarker_2)); }
inline Transform_t3600365921 * get__wrapperMarker_2() const { return ____wrapperMarker_2; }
inline Transform_t3600365921 ** get_address_of__wrapperMarker_2() { return &____wrapperMarker_2; }
inline void set__wrapperMarker_2(Transform_t3600365921 * value)
{
____wrapperMarker_2 = value;
Il2CppCodeGenWriteBarrier((&____wrapperMarker_2), value);
}
inline static int32_t get_offset_of__infoPanel_3() { return static_cast<int32_t>(offsetof(FeatureUiMarker_t3847499068, ____infoPanel_3)); }
inline Transform_t3600365921 * get__infoPanel_3() const { return ____infoPanel_3; }
inline Transform_t3600365921 ** get_address_of__infoPanel_3() { return &____infoPanel_3; }
inline void set__infoPanel_3(Transform_t3600365921 * value)
{
____infoPanel_3 = value;
Il2CppCodeGenWriteBarrier((&____infoPanel_3), value);
}
inline static int32_t get_offset_of__info_4() { return static_cast<int32_t>(offsetof(FeatureUiMarker_t3847499068, ____info_4)); }
inline Text_t1901882714 * get__info_4() const { return ____info_4; }
inline Text_t1901882714 ** get_address_of__info_4() { return &____info_4; }
inline void set__info_4(Text_t1901882714 * value)
{
____info_4 = value;
Il2CppCodeGenWriteBarrier((&____info_4), value);
}
inline static int32_t get_offset_of__targetVerts_5() { return static_cast<int32_t>(offsetof(FeatureUiMarker_t3847499068, ____targetVerts_5)); }
inline Vector3U5BU5D_t1718750761* get__targetVerts_5() const { return ____targetVerts_5; }
inline Vector3U5BU5D_t1718750761** get_address_of__targetVerts_5() { return &____targetVerts_5; }
inline void set__targetVerts_5(Vector3U5BU5D_t1718750761* value)
{
____targetVerts_5 = value;
Il2CppCodeGenWriteBarrier((&____targetVerts_5), value);
}
inline static int32_t get_offset_of__selectedFeature_6() { return static_cast<int32_t>(offsetof(FeatureUiMarker_t3847499068, ____selectedFeature_6)); }
inline VectorEntity_t1410759464 * get__selectedFeature_6() const { return ____selectedFeature_6; }
inline VectorEntity_t1410759464 ** get_address_of__selectedFeature_6() { return &____selectedFeature_6; }
inline void set__selectedFeature_6(VectorEntity_t1410759464 * value)
{
____selectedFeature_6 = value;
Il2CppCodeGenWriteBarrier((&____selectedFeature_6), value);
}
};
struct FeatureUiMarker_t3847499068_StaticFields
{
public:
// System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Object>,System.String> Mapbox.Examples.FeatureUiMarker::<>f__am$cache0
Func_2_t268983481 * ___U3CU3Ef__amU24cache0_7;
public:
inline static int32_t get_offset_of_U3CU3Ef__amU24cache0_7() { return static_cast<int32_t>(offsetof(FeatureUiMarker_t3847499068_StaticFields, ___U3CU3Ef__amU24cache0_7)); }
inline Func_2_t268983481 * get_U3CU3Ef__amU24cache0_7() const { return ___U3CU3Ef__amU24cache0_7; }
inline Func_2_t268983481 ** get_address_of_U3CU3Ef__amU24cache0_7() { return &___U3CU3Ef__amU24cache0_7; }
inline void set_U3CU3Ef__amU24cache0_7(Func_2_t268983481 * value)
{
___U3CU3Ef__amU24cache0_7 = value;
Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache0_7), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // FEATUREUIMARKER_T3847499068_H
#ifndef FORWARDGEOCODEUSERINPUT_T2575136032_H
#define FORWARDGEOCODEUSERINPUT_T2575136032_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.ForwardGeocodeUserInput
struct ForwardGeocodeUserInput_t2575136032 : public MonoBehaviour_t3962482529
{
public:
// UnityEngine.UI.InputField Mapbox.Examples.ForwardGeocodeUserInput::_inputField
InputField_t3762917431 * ____inputField_2;
// Mapbox.Geocoding.ForwardGeocodeResource Mapbox.Examples.ForwardGeocodeUserInput::_resource
ForwardGeocodeResource_t367023433 * ____resource_3;
// Mapbox.Utils.Vector2d Mapbox.Examples.ForwardGeocodeUserInput::_coordinate
Vector2d_t1865246568 ____coordinate_4;
// System.Boolean Mapbox.Examples.ForwardGeocodeUserInput::_hasResponse
bool ____hasResponse_5;
// Mapbox.Geocoding.ForwardGeocodeResponse Mapbox.Examples.ForwardGeocodeUserInput::<Response>k__BackingField
ForwardGeocodeResponse_t2959476828 * ___U3CResponseU3Ek__BackingField_6;
// System.Action`1<Mapbox.Geocoding.ForwardGeocodeResponse> Mapbox.Examples.ForwardGeocodeUserInput::OnGeocoderResponse
Action_1_t3131944423 * ___OnGeocoderResponse_7;
public:
inline static int32_t get_offset_of__inputField_2() { return static_cast<int32_t>(offsetof(ForwardGeocodeUserInput_t2575136032, ____inputField_2)); }
inline InputField_t3762917431 * get__inputField_2() const { return ____inputField_2; }
inline InputField_t3762917431 ** get_address_of__inputField_2() { return &____inputField_2; }
inline void set__inputField_2(InputField_t3762917431 * value)
{
____inputField_2 = value;
Il2CppCodeGenWriteBarrier((&____inputField_2), value);
}
inline static int32_t get_offset_of__resource_3() { return static_cast<int32_t>(offsetof(ForwardGeocodeUserInput_t2575136032, ____resource_3)); }
inline ForwardGeocodeResource_t367023433 * get__resource_3() const { return ____resource_3; }
inline ForwardGeocodeResource_t367023433 ** get_address_of__resource_3() { return &____resource_3; }
inline void set__resource_3(ForwardGeocodeResource_t367023433 * value)
{
____resource_3 = value;
Il2CppCodeGenWriteBarrier((&____resource_3), value);
}
inline static int32_t get_offset_of__coordinate_4() { return static_cast<int32_t>(offsetof(ForwardGeocodeUserInput_t2575136032, ____coordinate_4)); }
inline Vector2d_t1865246568 get__coordinate_4() const { return ____coordinate_4; }
inline Vector2d_t1865246568 * get_address_of__coordinate_4() { return &____coordinate_4; }
inline void set__coordinate_4(Vector2d_t1865246568 value)
{
____coordinate_4 = value;
}
inline static int32_t get_offset_of__hasResponse_5() { return static_cast<int32_t>(offsetof(ForwardGeocodeUserInput_t2575136032, ____hasResponse_5)); }
inline bool get__hasResponse_5() const { return ____hasResponse_5; }
inline bool* get_address_of__hasResponse_5() { return &____hasResponse_5; }
inline void set__hasResponse_5(bool value)
{
____hasResponse_5 = value;
}
inline static int32_t get_offset_of_U3CResponseU3Ek__BackingField_6() { return static_cast<int32_t>(offsetof(ForwardGeocodeUserInput_t2575136032, ___U3CResponseU3Ek__BackingField_6)); }
inline ForwardGeocodeResponse_t2959476828 * get_U3CResponseU3Ek__BackingField_6() const { return ___U3CResponseU3Ek__BackingField_6; }
inline ForwardGeocodeResponse_t2959476828 ** get_address_of_U3CResponseU3Ek__BackingField_6() { return &___U3CResponseU3Ek__BackingField_6; }
inline void set_U3CResponseU3Ek__BackingField_6(ForwardGeocodeResponse_t2959476828 * value)
{
___U3CResponseU3Ek__BackingField_6 = value;
Il2CppCodeGenWriteBarrier((&___U3CResponseU3Ek__BackingField_6), value);
}
inline static int32_t get_offset_of_OnGeocoderResponse_7() { return static_cast<int32_t>(offsetof(ForwardGeocodeUserInput_t2575136032, ___OnGeocoderResponse_7)); }
inline Action_1_t3131944423 * get_OnGeocoderResponse_7() const { return ___OnGeocoderResponse_7; }
inline Action_1_t3131944423 ** get_address_of_OnGeocoderResponse_7() { return &___OnGeocoderResponse_7; }
inline void set_OnGeocoderResponse_7(Action_1_t3131944423 * value)
{
___OnGeocoderResponse_7 = value;
Il2CppCodeGenWriteBarrier((&___OnGeocoderResponse_7), value);
}
};
struct ForwardGeocodeUserInput_t2575136032_StaticFields
{
public:
// System.Action`1<Mapbox.Geocoding.ForwardGeocodeResponse> Mapbox.Examples.ForwardGeocodeUserInput::<>f__am$cache0
Action_1_t3131944423 * ___U3CU3Ef__amU24cache0_8;
public:
inline static int32_t get_offset_of_U3CU3Ef__amU24cache0_8() { return static_cast<int32_t>(offsetof(ForwardGeocodeUserInput_t2575136032_StaticFields, ___U3CU3Ef__amU24cache0_8)); }
inline Action_1_t3131944423 * get_U3CU3Ef__amU24cache0_8() const { return ___U3CU3Ef__amU24cache0_8; }
inline Action_1_t3131944423 ** get_address_of_U3CU3Ef__amU24cache0_8() { return &___U3CU3Ef__amU24cache0_8; }
inline void set_U3CU3Ef__amU24cache0_8(Action_1_t3131944423 * value)
{
___U3CU3Ef__amU24cache0_8 = value;
Il2CppCodeGenWriteBarrier((&___U3CU3Ef__amU24cache0_8), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // FORWARDGEOCODEUSERINPUT_T2575136032_H
#ifndef HIGHLIGHTFEATURE_T1851209614_H
#define HIGHLIGHTFEATURE_T1851209614_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.HighlightFeature
struct HighlightFeature_t1851209614 : public MonoBehaviour_t3962482529
{
public:
// System.Collections.Generic.List`1<UnityEngine.Material> Mapbox.Examples.HighlightFeature::_materials
List_1_t1812449865 * ____materials_3;
// UnityEngine.MeshRenderer Mapbox.Examples.HighlightFeature::_meshRenderer
MeshRenderer_t587009260 * ____meshRenderer_4;
public:
inline static int32_t get_offset_of__materials_3() { return static_cast<int32_t>(offsetof(HighlightFeature_t1851209614, ____materials_3)); }
inline List_1_t1812449865 * get__materials_3() const { return ____materials_3; }
inline List_1_t1812449865 ** get_address_of__materials_3() { return &____materials_3; }
inline void set__materials_3(List_1_t1812449865 * value)
{
____materials_3 = value;
Il2CppCodeGenWriteBarrier((&____materials_3), value);
}
inline static int32_t get_offset_of__meshRenderer_4() { return static_cast<int32_t>(offsetof(HighlightFeature_t1851209614, ____meshRenderer_4)); }
inline MeshRenderer_t587009260 * get__meshRenderer_4() const { return ____meshRenderer_4; }
inline MeshRenderer_t587009260 ** get_address_of__meshRenderer_4() { return &____meshRenderer_4; }
inline void set__meshRenderer_4(MeshRenderer_t587009260 * value)
{
____meshRenderer_4 = value;
Il2CppCodeGenWriteBarrier((&____meshRenderer_4), value);
}
};
struct HighlightFeature_t1851209614_StaticFields
{
public:
// UnityEngine.Material Mapbox.Examples.HighlightFeature::_highlightMaterial
Material_t340375123 * ____highlightMaterial_2;
public:
inline static int32_t get_offset_of__highlightMaterial_2() { return static_cast<int32_t>(offsetof(HighlightFeature_t1851209614_StaticFields, ____highlightMaterial_2)); }
inline Material_t340375123 * get__highlightMaterial_2() const { return ____highlightMaterial_2; }
inline Material_t340375123 ** get_address_of__highlightMaterial_2() { return &____highlightMaterial_2; }
inline void set__highlightMaterial_2(Material_t340375123 * value)
{
____highlightMaterial_2 = value;
Il2CppCodeGenWriteBarrier((&____highlightMaterial_2), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // HIGHLIGHTFEATURE_T1851209614_H
#ifndef IMMEDIATEPOSITIONWITHLOCATIONPROVIDER_T789589409_H
#define IMMEDIATEPOSITIONWITHLOCATIONPROVIDER_T789589409_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.ImmediatePositionWithLocationProvider
struct ImmediatePositionWithLocationProvider_t789589409 : public MonoBehaviour_t3962482529
{
public:
// Mapbox.Unity.Map.AbstractMap Mapbox.Examples.ImmediatePositionWithLocationProvider::_map
AbstractMap_t3082917158 * ____map_2;
// System.Boolean Mapbox.Examples.ImmediatePositionWithLocationProvider::_isInitialized
bool ____isInitialized_3;
// Mapbox.Unity.Location.ILocationProvider Mapbox.Examples.ImmediatePositionWithLocationProvider::_locationProvider
RuntimeObject* ____locationProvider_4;
// UnityEngine.Vector3 Mapbox.Examples.ImmediatePositionWithLocationProvider::_targetPosition
Vector3_t3722313464 ____targetPosition_5;
public:
inline static int32_t get_offset_of__map_2() { return static_cast<int32_t>(offsetof(ImmediatePositionWithLocationProvider_t789589409, ____map_2)); }
inline AbstractMap_t3082917158 * get__map_2() const { return ____map_2; }
inline AbstractMap_t3082917158 ** get_address_of__map_2() { return &____map_2; }
inline void set__map_2(AbstractMap_t3082917158 * value)
{
____map_2 = value;
Il2CppCodeGenWriteBarrier((&____map_2), value);
}
inline static int32_t get_offset_of__isInitialized_3() { return static_cast<int32_t>(offsetof(ImmediatePositionWithLocationProvider_t789589409, ____isInitialized_3)); }
inline bool get__isInitialized_3() const { return ____isInitialized_3; }
inline bool* get_address_of__isInitialized_3() { return &____isInitialized_3; }
inline void set__isInitialized_3(bool value)
{
____isInitialized_3 = value;
}
inline static int32_t get_offset_of__locationProvider_4() { return static_cast<int32_t>(offsetof(ImmediatePositionWithLocationProvider_t789589409, ____locationProvider_4)); }
inline RuntimeObject* get__locationProvider_4() const { return ____locationProvider_4; }
inline RuntimeObject** get_address_of__locationProvider_4() { return &____locationProvider_4; }
inline void set__locationProvider_4(RuntimeObject* value)
{
____locationProvider_4 = value;
Il2CppCodeGenWriteBarrier((&____locationProvider_4), value);
}
inline static int32_t get_offset_of__targetPosition_5() { return static_cast<int32_t>(offsetof(ImmediatePositionWithLocationProvider_t789589409, ____targetPosition_5)); }
inline Vector3_t3722313464 get__targetPosition_5() const { return ____targetPosition_5; }
inline Vector3_t3722313464 * get_address_of__targetPosition_5() { return &____targetPosition_5; }
inline void set__targetPosition_5(Vector3_t3722313464 value)
{
____targetPosition_5 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // IMMEDIATEPOSITIONWITHLOCATIONPROVIDER_T789589409_H
#ifndef SPAWNONMAP_T234351174_H
#define SPAWNONMAP_T234351174_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mapbox.Examples.SpawnOnMap
struct SpawnOnMap_t234351174 : public MonoBehaviour_t3962482529
{
public:
// Mapbox.Unity.Map.AbstractMap Mapbox.Examples.SpawnOnMap::_map
AbstractMap_t3082917158 * ____map_2;
// System.String[] Mapbox.Examples.SpawnOnMap::_locationStrings
StringU5BU5D_t1281789340* ____locationStrings_3;
// Mapbox.Utils.Vector2d[] Mapbox.Examples.SpawnOnMap::_locations
Vector2dU5BU5D_t852968953* ____locations_4;
// System.Single Mapbox.Examples.SpawnOnMap::_spawnScale
float ____spawnScale_5;
// UnityEngine.GameObject Mapbox.Examples.SpawnOnMap::_markerPrefab
GameObject_t1113636619 * ____markerPrefab_6;
// System.Collections.Generic.List`1<UnityEngine.GameObject> Mapbox.Examples.SpawnOnMap::_spawnedObjects
List_1_t2585711361 * ____spawnedObjects_7;
public:
inline static int32_t get_offset_of__map_2() { return static_cast<int32_t>(offsetof(SpawnOnMap_t234351174, ____map_2)); }
inline AbstractMap_t3082917158 * get__map_2() const { return ____map_2; }
inline AbstractMap_t3082917158 ** get_address_of__map_2() { return &____map_2; }
inline void set__map_2(AbstractMap_t3082917158 * value)
{
____map_2 = value;
Il2CppCodeGenWriteBarrier((&____map_2), value);
}
inline static int32_t get_offset_of__locationStrings_3() { return static_cast<int32_t>(offsetof(SpawnOnMap_t234351174, ____locationStrings_3)); }
inline StringU5BU5D_t1281789340* get__locationStrings_3() const { return ____locationStrings_3; }
inline StringU5BU5D_t1281789340** get_address_of__locationStrings_3() { return &____locationStrings_3; }
inline void set__locationStrings_3(StringU5BU5D_t1281789340* value)
{
____locationStrings_3 = value;
Il2CppCodeGenWriteBarrier((&____locationStrings_3), value);
}
inline static int32_t get_offset_of__locations_4() { return static_cast<int32_t>(offsetof(SpawnOnMap_t234351174, ____locations_4)); }
inline Vector2dU5BU5D_t852968953* get__locations_4() const { return ____locations_4; }
inline Vector2dU5BU5D_t852968953** get_address_of__locations_4() { return &____locations_4; }
inline void set__locations_4(Vector2dU5BU5D_t852968953* value)
{
____locations_4 = value;
Il2CppCodeGenWriteBarrier((&____locations_4), value);
}
inline static int32_t get_offset_of__spawnScale_5() { return static_cast<int32_t>(offsetof(SpawnOnMap_t234351174, ____spawnScale_5)); }
inline float get__spawnScale_5() const { return ____spawnScale_5; }
inline float* get_address_of__spawnScale_5() { return &____spawnScale_5; }
inline void set__spawnScale_5(float value)
{
____spawnScale_5 = value;
}
inline static int32_t get_offset_of__markerPrefab_6() { return static_cast<int32_t>(offsetof(SpawnOnMap_t234351174, ____markerPrefab_6)); }
inline GameObject_t1113636619 * get__markerPrefab_6() const { return ____markerPrefab_6; }
inline GameObject_t1113636619 ** get_address_of__markerPrefab_6() { return &____markerPrefab_6; }
inline void set__markerPrefab_6(GameObject_t1113636619 * value)
{
____markerPrefab_6 = value;
Il2CppCodeGenWriteBarrier((&____markerPrefab_6), value);
}
inline static int32_t get_offset_of__spawnedObjects_7() { return static_cast<int32_t>(offsetof(SpawnOnMap_t234351174, ____spawnedObjects_7)); }
inline List_1_t2585711361 * get__spawnedObjects_7() const { return ____spawnedObjects_7; }
inline List_1_t2585711361 ** get_address_of__spawnedObjects_7() { return &____spawnedObjects_7; }
inline void set__spawnedObjects_7(List_1_t2585711361 * value)
{
____spawnedObjects_7 = value;
Il2CppCodeGenWriteBarrier((&____spawnedObjects_7), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SPAWNONMAP_T234351174_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3200 = { sizeof (Compression_t3624971113), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3201 = { sizeof (Constants_t3518929206), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3201[6] =
{
0,
0,
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3202 = { sizeof (Vector2dBounds_t1974840945)+ sizeof (RuntimeObject), sizeof(Vector2dBounds_t1974840945 ), 0, 0 };
extern const int32_t g_FieldOffsetTable3202[2] =
{
Vector2dBounds_t1974840945::get_offset_of_SouthWest_0() + static_cast<int32_t>(sizeof(RuntimeObject)),
Vector2dBounds_t1974840945::get_offset_of_NorthEast_1() + static_cast<int32_t>(sizeof(RuntimeObject)),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3203 = { 0, 0, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3204 = { 0, 0, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3205 = { sizeof (BboxToVector2dBoundsConverter_t1118841236), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3206 = { sizeof (JsonConverters_t1015645604), -1, sizeof(JsonConverters_t1015645604_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable3206[1] =
{
JsonConverters_t1015645604_StaticFields::get_offset_of_converters_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3207 = { sizeof (LonLatToVector2dConverter_t2933574141), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3208 = { sizeof (PolylineToVector2dListConverter_t1416161534), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3209 = { sizeof (PolylineUtils_t2997409923), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3210 = { sizeof (UnixTimestampUtils_t2933311910), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3211 = { sizeof (Mathd_t279629051)+ sizeof (RuntimeObject), sizeof(Mathd_t279629051 ), 0, 0 };
extern const int32_t g_FieldOffsetTable3211[6] =
{
0,
0,
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3212 = { sizeof (RectD_t151583371)+ sizeof (RuntimeObject), sizeof(RectD_t151583371 ), 0, 0 };
extern const int32_t g_FieldOffsetTable3212[4] =
{
RectD_t151583371::get_offset_of_U3CMinU3Ek__BackingField_0() + static_cast<int32_t>(sizeof(RuntimeObject)),
RectD_t151583371::get_offset_of_U3CMaxU3Ek__BackingField_1() + static_cast<int32_t>(sizeof(RuntimeObject)),
RectD_t151583371::get_offset_of_U3CSizeU3Ek__BackingField_2() + static_cast<int32_t>(sizeof(RuntimeObject)),
RectD_t151583371::get_offset_of_U3CCenterU3Ek__BackingField_3() + static_cast<int32_t>(sizeof(RuntimeObject)),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3213 = { sizeof (Vector2d_t1865246568)+ sizeof (RuntimeObject), sizeof(Vector2d_t1865246568 ), 0, 0 };
extern const int32_t g_FieldOffsetTable3213[3] =
{
0,
Vector2d_t1865246568::get_offset_of_x_1() + static_cast<int32_t>(sizeof(RuntimeObject)),
Vector2d_t1865246568::get_offset_of_y_2() + static_cast<int32_t>(sizeof(RuntimeObject)),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3214 = { sizeof (EnumExtensions_t2644584491), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3215 = { sizeof (VectorTileExtensions_t4243590528), -1, sizeof(VectorTileExtensions_t4243590528_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable3215[6] =
{
VectorTileExtensions_t4243590528_StaticFields::get_offset_of_U3CU3Ef__amU24cache0_0(),
VectorTileExtensions_t4243590528_StaticFields::get_offset_of_U3CU3Ef__amU24cache1_1(),
VectorTileExtensions_t4243590528_StaticFields::get_offset_of_U3CU3Ef__amU24cache2_2(),
VectorTileExtensions_t4243590528_StaticFields::get_offset_of_U3CU3Ef__amU24cache3_3(),
VectorTileExtensions_t4243590528_StaticFields::get_offset_of_U3CU3Ef__amU24cache4_4(),
VectorTileExtensions_t4243590528_StaticFields::get_offset_of_U3CU3Ef__amU24cache5_5(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3216 = { sizeof (VectorTileFeatureExtensions_t4023769631), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3217 = { sizeof (U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3217[4] =
{
U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684::get_offset_of_zoom_0(),
U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684::get_offset_of_tileColumn_1(),
U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684::get_offset_of_tileRow_2(),
U3CGeometryAsWgs84U3Ec__AnonStorey0_t3901700684::get_offset_of_feature_3(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3218 = { sizeof (InternalClipper_t4127247543), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3219 = { sizeof (DoublePoint_t1607927371)+ sizeof (RuntimeObject), sizeof(DoublePoint_t1607927371 ), 0, 0 };
extern const int32_t g_FieldOffsetTable3219[2] =
{
DoublePoint_t1607927371::get_offset_of_X_0() + static_cast<int32_t>(sizeof(RuntimeObject)),
DoublePoint_t1607927371::get_offset_of_Y_1() + static_cast<int32_t>(sizeof(RuntimeObject)),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3220 = { sizeof (PolyTree_t3708317675), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3220[1] =
{
PolyTree_t3708317675::get_offset_of_m_AllPolys_7(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3221 = { sizeof (PolyNode_t1300984468), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3221[7] =
{
PolyNode_t1300984468::get_offset_of_m_Parent_0(),
PolyNode_t1300984468::get_offset_of_m_polygon_1(),
PolyNode_t1300984468::get_offset_of_m_Index_2(),
PolyNode_t1300984468::get_offset_of_m_jointype_3(),
PolyNode_t1300984468::get_offset_of_m_endtype_4(),
PolyNode_t1300984468::get_offset_of_m_Childs_5(),
PolyNode_t1300984468::get_offset_of_U3CIsOpenU3Ek__BackingField_6(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3222 = { sizeof (Int128_t2615162842)+ sizeof (RuntimeObject), sizeof(Int128_t2615162842 ), 0, 0 };
extern const int32_t g_FieldOffsetTable3222[2] =
{
Int128_t2615162842::get_offset_of_hi_0() + static_cast<int32_t>(sizeof(RuntimeObject)),
Int128_t2615162842::get_offset_of_lo_1() + static_cast<int32_t>(sizeof(RuntimeObject)),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3223 = { sizeof (IntPoint_t2327573135)+ sizeof (RuntimeObject), sizeof(IntPoint_t2327573135 ), 0, 0 };
extern const int32_t g_FieldOffsetTable3223[2] =
{
IntPoint_t2327573135::get_offset_of_X_0() + static_cast<int32_t>(sizeof(RuntimeObject)),
IntPoint_t2327573135::get_offset_of_Y_1() + static_cast<int32_t>(sizeof(RuntimeObject)),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3224 = { sizeof (IntRect_t752847524)+ sizeof (RuntimeObject), sizeof(IntRect_t752847524 ), 0, 0 };
extern const int32_t g_FieldOffsetTable3224[4] =
{
IntRect_t752847524::get_offset_of_left_0() + static_cast<int32_t>(sizeof(RuntimeObject)),
IntRect_t752847524::get_offset_of_top_1() + static_cast<int32_t>(sizeof(RuntimeObject)),
IntRect_t752847524::get_offset_of_right_2() + static_cast<int32_t>(sizeof(RuntimeObject)),
IntRect_t752847524::get_offset_of_bottom_3() + static_cast<int32_t>(sizeof(RuntimeObject)),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3225 = { sizeof (ClipType_t1616702040)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable3225[5] =
{
ClipType_t1616702040::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3226 = { sizeof (PolyType_t1741373358)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable3226[3] =
{
PolyType_t1741373358::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3227 = { sizeof (PolyFillType_t2091732334)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable3227[5] =
{
PolyFillType_t2091732334::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3228 = { sizeof (JoinType_t3449044149)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable3228[4] =
{
JoinType_t3449044149::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3229 = { sizeof (EndType_t3515135373)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable3229[6] =
{
EndType_t3515135373::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3230 = { sizeof (EdgeSide_t2739901735)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable3230[3] =
{
EdgeSide_t2739901735::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3231 = { sizeof (Direction_t4237952965)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable3231[3] =
{
Direction_t4237952965::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3232 = { sizeof (TEdge_t1694054893), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3232[18] =
{
TEdge_t1694054893::get_offset_of_Bot_0(),
TEdge_t1694054893::get_offset_of_Curr_1(),
TEdge_t1694054893::get_offset_of_Top_2(),
TEdge_t1694054893::get_offset_of_Delta_3(),
TEdge_t1694054893::get_offset_of_Dx_4(),
TEdge_t1694054893::get_offset_of_PolyTyp_5(),
TEdge_t1694054893::get_offset_of_Side_6(),
TEdge_t1694054893::get_offset_of_WindDelta_7(),
TEdge_t1694054893::get_offset_of_WindCnt_8(),
TEdge_t1694054893::get_offset_of_WindCnt2_9(),
TEdge_t1694054893::get_offset_of_OutIdx_10(),
TEdge_t1694054893::get_offset_of_Next_11(),
TEdge_t1694054893::get_offset_of_Prev_12(),
TEdge_t1694054893::get_offset_of_NextInLML_13(),
TEdge_t1694054893::get_offset_of_NextInAEL_14(),
TEdge_t1694054893::get_offset_of_PrevInAEL_15(),
TEdge_t1694054893::get_offset_of_NextInSEL_16(),
TEdge_t1694054893::get_offset_of_PrevInSEL_17(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3233 = { sizeof (IntersectNode_t3379514219), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3233[3] =
{
IntersectNode_t3379514219::get_offset_of_Edge1_0(),
IntersectNode_t3379514219::get_offset_of_Edge2_1(),
IntersectNode_t3379514219::get_offset_of_Pt_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3234 = { sizeof (MyIntersectNodeSort_t682547759), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3235 = { sizeof (LocalMinima_t86068969), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3235[4] =
{
LocalMinima_t86068969::get_offset_of_Y_0(),
LocalMinima_t86068969::get_offset_of_LeftBound_1(),
LocalMinima_t86068969::get_offset_of_RightBound_2(),
LocalMinima_t86068969::get_offset_of_Next_3(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3236 = { sizeof (Scanbeam_t3952834741), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3236[2] =
{
Scanbeam_t3952834741::get_offset_of_Y_0(),
Scanbeam_t3952834741::get_offset_of_Next_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3237 = { sizeof (Maxima_t4278896992), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3237[3] =
{
Maxima_t4278896992::get_offset_of_X_0(),
Maxima_t4278896992::get_offset_of_Next_1(),
Maxima_t4278896992::get_offset_of_Prev_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3238 = { sizeof (OutRec_t316877671), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3238[7] =
{
OutRec_t316877671::get_offset_of_Idx_0(),
OutRec_t316877671::get_offset_of_IsHole_1(),
OutRec_t316877671::get_offset_of_IsOpen_2(),
OutRec_t316877671::get_offset_of_FirstLeft_3(),
OutRec_t316877671::get_offset_of_Pts_4(),
OutRec_t316877671::get_offset_of_BottomPt_5(),
OutRec_t316877671::get_offset_of_PolyNode_6(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3239 = { sizeof (OutPt_t2591102706), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3239[4] =
{
OutPt_t2591102706::get_offset_of_Idx_0(),
OutPt_t2591102706::get_offset_of_Pt_1(),
OutPt_t2591102706::get_offset_of_Next_2(),
OutPt_t2591102706::get_offset_of_Prev_3(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3240 = { sizeof (Join_t2349011362), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3240[3] =
{
Join_t2349011362::get_offset_of_OutPt1_0(),
Join_t2349011362::get_offset_of_OutPt2_1(),
Join_t2349011362::get_offset_of_OffPt_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3241 = { sizeof (ClipperBase_t2411222589), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3241[15] =
{
0,
0,
0,
0,
0,
0,
ClipperBase_t2411222589::get_offset_of_m_MinimaList_6(),
ClipperBase_t2411222589::get_offset_of_m_CurrentLM_7(),
ClipperBase_t2411222589::get_offset_of_m_edges_8(),
ClipperBase_t2411222589::get_offset_of_m_Scanbeam_9(),
ClipperBase_t2411222589::get_offset_of_m_PolyOuts_10(),
ClipperBase_t2411222589::get_offset_of_m_ActiveEdges_11(),
ClipperBase_t2411222589::get_offset_of_m_UseFullRange_12(),
ClipperBase_t2411222589::get_offset_of_m_HasOpenPaths_13(),
ClipperBase_t2411222589::get_offset_of_U3CPreserveCollinearU3Ek__BackingField_14(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3242 = { sizeof (Clipper_t4158555122), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3242[16] =
{
0,
0,
0,
Clipper_t4158555122::get_offset_of_m_ClipType_18(),
Clipper_t4158555122::get_offset_of_m_Maxima_19(),
Clipper_t4158555122::get_offset_of_m_SortedEdges_20(),
Clipper_t4158555122::get_offset_of_m_IntersectList_21(),
Clipper_t4158555122::get_offset_of_m_IntersectNodeComparer_22(),
Clipper_t4158555122::get_offset_of_m_ExecuteLocked_23(),
Clipper_t4158555122::get_offset_of_m_ClipFillType_24(),
Clipper_t4158555122::get_offset_of_m_SubjFillType_25(),
Clipper_t4158555122::get_offset_of_m_Joins_26(),
Clipper_t4158555122::get_offset_of_m_GhostJoins_27(),
Clipper_t4158555122::get_offset_of_m_UsingPolyTree_28(),
Clipper_t4158555122::get_offset_of_U3CReverseSolutionU3Ek__BackingField_29(),
Clipper_t4158555122::get_offset_of_U3CStrictlySimpleU3Ek__BackingField_30(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3243 = { sizeof (NodeType_t363087472)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable3243[4] =
{
NodeType_t363087472::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3244 = { sizeof (ClipperOffset_t3668738110), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3244[16] =
{
ClipperOffset_t3668738110::get_offset_of_m_destPolys_0(),
ClipperOffset_t3668738110::get_offset_of_m_srcPoly_1(),
ClipperOffset_t3668738110::get_offset_of_m_destPoly_2(),
ClipperOffset_t3668738110::get_offset_of_m_normals_3(),
ClipperOffset_t3668738110::get_offset_of_m_delta_4(),
ClipperOffset_t3668738110::get_offset_of_m_sinA_5(),
ClipperOffset_t3668738110::get_offset_of_m_sin_6(),
ClipperOffset_t3668738110::get_offset_of_m_cos_7(),
ClipperOffset_t3668738110::get_offset_of_m_miterLim_8(),
ClipperOffset_t3668738110::get_offset_of_m_StepsPerRad_9(),
ClipperOffset_t3668738110::get_offset_of_m_lowest_10(),
ClipperOffset_t3668738110::get_offset_of_m_polyNodes_11(),
ClipperOffset_t3668738110::get_offset_of_U3CArcToleranceU3Ek__BackingField_12(),
ClipperOffset_t3668738110::get_offset_of_U3CMiterLimitU3Ek__BackingField_13(),
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3245 = { sizeof (ClipperException_t3118674656), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3246 = { sizeof (DecodeGeometry_t3735437420), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3247 = { sizeof (GeomType_t3056663235)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable3247[5] =
{
GeomType_t3056663235::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3248 = { sizeof (LatLng_t1304626312)+ sizeof (RuntimeObject), sizeof(LatLng_t1304626312 ), 0, 0 };
extern const int32_t g_FieldOffsetTable3248[2] =
{
LatLng_t1304626312::get_offset_of_U3CLatU3Ek__BackingField_0() + static_cast<int32_t>(sizeof(RuntimeObject)),
LatLng_t1304626312::get_offset_of_U3CLngU3Ek__BackingField_1() + static_cast<int32_t>(sizeof(RuntimeObject)),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3249 = { 0, 0, 0, 0 };
extern const int32_t g_FieldOffsetTable3249[2] =
{
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3250 = { sizeof (UtilGeom_t2066125609), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3251 = { sizeof (WireTypes_t1504741901)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable3251[6] =
{
WireTypes_t1504741901::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3252 = { sizeof (Commands_t1803779524)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable3252[4] =
{
Commands_t1803779524::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3253 = { sizeof (TileType_t3106966029)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable3253[2] =
{
TileType_t3106966029::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3254 = { sizeof (LayerType_t1746409905)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable3254[7] =
{
LayerType_t1746409905::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3255 = { sizeof (FeatureType_t2360609914)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable3255[6] =
{
FeatureType_t2360609914::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3256 = { sizeof (ValueType_t2776630785)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable3256[8] =
{
ValueType_t2776630785::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3257 = { sizeof (ConstantsAsDictionary_t107503724), -1, sizeof(ConstantsAsDictionary_t107503724_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable3257[4] =
{
ConstantsAsDictionary_t107503724_StaticFields::get_offset_of_TileType_0(),
ConstantsAsDictionary_t107503724_StaticFields::get_offset_of_LayerType_1(),
ConstantsAsDictionary_t107503724_StaticFields::get_offset_of_FeatureType_2(),
ConstantsAsDictionary_t107503724_StaticFields::get_offset_of_GeomType_3(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3258 = { sizeof (PbfReader_t1662343237), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3258[6] =
{
PbfReader_t1662343237::get_offset_of_U3CTagU3Ek__BackingField_0(),
PbfReader_t1662343237::get_offset_of_U3CValueU3Ek__BackingField_1(),
PbfReader_t1662343237::get_offset_of_U3CWireTypeU3Ek__BackingField_2(),
PbfReader_t1662343237::get_offset_of__buffer_3(),
PbfReader_t1662343237::get_offset_of__length_4(),
PbfReader_t1662343237::get_offset_of__pos_5(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3259 = { sizeof (VectorTile_t3467883484), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3259[1] =
{
VectorTile_t3467883484::get_offset_of__VTR_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3260 = { sizeof (VectorTileFeature_t4093669591), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3260[9] =
{
VectorTileFeature_t4093669591::get_offset_of__layer_0(),
VectorTileFeature_t4093669591::get_offset_of__cachedGeometry_1(),
VectorTileFeature_t4093669591::get_offset_of__clipBuffer_2(),
VectorTileFeature_t4093669591::get_offset_of__scale_3(),
VectorTileFeature_t4093669591::get_offset_of__previousScale_4(),
VectorTileFeature_t4093669591::get_offset_of_U3CIdU3Ek__BackingField_5(),
VectorTileFeature_t4093669591::get_offset_of_U3CGeometryTypeU3Ek__BackingField_6(),
VectorTileFeature_t4093669591::get_offset_of_U3CGeometryCommandsU3Ek__BackingField_7(),
VectorTileFeature_t4093669591::get_offset_of_U3CTagsU3Ek__BackingField_8(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3261 = { sizeof (VectorTileLayer_t873169949), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3261[7] =
{
VectorTileLayer_t873169949::get_offset_of_U3CDataU3Ek__BackingField_0(),
VectorTileLayer_t873169949::get_offset_of_U3CNameU3Ek__BackingField_1(),
VectorTileLayer_t873169949::get_offset_of_U3CVersionU3Ek__BackingField_2(),
VectorTileLayer_t873169949::get_offset_of_U3CExtentU3Ek__BackingField_3(),
VectorTileLayer_t873169949::get_offset_of_U3C_FeaturesDataU3Ek__BackingField_4(),
VectorTileLayer_t873169949::get_offset_of_U3CValuesU3Ek__BackingField_5(),
VectorTileLayer_t873169949::get_offset_of_U3CKeysU3Ek__BackingField_6(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3262 = { sizeof (VectorTileReader_t1753322980), -1, sizeof(VectorTileReader_t1753322980_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable3262[5] =
{
VectorTileReader_t1753322980::get_offset_of__Layers_0(),
VectorTileReader_t1753322980::get_offset_of__Validate_1(),
VectorTileReader_t1753322980_StaticFields::get_offset_of_U3CU3Ef__amU24cache0_2(),
VectorTileReader_t1753322980_StaticFields::get_offset_of_U3CU3Ef__amU24cache1_3(),
VectorTileReader_t1753322980_StaticFields::get_offset_of_U3CU3Ef__amU24cache2_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3263 = { sizeof (MapMatchingExample_t325328315), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3263[9] =
{
MapMatchingExample_t325328315::get_offset_of__map_2(),
MapMatchingExample_t325328315::get_offset_of__originalRoute_3(),
MapMatchingExample_t325328315::get_offset_of__mapMatchRoute_4(),
MapMatchingExample_t325328315::get_offset_of__useTransformLocationProvider_5(),
MapMatchingExample_t325328315::get_offset_of__profile_6(),
MapMatchingExample_t325328315::get_offset_of__lineHeight_7(),
MapMatchingExample_t325328315::get_offset_of__locations_8(),
MapMatchingExample_t325328315::get_offset_of__mapMatcher_9(),
MapMatchingExample_t325328315::get_offset_of__locationProvider_10(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3264 = { sizeof (PlotRoute_t1165660348), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3264[12] =
{
PlotRoute_t1165660348::get_offset_of__target_2(),
PlotRoute_t1165660348::get_offset_of__color_3(),
PlotRoute_t1165660348::get_offset_of__height_4(),
PlotRoute_t1165660348::get_offset_of__lineWidth_5(),
PlotRoute_t1165660348::get_offset_of__updateInterval_6(),
PlotRoute_t1165660348::get_offset_of__minDistance_7(),
PlotRoute_t1165660348::get_offset_of__lineRenderer_8(),
PlotRoute_t1165660348::get_offset_of__elapsedTime_9(),
PlotRoute_t1165660348::get_offset_of__currentIndex_10(),
PlotRoute_t1165660348::get_offset_of__sqDistance_11(),
PlotRoute_t1165660348::get_offset_of__lastPosition_12(),
PlotRoute_t1165660348::get_offset_of__isStable_13(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3265 = { sizeof (TextureScale_t57896704), -1, sizeof(TextureScale_t57896704_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable3265[8] =
{
TextureScale_t57896704_StaticFields::get_offset_of_texColors_0(),
TextureScale_t57896704_StaticFields::get_offset_of_newColors_1(),
TextureScale_t57896704_StaticFields::get_offset_of_w_2(),
TextureScale_t57896704_StaticFields::get_offset_of_ratioX_3(),
TextureScale_t57896704_StaticFields::get_offset_of_ratioY_4(),
TextureScale_t57896704_StaticFields::get_offset_of_w2_5(),
TextureScale_t57896704_StaticFields::get_offset_of_finishCount_6(),
TextureScale_t57896704_StaticFields::get_offset_of_mutex_7(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3266 = { sizeof (ThreadData_t1095464109), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3266[2] =
{
ThreadData_t1095464109::get_offset_of_start_0(),
ThreadData_t1095464109::get_offset_of_end_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3267 = { sizeof (VoxelData_t2248882184), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3267[2] =
{
VoxelData_t2248882184::get_offset_of_Position_0(),
VoxelData_t2248882184::get_offset_of_Prefab_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3268 = { sizeof (VoxelFetcher_t3713644963), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3268[1] =
{
VoxelFetcher_t3713644963::get_offset_of__voxels_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3269 = { sizeof (VoxelColorMapper_t2180346717), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3269[2] =
{
VoxelColorMapper_t2180346717::get_offset_of_Color_0(),
VoxelColorMapper_t2180346717::get_offset_of_Voxel_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3270 = { sizeof (VoxelTile_t1944340880), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3270[17] =
{
VoxelTile_t1944340880::get_offset_of__geocodeInput_2(),
VoxelTile_t1944340880::get_offset_of__zoom_3(),
VoxelTile_t1944340880::get_offset_of__elevationMultiplier_4(),
VoxelTile_t1944340880::get_offset_of__voxelDepthPadding_5(),
VoxelTile_t1944340880::get_offset_of__tileWidthInVoxels_6(),
VoxelTile_t1944340880::get_offset_of__voxelFetcher_7(),
VoxelTile_t1944340880::get_offset_of__camera_8(),
VoxelTile_t1944340880::get_offset_of__voxelBatchCount_9(),
VoxelTile_t1944340880::get_offset_of__styleUrl_10(),
VoxelTile_t1944340880::get_offset_of__raster_11(),
VoxelTile_t1944340880::get_offset_of__elevation_12(),
VoxelTile_t1944340880::get_offset_of__rasterTexture_13(),
VoxelTile_t1944340880::get_offset_of__elevationTexture_14(),
VoxelTile_t1944340880::get_offset_of__fileSource_15(),
VoxelTile_t1944340880::get_offset_of__voxels_16(),
VoxelTile_t1944340880::get_offset_of__instantiatedVoxels_17(),
VoxelTile_t1944340880::get_offset_of__tileScale_18(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3271 = { sizeof (U3CBuildRoutineU3Ec__Iterator0_t1339467344), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3271[6] =
{
U3CBuildRoutineU3Ec__Iterator0_t1339467344::get_offset_of_U3CdistanceOrderedVoxelsU3E__0_0(),
U3CBuildRoutineU3Ec__Iterator0_t1339467344::get_offset_of_U3CiU3E__1_1(),
U3CBuildRoutineU3Ec__Iterator0_t1339467344::get_offset_of_U24this_2(),
U3CBuildRoutineU3Ec__Iterator0_t1339467344::get_offset_of_U24current_3(),
U3CBuildRoutineU3Ec__Iterator0_t1339467344::get_offset_of_U24disposing_4(),
U3CBuildRoutineU3Ec__Iterator0_t1339467344::get_offset_of_U24PC_5(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3272 = { sizeof (SpawnOnMap_t234351174), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3272[6] =
{
SpawnOnMap_t234351174::get_offset_of__map_2(),
SpawnOnMap_t234351174::get_offset_of__locationStrings_3(),
SpawnOnMap_t234351174::get_offset_of__locations_4(),
SpawnOnMap_t234351174::get_offset_of__spawnScale_5(),
SpawnOnMap_t234351174::get_offset_of__markerPrefab_6(),
SpawnOnMap_t234351174::get_offset_of__spawnedObjects_7(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3273 = { sizeof (DragRotate_t2912444650), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3273[3] =
{
DragRotate_t2912444650::get_offset_of__objectToRotate_2(),
DragRotate_t2912444650::get_offset_of__multiplier_3(),
DragRotate_t2912444650::get_offset_of__startTouchPosition_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3274 = { sizeof (SpawnOnGlobeExample_t1835218885), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3274[4] =
{
SpawnOnGlobeExample_t1835218885::get_offset_of__globeFactory_2(),
SpawnOnGlobeExample_t1835218885::get_offset_of__locations_3(),
SpawnOnGlobeExample_t1835218885::get_offset_of__spawnScale_4(),
SpawnOnGlobeExample_t1835218885::get_offset_of__markerPrefab_5(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3275 = { sizeof (DirectionsExample_t2773998098), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3275[6] =
{
DirectionsExample_t2773998098::get_offset_of__resultsText_2(),
DirectionsExample_t2773998098::get_offset_of__startLocationGeocoder_3(),
DirectionsExample_t2773998098::get_offset_of__endLocationGeocoder_4(),
DirectionsExample_t2773998098::get_offset_of__directions_5(),
DirectionsExample_t2773998098::get_offset_of__coordinates_6(),
DirectionsExample_t2773998098::get_offset_of__directionResource_7(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3276 = { sizeof (ForwardGeocoderExample_t595455162), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3276[2] =
{
ForwardGeocoderExample_t595455162::get_offset_of__searchLocation_2(),
ForwardGeocoderExample_t595455162::get_offset_of__resultsText_3(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3277 = { sizeof (RasterTileExample_t3949613556), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3277[9] =
{
RasterTileExample_t3949613556::get_offset_of__searchLocation_2(),
RasterTileExample_t3949613556::get_offset_of__zoomSlider_3(),
RasterTileExample_t3949613556::get_offset_of__stylesDropdown_4(),
RasterTileExample_t3949613556::get_offset_of__imageContainer_5(),
RasterTileExample_t3949613556::get_offset_of__map_6(),
RasterTileExample_t3949613556::get_offset_of__latLon_7(),
RasterTileExample_t3949613556::get_offset_of__mapboxStyles_8(),
RasterTileExample_t3949613556::get_offset_of__startLoc_9(),
RasterTileExample_t3949613556::get_offset_of__mapstyle_10(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3278 = { sizeof (ReverseGeocoderExample_t1816435679), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3278[2] =
{
ReverseGeocoderExample_t1816435679::get_offset_of__searchLocation_2(),
ReverseGeocoderExample_t1816435679::get_offset_of__resultsText_3(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3279 = { sizeof (VectorTileExample_t4002429299), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3279[3] =
{
VectorTileExample_t4002429299::get_offset_of__searchLocation_2(),
VectorTileExample_t4002429299::get_offset_of__resultsText_3(),
VectorTileExample_t4002429299::get_offset_of__map_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3280 = { sizeof (CameraBillboard_t2325764960), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3280[1] =
{
CameraBillboard_t2325764960::get_offset_of__camera_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3281 = { sizeof (CameraMovement_t3562026478), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3281[7] =
{
CameraMovement_t3562026478::get_offset_of__panSpeed_2(),
CameraMovement_t3562026478::get_offset_of__zoomSpeed_3(),
CameraMovement_t3562026478::get_offset_of__referenceCamera_4(),
CameraMovement_t3562026478::get_offset_of__originalRotation_5(),
CameraMovement_t3562026478::get_offset_of__origin_6(),
CameraMovement_t3562026478::get_offset_of__delta_7(),
CameraMovement_t3562026478::get_offset_of__shouldDrag_8(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3282 = { sizeof (ChangeShadowDistance_t4294610605), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3282[1] =
{
ChangeShadowDistance_t4294610605::get_offset_of_ShadowDistance_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3283 = { sizeof (FeatureSelectionDetector_t508482069), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3283[2] =
{
FeatureSelectionDetector_t508482069::get_offset_of__marker_2(),
FeatureSelectionDetector_t508482069::get_offset_of__feature_3(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3284 = { sizeof (FeatureUiMarker_t3847499068), -1, sizeof(FeatureUiMarker_t3847499068_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable3284[6] =
{
FeatureUiMarker_t3847499068::get_offset_of__wrapperMarker_2(),
FeatureUiMarker_t3847499068::get_offset_of__infoPanel_3(),
FeatureUiMarker_t3847499068::get_offset_of__info_4(),
FeatureUiMarker_t3847499068::get_offset_of__targetVerts_5(),
FeatureUiMarker_t3847499068::get_offset_of__selectedFeature_6(),
FeatureUiMarker_t3847499068_StaticFields::get_offset_of_U3CU3Ef__amU24cache0_7(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3285 = { sizeof (ForwardGeocodeUserInput_t2575136032), -1, sizeof(ForwardGeocodeUserInput_t2575136032_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable3285[7] =
{
ForwardGeocodeUserInput_t2575136032::get_offset_of__inputField_2(),
ForwardGeocodeUserInput_t2575136032::get_offset_of__resource_3(),
ForwardGeocodeUserInput_t2575136032::get_offset_of__coordinate_4(),
ForwardGeocodeUserInput_t2575136032::get_offset_of__hasResponse_5(),
ForwardGeocodeUserInput_t2575136032::get_offset_of_U3CResponseU3Ek__BackingField_6(),
ForwardGeocodeUserInput_t2575136032::get_offset_of_OnGeocoderResponse_7(),
ForwardGeocodeUserInput_t2575136032_StaticFields::get_offset_of_U3CU3Ef__amU24cache0_8(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3286 = { sizeof (HighlightFeature_t1851209614), -1, sizeof(HighlightFeature_t1851209614_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable3286[3] =
{
HighlightFeature_t1851209614_StaticFields::get_offset_of__highlightMaterial_2(),
HighlightFeature_t1851209614::get_offset_of__materials_3(),
HighlightFeature_t1851209614::get_offset_of__meshRenderer_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3287 = { sizeof (ImmediatePositionWithLocationProvider_t789589409), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3287[4] =
{
ImmediatePositionWithLocationProvider_t789589409::get_offset_of__map_2(),
ImmediatePositionWithLocationProvider_t789589409::get_offset_of__isInitialized_3(),
ImmediatePositionWithLocationProvider_t789589409::get_offset_of__locationProvider_4(),
ImmediatePositionWithLocationProvider_t789589409::get_offset_of__targetPosition_5(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3288 = { sizeof (LabelTextSetter_t2340976267), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3288[1] =
{
LabelTextSetter_t2340976267::get_offset_of__textMesh_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3289 = { sizeof (LoadingPanelController_t2494933297), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3289[3] =
{
LoadingPanelController_t2494933297::get_offset_of__content_2(),
LoadingPanelController_t2494933297::get_offset_of__text_3(),
LoadingPanelController_t2494933297::get_offset_of__curve_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3290 = { sizeof (MakiHelper_t3260814930), -1, sizeof(MakiHelper_t3260814930_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable3290[3] =
{
MakiHelper_t3260814930_StaticFields::get_offset_of_Parent_2(),
MakiHelper_t3260814930_StaticFields::get_offset_of_UiPrefab_3(),
MakiHelper_t3260814930::get_offset_of__uiObject_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3291 = { sizeof (ObjectInspectorModifier_t3950592485), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3291[3] =
{
ObjectInspectorModifier_t3950592485::get_offset_of__detectors_3(),
ObjectInspectorModifier_t3950592485::get_offset_of__marker_4(),
ObjectInspectorModifier_t3950592485::get_offset_of__tempDetector_5(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3292 = { sizeof (PoiMarkerHelper_t575496201), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3292[1] =
{
PoiMarkerHelper_t575496201::get_offset_of__props_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3293 = { sizeof (PositionWithLocationProvider_t2078499108), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3293[6] =
{
PositionWithLocationProvider_t2078499108::get_offset_of__map_2(),
PositionWithLocationProvider_t2078499108::get_offset_of__positionFollowFactor_3(),
PositionWithLocationProvider_t2078499108::get_offset_of__useTransformLocationProvider_4(),
PositionWithLocationProvider_t2078499108::get_offset_of__isInitialized_5(),
PositionWithLocationProvider_t2078499108::get_offset_of__locationProvider_6(),
PositionWithLocationProvider_t2078499108::get_offset_of__targetPosition_7(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3294 = { sizeof (QuadTreeCameraMovement_t4261193325), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3294[10] =
{
QuadTreeCameraMovement_t4261193325::get_offset_of__panSpeed_2(),
QuadTreeCameraMovement_t4261193325::get_offset_of__zoomSpeed_3(),
QuadTreeCameraMovement_t4261193325::get_offset_of__referenceCamera_4(),
QuadTreeCameraMovement_t4261193325::get_offset_of__quadTreeTileProvider_5(),
QuadTreeCameraMovement_t4261193325::get_offset_of__dynamicZoomMap_6(),
QuadTreeCameraMovement_t4261193325::get_offset_of__useDegreeMethod_7(),
QuadTreeCameraMovement_t4261193325::get_offset_of__origin_8(),
QuadTreeCameraMovement_t4261193325::get_offset_of__mousePosition_9(),
QuadTreeCameraMovement_t4261193325::get_offset_of__mousePositionPrevious_10(),
QuadTreeCameraMovement_t4261193325::get_offset_of__shouldDrag_11(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3295 = { sizeof (ReloadMap_t3484436943), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3295[7] =
{
ReloadMap_t3484436943::get_offset_of__camera_2(),
ReloadMap_t3484436943::get_offset_of__cameraStartPos_3(),
ReloadMap_t3484436943::get_offset_of__map_4(),
ReloadMap_t3484436943::get_offset_of__forwardGeocoder_5(),
ReloadMap_t3484436943::get_offset_of__zoomSlider_6(),
ReloadMap_t3484436943::get_offset_of__reloadRoutine_7(),
ReloadMap_t3484436943::get_offset_of__wait_8(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3296 = { sizeof (U3CReloadAfterDelayU3Ec__Iterator0_t22183295), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3296[5] =
{
U3CReloadAfterDelayU3Ec__Iterator0_t22183295::get_offset_of_zoom_0(),
U3CReloadAfterDelayU3Ec__Iterator0_t22183295::get_offset_of_U24this_1(),
U3CReloadAfterDelayU3Ec__Iterator0_t22183295::get_offset_of_U24current_2(),
U3CReloadAfterDelayU3Ec__Iterator0_t22183295::get_offset_of_U24disposing_3(),
U3CReloadAfterDelayU3Ec__Iterator0_t22183295::get_offset_of_U24PC_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3297 = { sizeof (ReverseGeocodeUserInput_t2632079094), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3297[7] =
{
ReverseGeocodeUserInput_t2632079094::get_offset_of__inputField_2(),
ReverseGeocodeUserInput_t2632079094::get_offset_of__resource_3(),
ReverseGeocodeUserInput_t2632079094::get_offset_of__geocoder_4(),
ReverseGeocodeUserInput_t2632079094::get_offset_of__coordinate_5(),
ReverseGeocodeUserInput_t2632079094::get_offset_of__hasResponse_6(),
ReverseGeocodeUserInput_t2632079094::get_offset_of_U3CResponseU3Ek__BackingField_7(),
ReverseGeocodeUserInput_t2632079094::get_offset_of_OnGeocoderResponse_8(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3298 = { sizeof (RotateWithLocationProvider_t2777253481), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3298[6] =
{
RotateWithLocationProvider_t2777253481::get_offset_of__rotationFollowFactor_2(),
RotateWithLocationProvider_t2777253481::get_offset_of__rotateZ_3(),
RotateWithLocationProvider_t2777253481::get_offset_of__useTransformLocationProvider_4(),
RotateWithLocationProvider_t2777253481::get_offset_of__targetRotation_5(),
RotateWithLocationProvider_t2777253481::get_offset_of__locationProvider_6(),
RotateWithLocationProvider_t2777253481::get_offset_of__targetPosition_7(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize3299 = { sizeof (AbstractAlignmentStrategy_t2689440908), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable3299[1] =
{
AbstractAlignmentStrategy_t2689440908::get_offset_of__transform_2(),
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
| 42.982929 | 235 | 0.826043 | bhuwanY-Hexaware |
fadb55b9cc81be894247c5eaaae33c2792389608 | 460 | cpp | C++ | 720. Longest Word in Dictionary.cpp | rajeev-ranjan-au6/Leetcode_Cpp | f64cd98ab96ec110f1c21393f418acf7d88473e8 | [
"MIT"
] | 3 | 2020-12-30T00:29:59.000Z | 2021-01-24T22:43:04.000Z | 720. Longest Word in Dictionary.cpp | rajeevranjancom/Leetcode_Cpp | f64cd98ab96ec110f1c21393f418acf7d88473e8 | [
"MIT"
] | null | null | null | 720. Longest Word in Dictionary.cpp | rajeevranjancom/Leetcode_Cpp | f64cd98ab96ec110f1c21393f418acf7d88473e8 | [
"MIT"
] | null | null | null | class Solution {
public:
string longestWord(vector<string>& words) {
string res = "";
unordered_map<int, unordered_set<string>>m;
for(auto s: words) m[s.size()].insert(s);
for(auto s: words){
int i = 1;
while(i < s.size() && m[i].count(s.substr(0, i))) i++;
if(i == s.size() && s.size() >= res.size()) res = s.size() > res.size() ? s : min(s, res);
}
return res;
}
};
| 30.666667 | 102 | 0.482609 | rajeev-ranjan-au6 |
fadb985dbc23fb7e6b54f8c12c427d8f939f8ee2 | 561 | hpp | C++ | src/standard/bits/DD_IsEnum.hpp | iDingDong/libDDCPP-old | 841260fecc84330ff3bfffba7263f5318f0b4655 | [
"BSD-3-Clause"
] | 1 | 2018-06-01T03:29:34.000Z | 2018-06-01T03:29:34.000Z | src/standard/bits/DD_IsEnum.hpp | iDingDong/libDDCPP-old | 841260fecc84330ff3bfffba7263f5318f0b4655 | [
"BSD-3-Clause"
] | null | null | null | src/standard/bits/DD_IsEnum.hpp | iDingDong/libDDCPP-old | 841260fecc84330ff3bfffba7263f5318f0b4655 | [
"BSD-3-Clause"
] | null | null | null | // DDCPP/standard/bits/DD_IsEnum.hpp
#ifndef DD_IS_ENUM_HPP_INCLUDED_
# define DD_IS_ENUM_HPP_INCLUDED_ 1
# if __cplusplus < 201103L
# error ISO/IEC 14882:2011 or a later version support is required for'DD::IsEnum'.
# endif
# include <type_traits>
# include "DD_And.hpp"
DD_DETAIL_BEGIN_
template <typename... ObjectsT_>
struct IsEnum : AndType<IsEnum<ObjectsT_>...> {
};
template <typename ObjectT_>
struct IsEnum<ObjectT_> : StdBoolConstant<std::is_enum<ObjectT_>> {
};
DD_DETAIL_END_
DD_BEGIN_
using detail_::IsEnum;
DD_END_
#endif
| 12.195652 | 83 | 0.743316 | iDingDong |
fadfcaec11730498729318661eb1452370c87d69 | 1,140 | cpp | C++ | examples/syntax/fp-values-in-string-assembly.using-specific-headers.cpp | alf-p-steinbach/cppx-core-language | 930351fe0df65e231e8e91998f1c94d345938107 | [
"MIT"
] | 3 | 2020-05-24T16:29:42.000Z | 2021-09-10T13:33:15.000Z | examples/syntax/fp-values-in-string-assembly.using-specific-headers.cpp | alf-p-steinbach/cppx-core-language | 930351fe0df65e231e8e91998f1c94d345938107 | [
"MIT"
] | null | null | null | examples/syntax/fp-values-in-string-assembly.using-specific-headers.cpp | alf-p-steinbach/cppx-core-language | 930351fe0df65e231e8e91998f1c94d345938107 | [
"MIT"
] | null | null | null | #include <cppx-core-language/calc/floating-point-operations.hpp> // cppx::intpow
#include <cppx-core-language/calc/named-numbers.hpp> // cppx::m::pi
#include <cppx-core-language/calc/number-type-properties.hpp> // cppx::n_digits_
#include <cppx-core-language/syntax/types.hpp> // cppx::Sequence
#include <cppx-core-language/syntax/string-expressions.hpp> // cppx::syntax::*
#include <c/stdio.hpp>
#include <string>
$use_std( string );
void say( const string& s ) { printf( "%s\n", s.c_str() ); }
auto main()
-> int
{
$use_cppx( intpow, m::pi, n_digits_, spaces, Sequence );
using namespace cppx::syntax; // "<<", spaces
const int max_decimals = n_digits_<double> - 1;
say( "Pi is roughly "s << pi << ", or thereabouts." );
say( "More precisely it's "s << fp::fix( pi, max_decimals ) << ", and so on." );
say( "" );
for( const int n: Sequence( 0, max_decimals ) ) {
const double c = intpow( 10, n );
const int n_spaces = 30 - n + (n == 0);
say( ""s << fp::fix( pi, n ) << spaces( n_spaces ) << fp::sci( c*pi ) );
}
}
| 38 | 86 | 0.581579 | alf-p-steinbach |
fae164a1977e871c3a0651c73abedf09fde1bacd | 1,094 | cpp | C++ | elenasrc2/ide/historylist.cpp | drkameleon/elena-lang | 8585e93a3bc0b19f8d60029ffbe01311d0b711a3 | [
"MIT"
] | 193 | 2015-07-03T22:23:27.000Z | 2022-03-15T18:56:02.000Z | elenasrc2/ide/historylist.cpp | drkameleon/elena-lang | 8585e93a3bc0b19f8d60029ffbe01311d0b711a3 | [
"MIT"
] | 531 | 2015-05-07T09:39:42.000Z | 2021-09-27T07:51:38.000Z | elenasrc2/ide/historylist.cpp | drkameleon/elena-lang | 8585e93a3bc0b19f8d60029ffbe01311d0b711a3 | [
"MIT"
] | 31 | 2015-09-30T13:07:36.000Z | 2021-10-15T13:08:04.000Z | //---------------------------------------------------------------------------
// E L E N A P r o j e c t: ELENA IDE
// MenuHistoryList class implementation
// (C)2005-2018, by Alexei Rakov
//---------------------------------------------------------------------------
#include "historylist.h"
#include "elena.h"
using namespace _GUI_;
using namespace _ELENA_;
RecentList :: RecentList(int maxCount, int menuBaseId)
: MenuHistoryList(maxCount, menuBaseId, true)
{
}
void RecentList :: load(XmlConfigFile& file, const char* section)
{
_ConfigFile::Nodes nodes;
file.select(section, nodes);
for (auto it = nodes.start(); !it.Eof(); it++) {
_list.add(text_str(TextString((*it).Content())).clone());
}
}
void RecentList :: save(XmlConfigFile& file, const char* section)
{
//file.clear(section);
for(List<text_c*>::Iterator it = _list.start() ; !it.Eof() ; it++) {
IdentifierString value(*it);
// config.setSetting(section, it.key(), value);
file.appendSetting(section, value.c_str());
}
}
| 28.789474 | 77 | 0.535649 | drkameleon |
fae2e8971649ef29d954ba9d7e0e184037343fcd | 491 | cpp | C++ | math/tetration_mod/gen/random.cpp | tko919/library-checker-problems | 007a3ef79d1a1824e68545ab326d1523d9c05262 | [
"Apache-2.0"
] | 290 | 2019-06-06T22:20:36.000Z | 2022-03-27T12:45:04.000Z | math/tetration_mod/gen/random.cpp | tko919/library-checker-problems | 007a3ef79d1a1824e68545ab326d1523d9c05262 | [
"Apache-2.0"
] | 536 | 2019-06-06T18:25:36.000Z | 2022-03-29T11:46:36.000Z | math/tetration_mod/gen/random.cpp | tko919/library-checker-problems | 007a3ef79d1a1824e68545ab326d1523d9c05262 | [
"Apache-2.0"
] | 82 | 2019-06-06T18:17:55.000Z | 2022-03-21T07:40:31.000Z | #include "random.h"
#include <iostream>
using namespace std;
using ll = long long;
int main(int, char* argv[]) {
long long seed = atoll(argv[1]);
auto gen = Random(seed);
int t = gen.uniform(1, 1000);
printf("%d\n", t);
for (int i = 0; i < t; i++) {
ll a = gen.uniform(0LL, 1'000'000'000LL);
ll b = gen.uniform(0LL, 1'000'000'000LL);
ll m = gen.uniform(1LL, 1'000'000'000LL);
printf("%lld %lld %lld\n", a, b, m);
}
return 0;
}
| 22.318182 | 49 | 0.543788 | tko919 |
faea5af16d93a34b1c65f37d6648223a3ff22c70 | 9,788 | hpp | C++ | include/ironbeepp/connection.hpp | b1v1r/ironbee | 97b453afd9c3dc70342c6183a875bde22c9c4a76 | [
"Apache-2.0"
] | 148 | 2015-01-10T01:53:39.000Z | 2022-03-20T20:48:12.000Z | include/ironbeepp/connection.hpp | ErikHendriks/ironbee | 97b453afd9c3dc70342c6183a875bde22c9c4a76 | [
"Apache-2.0"
] | 8 | 2015-03-09T15:50:36.000Z | 2020-10-10T19:23:06.000Z | include/ironbeepp/connection.hpp | ErikHendriks/ironbee | 97b453afd9c3dc70342c6183a875bde22c9c4a76 | [
"Apache-2.0"
] | 46 | 2015-03-08T22:45:42.000Z | 2022-01-15T13:47:59.000Z | /*****************************************************************************
* Licensed to Qualys, Inc. (QUALYS) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* QUALYS licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
****************************************************************************/
/**
* @file
* @brief IronBee++ --- Connection
*
* This file defines (Const)Connection, a wrapper for ib_conn_t.
*
* @remark Developers should be familiar with @ref ironbeepp to understand
* aspects of this code, e.g., the public/non-virtual inheritance.
*
* @author Christopher Alfeld <[email protected]>
*/
#ifndef __IBPP__CONNECTION__
#define __IBPP__CONNECTION__
#include <ironbeepp/abi_compatibility.hpp>
#include <ironbeepp/common_semantics.hpp>
#include <ironbeepp/module.hpp>
#include <ironbee/engine.h>
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor"
#endif
#include <boost/date_time/posix_time/ptime.hpp>
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#include <ostream>
// IronBee C Type
typedef struct ib_conn_t ib_conn_t;
namespace IronBee {
class Engine;
class MemoryManager;
class Context;
class Transaction;
/**
* Const Connection; equivalent to a const pointer to ib_conn_t.
*
* Provides operators ==, !=, <, >, <=, >= and evaluation as a boolean for
* singularity via CommonSemantics.
*
* See Connection for discussion of Connection
*
* @sa Connection
* @sa ironbeepp
* @sa ib_conn_t
* @nosubgrouping
**/
class ConstConnection :
public CommonSemantics<ConstConnection>
{
public:
//! C Type.
typedef const ib_conn_t* ib_type;
/**
* Construct singular ConstConnection.
*
* All behavior of a singular ConstConnection is undefined except for
* assignment, copying, comparison, and evaluate-as-bool.
**/
ConstConnection();
/**
* @name C Interoperability
* Methods to access underlying C types.
**/
///@{
//! const ib_conn_t accessor.
// Intentionally inlined.
ib_type ib() const
{
return m_ib;
}
//! Construct Connection from ib_conn_t.
explicit
ConstConnection(ib_type ib_connection);
///@}
//! Associated Engine.
Engine engine() const;
//! Associated MemoryManager.
MemoryManager memory_manager() const;
//! Identifier.
const char* id() const;
//! Associated Context.
Context context() const;
//! When the connection started.
boost::posix_time::ptime started_time() const;
//! When the connection finished.
boost::posix_time::ptime finished_time() const;
//! Remote IP address as a dotted quad string.
const char* remote_ip_string() const;
//! Remote port.
uint16_t remote_port() const;
//! Local IP address as a dotted quad string.
const char* local_ip_string() const;
//! Local port.
uint16_t local_port() const;
//! Number of transactions.
size_t transaction_count() const;
/**
* First transaction / beginning of transaction list.
*
* Later transaction can be accessed via Transaction::next().
**/
Transaction first_transaction() const;
//! Last transaction / end of transaction list.
Transaction last_transaction() const;
//! Transaction most recently created/destroyed/modified.
Transaction transaction() const;
/**
* @name Flags
* Transaction Flags
*
* The masks for the flags are defined by the flags_e enum. All flags
* as a set of bits can be accessed via flags(). Individual flags can be
* checked either via flags() @c & @c flag_X or via @c is_X().
**/
///@{
//! Possible flags. Treat as bit masks.
enum flags_e {
flag_none = IB_CONN_FNONE,
flag_error = IB_CONN_FERROR,
flag_transaction = IB_CONN_FTX,
flag_data_in = IB_CONN_FDATAIN,
flag_data_out = IB_CONN_FDATAOUT,
flag_opened = IB_CONN_FOPENED,
flag_closed = IB_CONN_FCLOSED
};
//! All flags.
ib_flags_t flags() const;
//! flags() & flag_none
bool is_none() const
{
return flags() & flag_none;
}
//! flags() & flag_error
bool is_error() const
{
return flags() & flag_error;
}
//! flags() & flag_transaction
bool is_transaction() const
{
return flags() & flag_transaction;
}
//! flags() & flag_data_in
bool is_data_in() const
{
return flags() & flag_data_in;
}
//! flags() & flag_data_out
bool is_data_out() const
{
return flags() & flag_data_out;
}
//! flags() & flag_opened
bool is_opened() const
{
return flags() & flag_opened;
}
//! flags() & flag_closed
bool is_closed() const
{
return flags() & flag_closed;
}
private:
ib_type m_ib;
};
/**
* Connection; equivalent to a pointer to ib_conn_t.
*
* Connection can be treated as ConstConnection. See @ref ironbeepp for
* details on IronBee++ object semantics.
*
* A connection is a sequence of transactions over a single stream between
* a remote and a local entity.
*
* This class adds no functionality to ConstConnection beyond providing a
* non-const @c ib_conn_t* via ib().
*
* @sa ConstConnection
* @sa ironbeepp
* @sa ib_conn_t
* @nosubgrouping
**/
class Connection :
public ConstConnection
{
public:
//! C Type.
typedef ib_conn_t* ib_type;
/**
* Remove the constness of a ConstConnection.
*
* @warning This is as dangerous as a @c const_cast, use carefully.
*
* @param[in] connection ConstConnection to remove const from.
* @returns Connection pointing to same underlying connection as
* @a connection.
**/
static Connection remove_const(ConstConnection connection);
/**
* Construct singular Connection.
*
* All behavior of a singular Connection is undefined except for
* assignment, copying, comparison, and evaluate-as-bool.
**/
Connection();
/**
* @name C Interoperability
* Methods to access underlying C types.
**/
///@{
//! ib_conn_t accessor.
ib_type ib() const
{
return m_ib;
}
//! Construct Connection from ib_conn_t.
explicit
Connection(ib_type ib_connection);
///@}
/**
* Create a new connection.
*
* The C API provides a plugin context @c void* parameter for connection
* creation. This is currently unsupported. It is intended that C++
* server plugins not need that context.
*
* @param[in] engine Engine to associate connection with.
* @returns Connection
**/
static
Connection create(Engine engine);
/**
* Set remote IP string.
*
* The memory pointed to by @a ip must have a lifetime that exceeds the
* connection.
*
* @param[in] ip New remote IP string.
**/
void set_remote_ip_string(const char* ip) const;
/**
* Set remote port number.
*
* @param[in] port New port number.
**/
void set_remote_port(uint16_t port) const;
/**
* Set local IP string.
*
* The memory pointed to by @a ip must have a lifetime that exceeds the
* connection.
*
* @param[in] ip New local IP string.
**/
void set_local_ip_string(const char* ip) const;
/**
* Set local port number.
*
* @param[in] port New port number.
**/
void set_local_port(uint16_t port) const;
/**
* Destroy connection.
**/
void destroy() const;
/**
* Copy @a t into the T module data.
*
* ConstConnection::memory_manager() will be charged with
* destroying the copy of @a t when the transaction is over.
*
* @param[in] m The module to store @a t for.
* @param[in] t The module data.
* @throws IronBee errors on C API failures.
*/
template<typename T>
void set_module_data(ConstModule m, T t);
/**
* Return a reference to the stored module connection data.
*
* @param[in] m The module that the data is stored for.
* @throws IronBee errors on C API failures.
*/
template<typename T>
T get_module_data(ConstModule m);
private:
ib_type m_ib;
};
/**
* Output operator for Connection.
*
* Output IronBee::Connection[@e value] where @e value is remote ip and port
* -> local ip ad port.
*
* @param[in] o Ostream to output to.
* @param[in] connection Connection to output.
* @return @a o
**/
std::ostream& operator<<(std::ostream& o, const ConstConnection& connection);
template<typename T>
void Connection::set_module_data(ConstModule m, T t) {
void *v = value_to_data(t, memory_manager().ib());
throw_if_error(
ib_conn_set_module_data(ib(), m.ib(), v)
);
}
template<typename T>
T Connection::get_module_data(ConstModule m)
{
void *v = NULL;
throw_if_error(
ib_conn_get_module_data(ib(), m.ib(), &v)
);
return data_to_value<T>(v);
}
} // IronBee
#endif
| 24.592965 | 78 | 0.631794 | b1v1r |
faeab71bf12d01b90741d85608c874526118d5fb | 285 | cpp | C++ | src/dot.cpp | blauergrashalm/galaxy_server | 762c7f939ed1675c1fdbde15c8d1dbada22cfbef | [
"MIT"
] | 1 | 2020-04-07T17:35:31.000Z | 2020-04-07T17:35:31.000Z | src/dot.cpp | blauergrashalm/galaxy_server | 762c7f939ed1675c1fdbde15c8d1dbada22cfbef | [
"MIT"
] | 12 | 2020-04-08T13:45:52.000Z | 2020-06-02T09:45:42.000Z | src/dot.cpp | blauergrashalm/galaxy_server | 762c7f939ed1675c1fdbde15c8d1dbada22cfbef | [
"MIT"
] | null | null | null | #include "dot.hpp"
#include "field.hpp"
json Dot::toJson()
{
json dot;
dot["x"] = position.x;
dot["y"] = position.y;
for (auto it = fields.begin(); it != fields.end(); it++)
{
dot["fields"].push_back((*it)->id);
}
dot["id"] = id;
return dot;
}
| 17.8125 | 60 | 0.508772 | blauergrashalm |
faee715662cf26f2db0ab242376cf4af16425a18 | 1,165 | cpp | C++ | tests/RomanToIntegerTest.cpp | yanzhe-chen/LeetCode | d82f0b9721ea613ab216c78e7286671d0e9e4187 | [
"MIT"
] | 43 | 2015-10-10T12:59:52.000Z | 2018-07-11T18:07:00.000Z | tests/RomanToIntegerTest.cpp | yanzhe-chen/LeetCode | d82f0b9721ea613ab216c78e7286671d0e9e4187 | [
"MIT"
] | null | null | null | tests/RomanToIntegerTest.cpp | yanzhe-chen/LeetCode | d82f0b9721ea613ab216c78e7286671d0e9e4187 | [
"MIT"
] | 11 | 2015-10-10T14:41:11.000Z | 2018-07-28T06:03:16.000Z | #include "catch.hpp"
#include "RomanToInteger.hpp"
TEST_CASE("Roman To Integer") {
RomanToInteger s;
SECTION("Base tests") {
REQUIRE(s.romanToInt("I") == 1);
REQUIRE(s.romanToInt("II") == 2);
REQUIRE(s.romanToInt("III") == 3);
REQUIRE(s.romanToInt("XL") == 40);
REQUIRE(s.romanToInt("L") == 50);
REQUIRE(s.romanToInt("LX") == 60);
REQUIRE(s.romanToInt("DCC") == 700);
REQUIRE(s.romanToInt("DCCC") == 800);
REQUIRE(s.romanToInt("CM") == 900);
REQUIRE(s.romanToInt("M") == 1000);
REQUIRE(s.romanToInt("MM") == 2000);
REQUIRE(s.romanToInt("MMM") == 3000);
}
SECTION("Combination tests") {
REQUIRE(s.romanToInt("LXI") == 61);
REQUIRE(s.romanToInt("CMLXI") == 961);
REQUIRE(s.romanToInt("MMCMLXI") == 2961);
}
SECTION("Zero tests") {
REQUIRE(s.romanToInt("CCCXX") == 320);
REQUIRE(s.romanToInt("DVII") == 507);
REQUIRE(s.romanToInt("MVI") == 1006);
REQUIRE(s.romanToInt("MMXXX") == 2030);
REQUIRE(s.romanToInt("MMXXX") == 2030);
REQUIRE(s.romanToInt("MMMD") == 3500);
}
}
| 33.285714 | 49 | 0.547639 | yanzhe-chen |
faefcee01eb2ab2ef48a0675776cb5f58042a766 | 1,720 | hpp | C++ | android-31/android/inputmethodservice/InputMethodService_InputMethodSessionImpl.hpp | YJBeetle/QtAndroidAPI | 1468b5dc6eafaf7709f0b00ba1a6ec2b70684266 | [
"Apache-2.0"
] | 12 | 2020-03-26T02:38:56.000Z | 2022-03-14T08:17:26.000Z | android-28/android/inputmethodservice/InputMethodService_InputMethodSessionImpl.hpp | YJBeetle/QtAndroidAPI | 1468b5dc6eafaf7709f0b00ba1a6ec2b70684266 | [
"Apache-2.0"
] | 1 | 2021-01-27T06:07:45.000Z | 2021-11-13T19:19:43.000Z | android-30/android/inputmethodservice/InputMethodService_InputMethodSessionImpl.hpp | YJBeetle/QtAndroidAPI | 1468b5dc6eafaf7709f0b00ba1a6ec2b70684266 | [
"Apache-2.0"
] | 3 | 2021-02-02T12:34:55.000Z | 2022-03-08T07:45:57.000Z | #pragma once
#include "./AbstractInputMethodService_AbstractInputMethodSessionImpl.hpp"
class JArray;
namespace android::graphics
{
class Rect;
}
namespace android::inputmethodservice
{
class InputMethodService;
}
namespace android::os
{
class Bundle;
}
namespace android::view::inputmethod
{
class CursorAnchorInfo;
}
namespace android::view::inputmethod
{
class ExtractedText;
}
class JString;
namespace android::inputmethodservice
{
class InputMethodService_InputMethodSessionImpl : public android::inputmethodservice::AbstractInputMethodService_AbstractInputMethodSessionImpl
{
public:
// Fields
// QJniObject forward
template<typename ...Ts> explicit InputMethodService_InputMethodSessionImpl(const char *className, const char *sig, Ts...agv) : android::inputmethodservice::AbstractInputMethodService_AbstractInputMethodSessionImpl(className, sig, std::forward<Ts>(agv)...) {}
InputMethodService_InputMethodSessionImpl(QJniObject obj);
// Constructors
InputMethodService_InputMethodSessionImpl(android::inputmethodservice::InputMethodService arg0);
// Methods
void appPrivateCommand(JString arg0, android::os::Bundle arg1) const;
void displayCompletions(JArray arg0) const;
void finishInput() const;
void toggleSoftInput(jint arg0, jint arg1) const;
void updateCursor(android::graphics::Rect arg0) const;
void updateCursorAnchorInfo(android::view::inputmethod::CursorAnchorInfo arg0) const;
void updateExtractedText(jint arg0, android::view::inputmethod::ExtractedText arg1) const;
void updateSelection(jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5) const;
void viewClicked(jboolean arg0) const;
};
} // namespace android::inputmethodservice
| 31.272727 | 261 | 0.797674 | YJBeetle |
faf0792514d28bfaa3975ccbb47597ba0a93f48e | 4,542 | cpp | C++ | src/tracks/playabletrack/notetrack/ui/NoteTrackVZoomHandle.cpp | luoxiao/audacity | afdcded32d50ff1fd4ed6f736ab1824d540ae4d2 | [
"CC-BY-3.0"
] | 1 | 2019-08-05T09:19:46.000Z | 2019-08-05T09:19:46.000Z | src/tracks/playabletrack/notetrack/ui/NoteTrackVZoomHandle.cpp | luoxiao/audacity | afdcded32d50ff1fd4ed6f736ab1824d540ae4d2 | [
"CC-BY-3.0"
] | null | null | null | src/tracks/playabletrack/notetrack/ui/NoteTrackVZoomHandle.cpp | luoxiao/audacity | afdcded32d50ff1fd4ed6f736ab1824d540ae4d2 | [
"CC-BY-3.0"
] | null | null | null | /**********************************************************************
Audacity: A Digital Audio Editor
NoteTrackVZoomHandle.cpp
Paul Licameli split from TrackPanel.cpp
**********************************************************************/
#include "../../../../Audacity.h"
#include "NoteTrackVZoomHandle.h"
#include "../../../../Experimental.h"
#include "NoteTrackVRulerControls.h"
#include "../../../../HitTestResult.h"
#include "../../../../NoteTrack.h"
#include "../../../../Project.h"
#include "../../../../RefreshCode.h"
#include "../../../../TrackPanelMouseEvent.h"
#include "../../../../../images/Cursors.h"
#include <wx/event.h>
namespace
{
bool IsDragZooming(int zoomStart, int zoomEnd)
{
const int DragThreshold = 3;// Anything over 3 pixels is a drag, else a click.
return (abs(zoomEnd - zoomStart) > DragThreshold);
}
}
///////////////////////////////////////////////////////////////////////////////
NoteTrackVZoomHandle::NoteTrackVZoomHandle
(const std::shared_ptr<NoteTrack> &pTrack, const wxRect &rect, int y)
: mZoomStart(y), mZoomEnd(y), mRect(rect)
, mpTrack{ pTrack }
{
}
void NoteTrackVZoomHandle::Enter(bool)
{
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;
#endif
}
HitTestPreview NoteTrackVZoomHandle::HitPreview(const wxMouseState &state)
{
static auto zoomInCursor =
::MakeCursor(wxCURSOR_MAGNIFIER, ZoomInCursorXpm, 19, 15);
static auto zoomOutCursor =
::MakeCursor(wxCURSOR_MAGNIFIER, ZoomOutCursorXpm, 19, 15);
const auto message =
_("Click to verticaly zoom in, Shift-click to zoom out, Drag to create a particular zoom region.");
return {
message,
(state.ShiftDown() ? &*zoomOutCursor : &*zoomInCursor)
// , message
};
}
UIHandlePtr NoteTrackVZoomHandle::HitTest
(std::weak_ptr<NoteTrackVZoomHandle> &holder,
const wxMouseState &state,
const std::shared_ptr<NoteTrack> &pTrack, const wxRect &rect)
{
if (pTrack) {
auto result = std::make_shared<NoteTrackVZoomHandle>(
pTrack, rect, state.m_y);
result = AssignUIHandlePtr(holder, result);
return result;
}
return {};
}
NoteTrackVZoomHandle::~NoteTrackVZoomHandle()
{
}
UIHandle::Result NoteTrackVZoomHandle::Click
(const TrackPanelMouseEvent &, AudacityProject *)
{
// change note track to zoom like audio track
// mpTrack->StartVScroll();
return RefreshCode::RefreshNone;
}
UIHandle::Result NoteTrackVZoomHandle::Drag
(const TrackPanelMouseEvent &evt, AudacityProject *pProject)
{
using namespace RefreshCode;
auto pTrack = pProject->GetTracks()->Lock(mpTrack);
if (!pTrack)
return Cancelled;
const wxMouseEvent &event = evt.event;
mZoomEnd = event.m_y;
if (IsDragZooming(mZoomStart, mZoomEnd)) {
// changed Note track to work like audio track
// pTrack->VScroll(mZoomStart, mZoomEnd);
return RefreshAll;
}
return RefreshNone;
}
HitTestPreview NoteTrackVZoomHandle::Preview
(const TrackPanelMouseState &st, const AudacityProject *)
{
return HitPreview(st.state);
}
UIHandle::Result NoteTrackVZoomHandle::Release
(const TrackPanelMouseEvent &evt, AudacityProject *pProject,
wxWindow *pParent)
{
using namespace RefreshCode;
auto pTrack = pProject->GetTracks()->Lock(mpTrack);
if (!pTrack)
return RefreshNone;
const wxMouseEvent &event = evt.event;
if (IsDragZooming(mZoomStart, mZoomEnd)) {
pTrack->ZoomTo(evt.rect, mZoomStart, mZoomEnd);
}
else if (event.ShiftDown() || event.RightUp()) {
if (event.ShiftDown() && event.RightUp()) {
// Zoom out completely
pTrack->SetBottomNote(0);
pTrack->SetPitchHeight(evt.rect.height, 1);
} else {
// Zoom out
pTrack->ZoomOut(evt.rect, mZoomEnd);
}
}
else {
pTrack->ZoomIn(evt.rect, mZoomEnd);
}
mZoomEnd = mZoomStart = 0;
pProject->ModifyState(true);
return RefreshAll;
}
UIHandle::Result NoteTrackVZoomHandle::Cancel(AudacityProject *pProject)
{
// Cancel is implemented! And there is no initial state to restore,
// so just return a code.
return RefreshCode::RefreshAll;
}
void NoteTrackVZoomHandle::DrawExtras
(DrawingPass pass, wxDC * dc, const wxRegion &, const wxRect &panelRect)
{
if (!mpTrack.lock()) //? TrackList::Lock()
return;
if ( pass == UIHandle::Cells &&
IsDragZooming( mZoomStart, mZoomEnd ) )
TrackVRulerControls::DrawZooming
( dc, mRect, panelRect, mZoomStart, mZoomEnd );
}
| 26.87574 | 99 | 0.649053 | luoxiao |
faf4f5193a1d42e7a3cb5250faf0843d2d05d2f1 | 6,736 | cc | C++ | examples/Cassie/osc_jump/convert_traj_for_sim.cc | hanliumaozhi/dairlib | a74ae5b24efe708b6723e778bea6f4bb038e2951 | [
"BSD-3-Clause"
] | 1 | 2021-04-20T11:29:23.000Z | 2021-04-20T11:29:23.000Z | examples/Cassie/osc_jump/convert_traj_for_sim.cc | hanliumaozhi/dairlib | a74ae5b24efe708b6723e778bea6f4bb038e2951 | [
"BSD-3-Clause"
] | null | null | null | examples/Cassie/osc_jump/convert_traj_for_sim.cc | hanliumaozhi/dairlib | a74ae5b24efe708b6723e778bea6f4bb038e2951 | [
"BSD-3-Clause"
] | null | null | null | #include <drake/geometry/scene_graph.h>
#include <drake/multibody/parsing/parser.h>
#include <gflags/gflags.h>
#include "examples/Cassie/cassie_utils.h"
#include "multibody/multibody_utils.h"
#include "lcm/lcm_trajectory.h"
#include "drake/multibody/plant/multibody_plant.h"
using drake::geometry::SceneGraph;
using drake::multibody::JacobianWrtVariable;
using drake::multibody::MultibodyPlant;
using drake::multibody::Parser;
using drake::systems::Context;
using Eigen::Matrix3Xd;
using Eigen::MatrixXd;
using Eigen::Vector3d;
using Eigen::VectorXd;
using std::string;
DEFINE_string(trajectory_name, "",
"File name where the optimal trajectory is stored.");
DEFINE_string(folder_path,
"/home/yangwill/Documents/research/projects/cassie"
"/jumping/saved_trajs/",
"Folder path for where the trajectory names are stored");
namespace dairlib {
/// This program converts the trajectory computed using the fixed spring
/// cassie model to the cassie model with springs. This is necessary to
/// initialize the simulator at a particular state along the trajectory
int DoMain() {
// Drake system initialization stuff
drake::systems::DiagramBuilder<double> builder;
SceneGraph<double>& scene_graph = *builder.AddSystem<SceneGraph>();
scene_graph.set_name("scene_graph");
MultibodyPlant<double> plant_wo_spr(
1e-5); // non-zero timestep to avoid continuous
MultibodyPlant<double> plant_w_spr(1e-5); // non-zero timestep to avoid
Parser parser_wo_spr(&plant_wo_spr, &scene_graph);
Parser parser_w_spr(&plant_w_spr, &scene_graph);
parser_wo_spr.AddModelFromFile(
FindResourceOrThrow("examples/Cassie/urdf/cassie_fixed_springs.urdf"));
parser_w_spr.AddModelFromFile(
FindResourceOrThrow("examples/Cassie/urdf/cassie_v2.urdf"));
plant_wo_spr.mutable_gravity_field().set_gravity_vector(
-9.81 * Eigen::Vector3d::UnitZ());
plant_w_spr.mutable_gravity_field().set_gravity_vector(
-9.81 * Eigen::Vector3d::UnitZ());
plant_wo_spr.Finalize();
plant_w_spr.Finalize();
int nq_wo_spr = plant_wo_spr.num_positions();
int nv_wo_spr = plant_wo_spr.num_velocities();
int nq_w_spr = plant_w_spr.num_positions();
int nv_w_spr = plant_w_spr.num_velocities();
int nx_wo_spr = nq_wo_spr + nv_wo_spr;
int nx_w_spr = nq_w_spr + nv_w_spr;
int nu = plant_w_spr.num_actuators();
const std::map<string, int>& pos_map_w_spr =
multibody::makeNameToPositionsMap(plant_w_spr);
const std::map<string, int>& vel_map_w_spr =
multibody::makeNameToVelocitiesMap(plant_w_spr);
const std::map<string, int>& pos_map_wo_spr =
multibody::makeNameToPositionsMap(plant_wo_spr);
const std::map<string, int>& vel_map_wo_spr =
multibody::makeNameToVelocitiesMap(plant_wo_spr);
// Initialize the mapping from states for the plant without springs to the
// plant with springs. Note: this is a tall matrix
MatrixXd map_position_from_no_spring_to_spring =
MatrixXd::Zero(nq_w_spr, nq_wo_spr);
MatrixXd map_velocity_from_no_spring_to_spring =
MatrixXd::Zero(nv_w_spr, nv_wo_spr);
MatrixXd map_state_from_no_spring_to_spring =
MatrixXd::Zero(nx_w_spr, nx_wo_spr);
for (const auto& pos_pair_wo_spr : pos_map_wo_spr) {
bool successfully_added = false;
for (const auto& pos_pair_w_spr : pos_map_w_spr) {
if (pos_pair_wo_spr.first == pos_pair_w_spr.first) {
map_position_from_no_spring_to_spring(pos_pair_w_spr.second,
pos_pair_wo_spr.second) = 1;
successfully_added = true;
}
}
DRAKE_DEMAND(successfully_added);
}
for (const auto& vel_pair_wo_spr : vel_map_wo_spr) {
bool successfully_added = false;
for (const auto& vel_pair_w_spr : vel_map_w_spr) {
if (vel_pair_wo_spr.first == vel_pair_w_spr.first) {
map_velocity_from_no_spring_to_spring(vel_pair_w_spr.second,
vel_pair_wo_spr.second) = 1;
successfully_added = true;
}
}
DRAKE_DEMAND(successfully_added);
}
map_state_from_no_spring_to_spring.block(0, 0, nq_w_spr, nq_wo_spr) =
map_position_from_no_spring_to_spring;
map_state_from_no_spring_to_spring.block(nq_w_spr, nq_wo_spr, nv_w_spr,
nv_wo_spr) =
map_velocity_from_no_spring_to_spring;
const LcmTrajectory& loadedTrajs =
LcmTrajectory(FLAGS_folder_path + FLAGS_trajectory_name);
auto traj_mode0 = loadedTrajs.getTrajectory("cassie_jumping_trajectory_x_u0");
auto traj_mode1 = loadedTrajs.getTrajectory("cassie_jumping_trajectory_x_u1");
auto traj_mode2 = loadedTrajs.getTrajectory("cassie_jumping_trajectory_x_u2");
int n_points = traj_mode0.datapoints.cols() + traj_mode1.datapoints.cols() +
traj_mode2.datapoints.cols();
MatrixXd xu(2*nx_wo_spr + nu, n_points);
VectorXd times(n_points);
xu << traj_mode0.datapoints, traj_mode1.datapoints, traj_mode2.datapoints;
times << traj_mode0.time_vector, traj_mode1.time_vector,
traj_mode2.time_vector;
MatrixXd x_w_spr(2*nx_w_spr, n_points);
x_w_spr.topRows(nx_w_spr) =
map_state_from_no_spring_to_spring * xu.topRows(nx_wo_spr);
x_w_spr.bottomRows(nx_w_spr) =
map_state_from_no_spring_to_spring * xu.topRows(2*nx_wo_spr).bottomRows
(nx_wo_spr);
auto state_traj_w_spr = LcmTrajectory::Trajectory();
state_traj_w_spr.traj_name = "cassie_jumping_trajectory_x";
state_traj_w_spr.datapoints = x_w_spr;
state_traj_w_spr.time_vector = times;
const std::vector<string> state_names =
multibody::createStateNameVectorFromMap(
plant_w_spr);
const std::vector<string> state_dot_names =
multibody::createStateNameVectorFromMap(
plant_w_spr);
state_traj_w_spr.datatypes.reserve(2 * nx_w_spr);
state_traj_w_spr.datatypes.insert(state_traj_w_spr.datatypes.end(),
state_names.begin(), state_names.end());
state_traj_w_spr.datatypes.insert(state_traj_w_spr.datatypes.end(),
state_dot_names.begin(), state_dot_names.end());
std::vector<LcmTrajectory::Trajectory> trajectories = {state_traj_w_spr};
std::vector<std::string> trajectory_names = {state_traj_w_spr.traj_name};
auto processed_traj =
LcmTrajectory(trajectories, trajectory_names, "jumping_trajectory",
"State trajectory for cassie jumping adjusted to include "
"states of the plant with springs");
processed_traj.writeToFile(FLAGS_folder_path + FLAGS_trajectory_name +
"_for_sim");
return 0;
}
} // namespace dairlib
int main(int argc, char* argv[]) {
gflags::ParseCommandLineFlags(&argc, &argv, true);
dairlib::DoMain();
} | 39.857988 | 80 | 0.729513 | hanliumaozhi |
faf515fa1845530f9b2d92b143d9a9b03bfa1a17 | 13,329 | cpp | C++ | winston/external/asio/src/tests/unit/compose.cpp | danie1kr/winston | 18fe865dc59e8315cb1d85c6fa60c4ddeaf83202 | [
"MIT"
] | 172 | 2018-10-31T13:47:10.000Z | 2022-02-21T12:08:20.000Z | winston/external/asio/src/tests/unit/compose.cpp | danie1kr/winston | 18fe865dc59e8315cb1d85c6fa60c4ddeaf83202 | [
"MIT"
] | 51 | 2018-11-01T12:46:25.000Z | 2021-12-14T15:16:15.000Z | winston/external/asio/src/tests/unit/compose.cpp | danie1kr/winston | 18fe865dc59e8315cb1d85c6fa60c4ddeaf83202 | [
"MIT"
] | 72 | 2018-10-31T13:50:02.000Z | 2022-03-14T09:10:35.000Z | //
// compose.cpp
// ~~~~~~~~~~~
//
// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/compose.hpp"
#include "unit_test.hpp"
#include "asio/bind_cancellation_slot.hpp"
#include "asio/cancellation_signal.hpp"
#include "asio/io_context.hpp"
#include "asio/post.hpp"
#include "asio/system_timer.hpp"
#if defined(ASIO_HAS_BOOST_BIND)
# include <boost/bind/bind.hpp>
#else // defined(ASIO_HAS_BOOST_BIND)
# include <functional>
#endif // defined(ASIO_HAS_BOOST_BIND)
//------------------------------------------------------------------------------
class impl_0_completion_args
{
public:
explicit impl_0_completion_args(asio::io_context& ioc)
: ioc_(ioc),
state_(starting)
{
}
template <typename Self>
void operator()(Self& self)
{
switch (state_)
{
case starting:
state_ = posting;
asio::post(ioc_, ASIO_MOVE_CAST(Self)(self));
break;
case posting:
self.complete();
break;
default:
break;
}
}
private:
asio::io_context& ioc_;
enum { starting, posting } state_;
};
template <typename CompletionToken>
ASIO_INITFN_RESULT_TYPE(CompletionToken, void())
async_0_completion_args(asio::io_context& ioc,
ASIO_MOVE_ARG(CompletionToken) token)
{
return asio::async_compose<CompletionToken, void()>(
impl_0_completion_args(ioc), token);
}
void compose_0_args_handler(int* count)
{
++(*count);
}
struct compose_0_args_lvalue_handler
{
int* count_;
void operator()()
{
++(*count_);
}
};
void compose_0_completion_args_test()
{
#if defined(ASIO_HAS_BOOST_BIND)
namespace bindns = boost;
#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
#endif // defined(ASIO_HAS_BOOST_BIND)
asio::io_context ioc;
int count = 0;
async_0_completion_args(ioc, bindns::bind(&compose_0_args_handler, &count));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
ASIO_CHECK(count == 0);
ioc.run();
// The run() call will not return until all work has finished.
ASIO_CHECK(ioc.stopped());
ASIO_CHECK(count == 1);
ioc.restart();
count = 0;
compose_0_args_lvalue_handler lvalue_handler = { &count };
async_0_completion_args(ioc, lvalue_handler);
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
ASIO_CHECK(count == 0);
ioc.run();
// The run() call will not return until all work has finished.
ASIO_CHECK(ioc.stopped());
ASIO_CHECK(count == 1);
}
//------------------------------------------------------------------------------
class impl_1_completion_arg
{
public:
explicit impl_1_completion_arg(asio::io_context& ioc)
: ioc_(ioc),
state_(starting)
{
}
template <typename Self>
void operator()(Self& self)
{
switch (state_)
{
case starting:
state_ = posting;
asio::post(ioc_, ASIO_MOVE_CAST(Self)(self));
break;
case posting:
self.complete(42);
break;
default:
break;
}
}
private:
asio::io_context& ioc_;
enum { starting, posting } state_;
};
template <typename CompletionToken>
ASIO_INITFN_RESULT_TYPE(CompletionToken, void(int))
async_1_completion_arg(asio::io_context& ioc,
ASIO_MOVE_ARG(CompletionToken) token)
{
return asio::async_compose<CompletionToken, void(int)>(
impl_1_completion_arg(ioc), token);
}
void compose_1_arg_handler(int* count, int* result_out, int result)
{
++(*count);
*result_out = result;
}
struct compose_1_arg_lvalue_handler
{
int* count_;
int* result_out_;
void operator()(int result)
{
++(*count_);
*result_out_ = result;
}
};
void compose_1_completion_arg_test()
{
#if defined(ASIO_HAS_BOOST_BIND)
namespace bindns = boost;
#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
asio::io_context ioc;
int count = 0;
int result = 0;
async_1_completion_arg(ioc,
bindns::bind(&compose_1_arg_handler, &count, &result, _1));
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
ASIO_CHECK(count == 0);
ASIO_CHECK(result == 0);
ioc.run();
// The run() call will not return until all work has finished.
ASIO_CHECK(ioc.stopped());
ASIO_CHECK(count == 1);
ASIO_CHECK(result == 42);
ioc.restart();
count = 0;
result = 0;
compose_1_arg_lvalue_handler lvalue_handler = { &count, &result };
async_1_completion_arg(ioc, lvalue_handler);
// No handlers can be called until run() is called.
ASIO_CHECK(!ioc.stopped());
ASIO_CHECK(count == 0);
ASIO_CHECK(result == 0);
ioc.run();
// The run() call will not return until all work has finished.
ASIO_CHECK(ioc.stopped());
ASIO_CHECK(count == 1);
ASIO_CHECK(result == 42);
}
//------------------------------------------------------------------------------
typedef asio::enable_terminal_cancellation default_filter;
template <typename CancellationFilter>
class impl_cancellable
{
public:
explicit impl_cancellable(CancellationFilter cancellation_filter,
asio::system_timer& timer)
: cancellation_filter_(cancellation_filter),
timer_(timer),
state_(starting)
{
}
template <typename Self>
void operator()(Self& self,
const asio::error_code& ec = asio::error_code())
{
switch (state_)
{
case starting:
if (!asio::is_same<CancellationFilter, default_filter>::value)
self.reset_cancellation_state(cancellation_filter_);
state_ = waiting;
timer_.expires_after(asio::chrono::milliseconds(100));
timer_.async_wait(ASIO_MOVE_CAST(Self)(self));
break;
case waiting:
self.complete(!ec);
break;
default:
break;
}
}
private:
CancellationFilter cancellation_filter_;
asio::system_timer& timer_;
enum { starting, waiting } state_;
};
template <typename CancellationFilter, typename CompletionToken>
ASIO_INITFN_RESULT_TYPE(CompletionToken, void(bool))
async_cancellable(CancellationFilter cancellation_filter,
asio::system_timer& timer,
ASIO_MOVE_ARG(CompletionToken) token)
{
return asio::async_compose<CompletionToken, void(bool)>(
impl_cancellable<CancellationFilter>(cancellation_filter, timer), token);
}
void compose_partial_cancellation_handler(
int* count, bool* result_out, bool result)
{
++(*count);
*result_out = result;
}
void compose_default_cancellation_test()
{
#if defined(ASIO_HAS_BOOST_BIND)
namespace bindns = boost;
#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
asio::io_context ioc;
asio::system_timer timer(ioc);
asio::cancellation_signal signal;
int count = 0;
bool result = false;
async_cancellable(default_filter(), timer,
bindns::bind(&compose_partial_cancellation_handler,
&count, &result, _1));
ioc.run();
// No cancellation, operation completes successfully.
ASIO_CHECK(ioc.stopped());
ASIO_CHECK(count == 1);
ASIO_CHECK(result == true);
ioc.restart();
count = 0;
result = 0;
async_cancellable(default_filter(), timer,
asio::bind_cancellation_slot(signal.slot(),
bindns::bind(&compose_partial_cancellation_handler,
&count, &result, _1)));
// Total cancellation unsupported. Operation completes successfully.
signal.emit(asio::cancellation_type::total);
ioc.run();
ASIO_CHECK(ioc.stopped());
ASIO_CHECK(count == 1);
ASIO_CHECK(result == true);
ioc.restart();
count = 0;
result = 0;
async_cancellable(default_filter(), timer,
asio::bind_cancellation_slot(signal.slot(),
bindns::bind(&compose_partial_cancellation_handler,
&count, &result, _1)));
// Partial cancellation unsupported. Operation completes successfully.
signal.emit(asio::cancellation_type::partial);
ioc.run();
ASIO_CHECK(ioc.stopped());
ASIO_CHECK(count == 1);
ASIO_CHECK(result == true);
ioc.restart();
count = 0;
result = 0;
async_cancellable(default_filter(), timer,
asio::bind_cancellation_slot(signal.slot(),
bindns::bind(&compose_partial_cancellation_handler,
&count, &result, _1)));
// Terminal cancellation works. Operation completes with failure.
signal.emit(asio::cancellation_type::terminal);
ioc.run();
ASIO_CHECK(ioc.stopped());
ASIO_CHECK(count == 1);
ASIO_CHECK(result == false);
}
void compose_partial_cancellation_test()
{
#if defined(ASIO_HAS_BOOST_BIND)
namespace bindns = boost;
#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
asio::io_context ioc;
asio::system_timer timer(ioc);
asio::cancellation_signal signal;
int count = 0;
bool result = false;
async_cancellable(asio::enable_partial_cancellation(), timer,
bindns::bind(&compose_partial_cancellation_handler,
&count, &result, _1));
ioc.run();
// No cancellation, operation completes successfully.
ASIO_CHECK(ioc.stopped());
ASIO_CHECK(count == 1);
ASIO_CHECK(result == true);
ioc.restart();
count = 0;
result = 0;
async_cancellable(asio::enable_partial_cancellation(), timer,
asio::bind_cancellation_slot(signal.slot(),
bindns::bind(&compose_partial_cancellation_handler,
&count, &result, _1)));
// Total cancellation unsupported. Operation completes successfully.
signal.emit(asio::cancellation_type::total);
ioc.run();
ASIO_CHECK(ioc.stopped());
ASIO_CHECK(count == 1);
ASIO_CHECK(result == true);
ioc.restart();
count = 0;
result = 0;
async_cancellable(asio::enable_partial_cancellation(), timer,
asio::bind_cancellation_slot(signal.slot(),
bindns::bind(&compose_partial_cancellation_handler,
&count, &result, _1)));
// Partial cancellation works. Operation completes with failure.
signal.emit(asio::cancellation_type::partial);
ioc.run();
ASIO_CHECK(ioc.stopped());
ASIO_CHECK(count == 1);
ASIO_CHECK(result == false);
ioc.restart();
count = 0;
result = 0;
async_cancellable(asio::enable_partial_cancellation(), timer,
asio::bind_cancellation_slot(signal.slot(),
bindns::bind(&compose_partial_cancellation_handler,
&count, &result, _1)));
// Terminal cancellation works. Operation completes with failure.
signal.emit(asio::cancellation_type::terminal);
ioc.run();
ASIO_CHECK(ioc.stopped());
ASIO_CHECK(count == 1);
ASIO_CHECK(result == false);
}
void compose_total_cancellation_test()
{
#if defined(ASIO_HAS_BOOST_BIND)
namespace bindns = boost;
#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
asio::io_context ioc;
asio::system_timer timer(ioc);
asio::cancellation_signal signal;
int count = 0;
bool result = false;
async_cancellable(asio::enable_total_cancellation(), timer,
bindns::bind(&compose_partial_cancellation_handler,
&count, &result, _1));
ioc.run();
// No cancellation, operation completes successfully.
ASIO_CHECK(ioc.stopped());
ASIO_CHECK(count == 1);
ASIO_CHECK(result == true);
ioc.restart();
count = 0;
result = 0;
async_cancellable(asio::enable_total_cancellation(), timer,
asio::bind_cancellation_slot(signal.slot(),
bindns::bind(&compose_partial_cancellation_handler,
&count, &result, _1)));
// Total cancellation works. Operation completes with failure.
signal.emit(asio::cancellation_type::total);
ioc.run();
ASIO_CHECK(ioc.stopped());
ASIO_CHECK(count == 1);
ASIO_CHECK(result == false);
ioc.restart();
count = 0;
result = 0;
async_cancellable(asio::enable_total_cancellation(), timer,
asio::bind_cancellation_slot(signal.slot(),
bindns::bind(&compose_partial_cancellation_handler,
&count, &result, _1)));
// Partial cancellation works. Operation completes with failure.
signal.emit(asio::cancellation_type::partial);
ioc.run();
ASIO_CHECK(ioc.stopped());
ASIO_CHECK(count == 1);
ASIO_CHECK(result == false);
ioc.restart();
count = 0;
result = 0;
async_cancellable(asio::enable_total_cancellation(), timer,
asio::bind_cancellation_slot(signal.slot(),
bindns::bind(&compose_partial_cancellation_handler,
&count, &result, _1)));
// Terminal cancellation works. Operation completes with failure.
signal.emit(asio::cancellation_type::terminal);
ioc.run();
ASIO_CHECK(ioc.stopped());
ASIO_CHECK(count == 1);
ASIO_CHECK(result == false);
}
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"compose",
ASIO_TEST_CASE(compose_0_completion_args_test)
ASIO_TEST_CASE(compose_1_completion_arg_test)
ASIO_TEST_CASE(compose_default_cancellation_test)
ASIO_TEST_CASE(compose_partial_cancellation_test)
ASIO_TEST_CASE(compose_total_cancellation_test)
)
| 24.016216 | 80 | 0.686548 | danie1kr |
fafa0ffbdd0a31cae636e9f4716305433a5b1a41 | 4,135 | cpp | C++ | include/utility/test/algorithm/sort.test.cpp | SakuraLife/utility | b9bf26198917b6dc415520f74eb3eebf8aa8195e | [
"Unlicense"
] | 2 | 2017-12-10T10:59:48.000Z | 2017-12-13T04:11:14.000Z | include/utility/test/algorithm/sort.test.cpp | SakuraLife/utility | b9bf26198917b6dc415520f74eb3eebf8aa8195e | [
"Unlicense"
] | null | null | null | include/utility/test/algorithm/sort.test.cpp | SakuraLife/utility | b9bf26198917b6dc415520f74eb3eebf8aa8195e | [
"Unlicense"
] | null | null | null | #define UTILITY_DEBUG
#include<cstdlib>
#include<cstdio>
#include<cassert>
#include<ctime>
#include<utility/container/vector.hpp>
#include<utility/algorithm/is_sorted.hpp>
#include<utility/algorithm/sort.hpp>
template<
typename _Tag = utility::algorithm::sort_tag::introspective_sort_tag
>
void sort_test(utility::size_t __size = 10000)
{
using std::rand;
using std::clock;
using std::clock_t;
using utility::size_t;
using utility::container::vector;
using utility::algorithm::is_sorted;
using utility::algorithm::sort;
vector<int> rec;
for(size_t __i = 0; __i < __size; ++__i)
{ rec.push_back((rand()&1?1:-1) * rand());}
clock_t begin = clock();
sort<_Tag>(rec.begin(), rec.end());
clock_t end = clock();
double ti = end - begin;
ti /= CLOCKS_PER_SEC;
assert(is_sorted(rec.begin(), rec.end()));
printf("Sort test %lu passes. Time: %lfs\n", __size, ti);
return;
}
int main()
{
using std::time;
using std::srand;
using namespace utility::algorithm::sort_tag;
srand(time(0));
printf("select_sort_tag\n");
sort_test<select_sort_tag>(10);
sort_test<select_sort_tag>(100);
sort_test<select_sort_tag>(1000);
sort_test<select_sort_tag>(10000);
sort_test<select_sort_tag>(100000);
sort_test<select_sort_tag>(1000000);
printf("bubble_sort_tag\n");
sort_test<bubble_sort_tag>(10);
sort_test<bubble_sort_tag>(100);
sort_test<bubble_sort_tag>(1000);
sort_test<bubble_sort_tag>(10000);
sort_test<bubble_sort_tag>(100000);
sort_test<bubble_sort_tag>(1000000);
printf("cocktail_shaker_sort_tag\n");
sort_test<cocktail_shaker_sort_tag>(10);
sort_test<cocktail_shaker_sort_tag>(100);
sort_test<cocktail_shaker_sort_tag>(1000);
sort_test<cocktail_shaker_sort_tag>(10000);
sort_test<cocktail_shaker_sort_tag>(100000);
sort_test<cocktail_shaker_sort_tag>(1000000);
printf("odd_even_sort_tag\n");
sort_test<odd_even_sort_tag>(10);
sort_test<odd_even_sort_tag>(100);
sort_test<odd_even_sort_tag>(1000);
sort_test<odd_even_sort_tag>(10000);
sort_test<odd_even_sort_tag>(100000);
sort_test<odd_even_sort_tag>(1000000);
printf("comb_sort_tag\n");
sort_test<comb_sort_tag>(10);
sort_test<comb_sort_tag>(100);
sort_test<comb_sort_tag>(1000);
sort_test<comb_sort_tag>(10000);
sort_test<comb_sort_tag>(100000);
sort_test<comb_sort_tag>(1000000);
printf("gnome_sort_tag\n");
sort_test<gnome_sort_tag>(10);
sort_test<gnome_sort_tag>(100);
sort_test<gnome_sort_tag>(1000);
sort_test<gnome_sort_tag>(10000);
sort_test<gnome_sort_tag>(100000);
sort_test<gnome_sort_tag>(1000000);
printf("insertion_sort_tag\n");
sort_test<insertion_sort_tag>(10);
sort_test<insertion_sort_tag>(100);
sort_test<insertion_sort_tag>(1000);
sort_test<insertion_sort_tag>(10000);
sort_test<insertion_sort_tag>(100000);
sort_test<insertion_sort_tag>(1000000);
printf("shell_sort_tag\n");
sort_test<shell_sort_tag>(10);
sort_test<shell_sort_tag>(100);
sort_test<shell_sort_tag>(1000);
sort_test<shell_sort_tag>(10000);
sort_test<shell_sort_tag>(100000);
sort_test<shell_sort_tag>(1000000);
printf("cycle_sort_tag\n");
sort_test<cycle_sort_tag>(10);
sort_test<cycle_sort_tag>(100);
sort_test<cycle_sort_tag>(1000);
sort_test<cycle_sort_tag>(10000);
sort_test<cycle_sort_tag>(100000);
sort_test<cycle_sort_tag>(1000000);
printf("heap_sort_tag\n");
sort_test<heap_sort_tag>(10);
sort_test<heap_sort_tag>(100);
sort_test<heap_sort_tag>(1000);
sort_test<heap_sort_tag>(10000);
sort_test<heap_sort_tag>(100000);
sort_test<heap_sort_tag>(1000000);
printf("quick_sort_tag\n");
sort_test<quick_sort_tag>(10);
sort_test<quick_sort_tag>(100);
sort_test<quick_sort_tag>(1000);
sort_test<quick_sort_tag>(10000);
sort_test<quick_sort_tag>(100000);
sort_test<quick_sort_tag>(1000000);
printf("introspective_sort_tag\n");
sort_test<introspective_sort_tag>(10);
sort_test<introspective_sort_tag>(100);
sort_test<introspective_sort_tag>(1000);
sort_test<introspective_sort_tag>(10000);
sort_test<introspective_sort_tag>(100000);
sort_test<introspective_sort_tag>(1000000);
}
| 28.321918 | 70 | 0.754051 | SakuraLife |
fafedb44c024c06ab46e9455b325a6456997bb17 | 659 | cpp | C++ | leetcode/problems/14.cpp | songhn233/ACM_Steps | 6f2edeca9bf4fc999a8148bc90b2d8d0e59d48fe | [
"CC0-1.0"
] | 1 | 2020-08-10T21:40:21.000Z | 2020-08-10T21:40:21.000Z | leetcode/problems/14最长公共前缀.cpp | songhn233/Algorithm-Packages | 56d6f3c2467c175ab8a19b82bdfb25fc881e2206 | [
"CC0-1.0"
] | null | null | null | leetcode/problems/14最长公共前缀.cpp | songhn233/Algorithm-Packages | 56d6f3c2467c175ab8a19b82bdfb25fc881e2206 | [
"CC0-1.0"
] | null | null | null | class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
if(!strs.size()) return "";
int lim=(int)strs[0].size();
int ans=0;
for(int i=0;i<strs.size();i++) lim=min(lim,(int)strs[i].size());
for(int len=0;len<lim;len++)
{
int flag=1;
for(int i=1;i<strs.size();i++)
{
if(strs[i][len]==strs[0][len]) continue;
flag=0;break;
}
if(flag)
{
ans=len+1;
continue;
}
else break;
}
return (strs[0].substr(0,ans));
}
}; | 26.36 | 72 | 0.412747 | songhn233 |
4f0437cb67266296fc7aefed3565e03c80990162 | 725 | cpp | C++ | src_smartcontract_db/trx/transaction/SchemaObjectIdPublisher.cpp | alinous-core/codable-cash | 32a86a152a146c592bcfd8cc712f4e8cb38ee1a0 | [
"MIT"
] | 6 | 2019-01-06T05:02:39.000Z | 2020-10-01T11:45:32.000Z | src_smartcontract_db/trx/transaction/SchemaObjectIdPublisher.cpp | Codablecash/codablecash | 8816b69db69ff2f5da6cdb6af09b8fb21d3df1d9 | [
"MIT"
] | 209 | 2018-05-18T03:07:02.000Z | 2022-03-26T11:42:41.000Z | src_smartcontract_db/trx/transaction/SchemaObjectIdPublisher.cpp | Codablecash/codablecash | 8816b69db69ff2f5da6cdb6af09b8fb21d3df1d9 | [
"MIT"
] | 3 | 2019-07-06T09:16:36.000Z | 2020-10-15T08:23:28.000Z | /*
* SchemaObjectIdPublisher.cpp
*
* Created on: 2020/05/14
* Author: iizuka
*/
#include "trx/transaction/SchemaObjectIdPublisher.h"
#include "schema_table/schema/SchemaManager.h"
namespace codablecash {
SchemaObjectIdPublisher::SchemaObjectIdPublisher(SchemaManager* schema) {
this->schema = schema;
}
SchemaObjectIdPublisher::~SchemaObjectIdPublisher() {
this->schema = nullptr;
}
uint64_t SchemaObjectIdPublisher::newOid() {
return this->schema->newSchemaObjectId();
}
void SchemaObjectIdPublisher::saveSchema() {
this->schema->save();
}
uint64_t SchemaObjectIdPublisher::getSchemaObjectVersionId() const noexcept {
return this->schema->getSchemaObjectVersionId();
}
} /* namespace codablecash */
| 20.714286 | 77 | 0.761379 | alinous-core |
4f058587b050cb1a19c9a0f6beeb8e8d690c1ef0 | 2,093 | cpp | C++ | src/util/logger.cpp | neuromancer85/Rack | 7e49a697d43bc204f68408779ac2015c66e7dd14 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2019-04-14T20:18:06.000Z | 2019-04-14T20:18:06.000Z | src/util/logger.cpp | neuromancer85/Rack | 7e49a697d43bc204f68408779ac2015c66e7dd14 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | src/util/logger.cpp | neuromancer85/Rack | 7e49a697d43bc204f68408779ac2015c66e7dd14 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | #include "util/common.hpp"
#include "asset.hpp"
#include <stdarg.h>
namespace rack {
static FILE *logFile = NULL;
static std::chrono::high_resolution_clock::time_point startTime;
void loggerInit(bool devMode) {
startTime = std::chrono::high_resolution_clock::now();
if (devMode) {
logFile = stderr;
}
else {
std::string logFilename = assetLocal("log.txt");
logFile = fopen(logFilename.c_str(), "w");
}
}
void loggerDestroy() {
if (logFile != stderr) {
fclose(logFile);
}
}
static const char* const loggerText[] = {
"debug",
"info",
"warn",
"fatal"
};
static const int loggerColor[] = {
35,
34,
33,
31
};
static void loggerLogVa(LoggerLevel level, const char *file, int line, const char *format, va_list args) {
auto nowTime = std::chrono::high_resolution_clock::now();
int duration = std::chrono::duration_cast<std::chrono::milliseconds>(nowTime - startTime).count();
if (logFile == stderr)
fprintf(logFile, "\x1B[%dm", loggerColor[level]);
fprintf(logFile, "[%.03f %s %s:%d] ", duration / 1000.0, loggerText[level], file, line);
if (logFile == stderr)
fprintf(logFile, "\x1B[0m");
vfprintf(logFile, format, args);
fprintf(logFile, "\n");
fflush(logFile);
}
void loggerLog(LoggerLevel level, const char *file, int line, const char *format, ...) {
va_list args;
va_start(args, format);
loggerLogVa(level, file, line, format, args);
va_end(args);
}
/** Deprecated. Included for ABI compatibility */
#undef debug
#undef info
#undef warn
#undef fatal
void debug(const char *format, ...) {
va_list args;
va_start(args, format);
loggerLogVa(DEBUG_LEVEL, "", 0, format, args);
va_end(args);
}
void info(const char *format, ...) {
va_list args;
va_start(args, format);
loggerLogVa(INFO_LEVEL, "", 0, format, args);
va_end(args);
}
void warn(const char *format, ...) {
va_list args;
va_start(args, format);
loggerLogVa(WARN_LEVEL, "", 0, format, args);
va_end(args);
}
void fatal(const char *format, ...) {
va_list args;
va_start(args, format);
loggerLogVa(FATAL_LEVEL, "", 0, format, args);
va_end(args);
}
} // namespace rack
| 20.722772 | 106 | 0.679408 | neuromancer85 |
4f0952950e4f169a4926327a6061edbe93969fce | 788 | cpp | C++ | 142. Linked List Cycle II.cpp | corn1ng/LeetCode-Solution | e7b6f77dd407c9a5cc8be43dc9b0e5d9bc185b95 | [
"Apache-2.0"
] | 6 | 2017-11-18T02:16:35.000Z | 2017-12-17T06:30:40.000Z | 142. Linked List Cycle II.cpp | corn1ng/LeetCode-Solution | e7b6f77dd407c9a5cc8be43dc9b0e5d9bc185b95 | [
"Apache-2.0"
] | null | null | null | 142. Linked List Cycle II.cpp | corn1ng/LeetCode-Solution | e7b6f77dd407c9a5cc8be43dc9b0e5d9bc185b95 | [
"Apache-2.0"
] | null | null | null | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *detectCycle(ListNode *head) {
if (head == NULL || head->next == NULL)
{
return NULL;
}
ListNode* slow =head;
ListNode* fast =head;
while(fast!=NULL&& fast->next!=NULL)
{
fast =fast->next->next;
slow =slow->next;
if(fast==slow)
{
while(head!=slow)
{
head=head->next;
slow=slow->next;
}
return head;
}
}
return NULL;
}
};
| 21.297297 | 48 | 0.404822 | corn1ng |
4f0b8e3e0b239f3021682ecde241ec91de0c91ef | 455 | cpp | C++ | src/iGPS/iGPSMain.cpp | mandad/moos-ivp-manda | 6bc81d14aba7c537b7932d6135eed7a5b39c3c52 | [
"MIT"
] | 9 | 2016-02-25T03:25:53.000Z | 2022-03-27T09:47:50.000Z | src/iGPS/iGPSMain.cpp | mandad/moos-ivp-manda | 6bc81d14aba7c537b7932d6135eed7a5b39c3c52 | [
"MIT"
] | null | null | null | src/iGPS/iGPSMain.cpp | mandad/moos-ivp-manda | 6bc81d14aba7c537b7932d6135eed7a5b39c3c52 | [
"MIT"
] | 4 | 2016-06-02T17:42:42.000Z | 2021-12-15T09:37:55.000Z | // $Header: /raid/cvs-server/REPOSITORY/software/MOOS/interface/general/iGPS/iGPSMain.cpp,v 5.1 2005/04/27 20:41:40 anrp Exp $
// copyright (2001-2003) Massachusetts Institute of Technology (pnewman et al.)
#include "GPSInstrument.h"
int main(int argc , char * argv[])
{
const char * sMissionFile = "Mission.moos";
if (argc > 1) {
sMissionFile = argv[1];
}
CGPSInstrument GPSInstrument;
GPSInstrument.Run("iGPS", sMissionFile);
return 0;
}
| 21.666667 | 126 | 0.70989 | mandad |
4f0dae6b71009e00599150edd26cf7a2a8e17a7d | 1,168 | cc | C++ | src/preload/child/spawn_strategy/chroot_fake.cc | TheEvilSkeleton/zypak | 51c8771bc6bb1f68e41663e01c487b414481c57e | [
"BSD-3-Clause"
] | 49 | 2019-11-25T02:29:23.000Z | 2022-03-31T05:28:18.000Z | src/preload/child/spawn_strategy/chroot_fake.cc | TheEvilSkeleton/zypak | 51c8771bc6bb1f68e41663e01c487b414481c57e | [
"BSD-3-Clause"
] | 21 | 2020-03-12T02:33:24.000Z | 2022-03-30T14:00:16.000Z | src/preload/child/spawn_strategy/chroot_fake.cc | TheEvilSkeleton/zypak | 51c8771bc6bb1f68e41663e01c487b414481c57e | [
"BSD-3-Clause"
] | 5 | 2020-09-27T11:53:53.000Z | 2022-03-23T19:20:07.000Z | // Copyright 2020 Endless Mobile, Inc.
// Portions copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Pretend that /proc/self/exe isn't accessible due to sandboxing.
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "base/base.h"
#include "preload/declare_override.h"
namespace {
constexpr std::string_view kSandboxTestPath = "/proc/self/exe";
} // namespace
// The syscall *must* be used directly, as TCMalloc calls open very early on and therefore many
// memory allocations will cause it to crash.
DECLARE_OVERRIDE_THROW(int, open64, const char* path, int flags, ...) {
int mode = 0;
// Load the mode if needed.
if (__OPEN_NEEDS_MODE(flags)) {
va_list va;
va_start(va, flags);
mode = va_arg(va, int);
va_end(va);
}
if (path == kSandboxTestPath) {
errno = ENOENT;
return -1;
}
// On x64 systems, off64_t and off_t are the same at the ABI level, so O_LARGEFILE
// isn't needed.
return syscall(__NR_openat, AT_FDCWD, path, flags, mode);
}
| 25.955556 | 95 | 0.699486 | TheEvilSkeleton |
4f10b650fd613a328f5facda87217c80389a95d8 | 54,793 | cpp | C++ | TelemetrySourcerer/TelemetrySourcerer.cpp | fcccode/TelemetrySourcerer | d90068aed05fb444b20de59c9935ba43f4daf0dc | [
"Apache-2.0"
] | 1 | 2021-06-15T16:51:21.000Z | 2021-06-15T16:51:21.000Z | TelemetrySourcerer/TelemetrySourcerer.cpp | W00t3k/TelemetrySourcerer | 3c29c86f49eab9f7bd630b1b0741bdf6f9189b68 | [
"Apache-2.0"
] | null | null | null | TelemetrySourcerer/TelemetrySourcerer.cpp | W00t3k/TelemetrySourcerer | 3c29c86f49eab9f7bd630b1b0741bdf6f9189b68 | [
"Apache-2.0"
] | 1 | 2020-10-23T04:04:16.000Z | 2020-10-23T04:04:16.000Z | #include <Windows.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>
#include <commctrl.h>
#include <windowsx.h>
#include <strsafe.h>
#include <TlHelp32.h>
#include <string>
#include "TelemetrySourcerer.h"
#include "KmCallbacks.h"
#include "UmHooks.h"
#include "UmETW.h"
using namespace std;
// Global variables
HINSTANCE g_hInst;
struct WINDOW_HANDLES {
HWND Main;
HWND StatusBar;
HWND TabControl;
// Kernel-mode Callbacks
HWND KmcPage;
HWND KmcRefreshButton;
HWND KmcSuppressButton;
HWND KmcRevertButton;
HWND KmcCountLabel;
HWND KmcTipLabel;
HWND KmcListView;
// User-mode Hooks
HWND UmhPage;
HWND UmhRefreshButton;
HWND UmhRestoreButton;
HWND UmhLoadButton;
HWND UmhCountLabel;
HWND UmhTipLabel;
HWND UmhListView;
// User-mode ETW Traces
HWND UmePage;
HWND UmeRefreshButton;
HWND UmeDisableButton;
HWND UmeStopButton;
HWND UmeCountLabel;
HWND UmeTipLabel;
HWND UmeListView;
// About
HWND AbtPage;
HWND AbtLabel;
} wh;
struct WINDOW_DATA {
std::vector<PCALLBACK_ENTRY> KmcCallbacks;
std::vector<PLOADED_MODULE> UmhModules;
std::vector<PTRACING_SESSION> UmeSessions;
} wd;
// Function: WinMain
// Description: Entry point for the application.
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
// The main window class name.
static TCHAR szWindowClass[] = _T("DesktopApp");
// The string that appears in the application's title bar.
WCHAR szTitle[MAX_PATH] = { 0 };
StringCbPrintfW(szTitle, MAX_PATH, L"%s v%s by @Jackson_T (%s %s)", TOOL_NAME, VERSION, _T(__DATE__), _T(__TIME__));
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = MainWndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, IDI_APPLICATION);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wcex.lpszMenuName = NULL;
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, IDI_APPLICATION);
RegisterClassEx(&wcex);
// Store instance handle in our global variable.
g_hInst = hInstance;
// Create the main window and show it.
wh.Main = CreateWindowEx(
NULL,
szWindowClass,
szTitle,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
900, 500,
NULL,
NULL,
hInstance,
NULL
);
ShowWindow(wh.Main, nCmdShow);
UpdateWindow(wh.Main);
// Main message loop:
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (int)msg.wParam;
}
// Function: MainWndProc
// Description: Processes messages for the main window.
LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
LPMINMAXINFO lpMMI = (LPMINMAXINFO)lParam;
switch (message)
{
case WM_CREATE:
{
PaintWindow(hWnd);
KmcLoadResults();
UmhLoadResults();
UmeLoadResults();
ShowWindow(wh.KmcPage, SW_SHOW);
break;
}
case WM_DESTROY:
{
PostQuitMessage(0);
break;
}
case WM_GETMINMAXINFO:
{
lpMMI->ptMinTrackSize.x = 900; // Set minimum dimensions to 900x500.
lpMMI->ptMinTrackSize.y = 500;
lpMMI->ptMaxTrackSize.x = 900; // Set maximum dimensions to 900x500.
lpMMI->ptMaxTrackSize.y = 500;
break;
}
case WM_SIZE:
{
ResizeWindow(hWnd);
break;
}
case WM_NOTIFY:
{
switch (((LPNMHDR)lParam)->code)
{
case TCN_SELCHANGE:
{
DWORD TabIndex = TabCtrl_GetCurSel(wh.TabControl);
ShowWindow(wh.KmcPage, (TabIndex == 0) ? SW_SHOW : SW_HIDE);
ShowWindow(wh.UmhPage, (TabIndex == 1) ? SW_SHOW : SW_HIDE);
ShowWindow(wh.UmePage, (TabIndex == 2) ? SW_SHOW : SW_HIDE);
ShowWindow(wh.AbtPage, (TabIndex == 3) ? SW_SHOW : SW_HIDE);
break;
}
}
break;
}
case WM_CLOSE:
UnloadDriver();
default:
return DefWindowProc(hWnd, message, wParam, lParam);
break;
}
return 0;
}
// Function: KmcWndProc
// Description: Processes messages for the kernel-mode callbacks tab.
LRESULT CALLBACK KmcWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_COMMAND:
{
switch (HIWORD(wParam))
{
case BN_CLICKED:
{
if (wh.KmcRefreshButton == (HWND)lParam)
KmcLoadResults();
else if (wh.KmcSuppressButton == (HWND)lParam)
KmcSuppressCallback();
else if (wh.KmcRevertButton == (HWND)lParam)
KmcRevertCallback();
break;
}
}
break;
}
case WM_NOTIFY:
{
NMLVDISPINFO* plvdi;
switch (((LPNMHDR)lParam)->code)
{
case LVN_GETDISPINFO:
{
plvdi = (NMLVDISPINFO*)lParam;
PCALLBACK_ENTRY Callback = wd.KmcCallbacks.at(plvdi->item.lParam);
LPWSTR Module = (LPWSTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MAX_PATH);
StringCbPrintfW(Module, MAX_PATH, L"%ls + 0x%x", Callback->ModuleName, Callback->ModuleOffset);
switch (plvdi->item.iSubItem)
{
case 0:
{
switch (Callback->Type)
{
case CALLBACK_TYPE::PsLoadImage:
plvdi->item.pszText = (LPWSTR)L"Image Load";
break;
case CALLBACK_TYPE::PsProcessCreation:
plvdi->item.pszText = (LPWSTR)L"Process Creation";
break;
case CALLBACK_TYPE::PsThreadCreation:
plvdi->item.pszText = (LPWSTR)L"Thread Creation";
break;
case CALLBACK_TYPE::CmRegistry:
plvdi->item.pszText = (LPWSTR)L"Registry";
break;
case CALLBACK_TYPE::ObProcessHandlePre:
case CALLBACK_TYPE::ObProcessHandlePost:
case CALLBACK_TYPE::ObThreadHandlePre:
case CALLBACK_TYPE::ObThreadHandlePost:
case CALLBACK_TYPE::ObDesktopHandlePre:
case CALLBACK_TYPE::ObDesktopHandlePost:
plvdi->item.pszText = (LPWSTR)L"Object Handle";
break;
case CALLBACK_TYPE::MfCreatePre:
case CALLBACK_TYPE::MfCreatePost:
case CALLBACK_TYPE::MfCreateNamedPipePre:
case CALLBACK_TYPE::MfCreateNamedPipePost:
case CALLBACK_TYPE::MfClosePre:
case CALLBACK_TYPE::MfClosePost:
case CALLBACK_TYPE::MfReadPre:
case CALLBACK_TYPE::MfReadPost:
case CALLBACK_TYPE::MfWritePre:
case CALLBACK_TYPE::MfWritePost:
case CALLBACK_TYPE::MfQueryInformationPre:
case CALLBACK_TYPE::MfQueryInformationPost:
case CALLBACK_TYPE::MfSetInformationPre:
case CALLBACK_TYPE::MfSetInformationPost:
case CALLBACK_TYPE::MfQueryEaPre:
case CALLBACK_TYPE::MfQueryEaPost:
case CALLBACK_TYPE::MfSetEaPre:
case CALLBACK_TYPE::MfSetEaPost:
case CALLBACK_TYPE::MfFlushBuffersPre:
case CALLBACK_TYPE::MfFlushBuffersPost:
case CALLBACK_TYPE::MfQueryVolumeInformationPre:
case CALLBACK_TYPE::MfQueryVolumeInformationPost:
case CALLBACK_TYPE::MfSetVolumeInformationPre:
case CALLBACK_TYPE::MfSetVolumeInformationPost:
case CALLBACK_TYPE::MfDirectoryControlPre:
case CALLBACK_TYPE::MfDirectoryControlPost:
case CALLBACK_TYPE::MfFileSystemControlPre:
case CALLBACK_TYPE::MfFileSystemControlPost:
case CALLBACK_TYPE::MfDeviceControlPre:
case CALLBACK_TYPE::MfDeviceControlPost:
case CALLBACK_TYPE::MfInternalDeviceControlPre:
case CALLBACK_TYPE::MfInternalDeviceControlPost:
case CALLBACK_TYPE::MfShutdownPre:
case CALLBACK_TYPE::MfShutdownPost:
case CALLBACK_TYPE::MfLockControlPre:
case CALLBACK_TYPE::MfLockControlPost:
case CALLBACK_TYPE::MfCleanupPre:
case CALLBACK_TYPE::MfCleanupPost:
case CALLBACK_TYPE::MfCreateMailslotPre:
case CALLBACK_TYPE::MfCreateMailslotPost:
case CALLBACK_TYPE::MfQuerySecurityPre:
case CALLBACK_TYPE::MfQuerySecurityPost:
case CALLBACK_TYPE::MfSetSecurityPre:
case CALLBACK_TYPE::MfSetSecurityPost:
case CALLBACK_TYPE::MfPowerPre:
case CALLBACK_TYPE::MfPowerPost:
case CALLBACK_TYPE::MfSystemControlPre:
case CALLBACK_TYPE::MfSystemControlPost:
case CALLBACK_TYPE::MfDeviceChangePre:
case CALLBACK_TYPE::MfDeviceChangePost:
case CALLBACK_TYPE::MfQueryQuotaPre:
case CALLBACK_TYPE::MfQueryQuotaPost:
case CALLBACK_TYPE::MfSetQuotaPre:
case CALLBACK_TYPE::MfSetQuotaPost:
case CALLBACK_TYPE::MfPnpPre:
case CALLBACK_TYPE::MfPnpPost:
plvdi->item.pszText = (LPWSTR)L"File System";
break;
default:
plvdi->item.pszText = (LPWSTR)L"Unknown";
break;
}
break;
}
case 1:
{
switch (Callback->Type)
{
case CALLBACK_TYPE::PsLoadImage:
plvdi->item.pszText = (LPWSTR)L"PsSetLoadImageNotifyRoutine";
break;
case CALLBACK_TYPE::PsProcessCreation:
plvdi->item.pszText = (LPWSTR)L"PsSetCreateProcessNotifyRoutine";
break;
case CALLBACK_TYPE::PsThreadCreation:
plvdi->item.pszText = (LPWSTR)L"PsSetCreateThreadNotifyRoutine";
break;
case CALLBACK_TYPE::CmRegistry:
plvdi->item.pszText = (LPWSTR)L"CmRegisterCallbackEx";
break;
case CALLBACK_TYPE::ObProcessHandlePre:
plvdi->item.pszText = (LPWSTR)L"PsProcessType (pre)";
break;
case CALLBACK_TYPE::ObProcessHandlePost:
plvdi->item.pszText = (LPWSTR)L"PsProcessType (post)";
break;
case CALLBACK_TYPE::ObThreadHandlePre:
plvdi->item.pszText = (LPWSTR)L"PsThreadType (pre)";
break;
case CALLBACK_TYPE::ObThreadHandlePost:
plvdi->item.pszText = (LPWSTR)L"PsThreadType (post)";
break;
case CALLBACK_TYPE::ObDesktopHandlePre:
plvdi->item.pszText = (LPWSTR)L"ExDesktopObjectType (pre)";
break;
case CALLBACK_TYPE::ObDesktopHandlePost:
plvdi->item.pszText = (LPWSTR)L"ExDesktopObjectType (post)";
break;
case CALLBACK_TYPE::MfCreatePre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_CREATE (pre)";
break;
case CALLBACK_TYPE::MfCreatePost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_CREATE (post)";
break;
case CALLBACK_TYPE::MfCreateNamedPipePre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_CREATE_NAMED_PIPE (pre)";
break;
case CALLBACK_TYPE::MfCreateNamedPipePost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_CREATE_NAMED_PIPE (post)";
break;
case CALLBACK_TYPE::MfClosePre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_CLOSE (pre)";
break;
case CALLBACK_TYPE::MfClosePost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_CLOSE (post)";
break;
case CALLBACK_TYPE::MfReadPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_READ (pre)";
break;
case CALLBACK_TYPE::MfReadPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_READ (post)";
break;
case CALLBACK_TYPE::MfWritePre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_WRITE (pre)";
break;
case CALLBACK_TYPE::MfWritePost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_WRITE (post)";
break;
case CALLBACK_TYPE::MfQueryInformationPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_QUERY_INFORMATION (pre)";
break;
case CALLBACK_TYPE::MfQueryInformationPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_QUERY_INFORMATION (post)";
break;
case CALLBACK_TYPE::MfSetInformationPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_SET_INFORMATION (pre)";
break;
case CALLBACK_TYPE::MfSetInformationPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_SET_INFORMATION (post)";
break;
case CALLBACK_TYPE::MfQueryEaPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_QUERY_EA (pre)";
break;
case CALLBACK_TYPE::MfQueryEaPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_QUERY_EA (post)";
break;
case CALLBACK_TYPE::MfSetEaPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_SET_EA (pre)";
break;
case CALLBACK_TYPE::MfSetEaPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_SET_EA (post)";
break;
case CALLBACK_TYPE::MfFlushBuffersPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_FLUSH_BUFFERS (pre)";
break;
case CALLBACK_TYPE::MfFlushBuffersPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_FLUSH_BUFFERS (post)";
break;
case CALLBACK_TYPE::MfQueryVolumeInformationPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_QUERY_VOLUME_INFORMATION (pre)";
break;
case CALLBACK_TYPE::MfQueryVolumeInformationPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_QUERY_VOLUME_INFORMATION (post)";
break;
case CALLBACK_TYPE::MfSetVolumeInformationPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_SET_VOLUME_INFORMATION (pre)";
break;
case CALLBACK_TYPE::MfSetVolumeInformationPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_SET_VOLUME_INFORMATION (post)";
break;
case CALLBACK_TYPE::MfDirectoryControlPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_DIRECTORY_CONTROL (pre)";
break;
case CALLBACK_TYPE::MfDirectoryControlPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_DIRECTORY_CONTROL (post)";
break;
case CALLBACK_TYPE::MfFileSystemControlPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_FILE_SYSTEM_CONTROL (pre)";
break;
case CALLBACK_TYPE::MfFileSystemControlPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_FILE_SYSTEM_CONTROL (post)";
break;
case CALLBACK_TYPE::MfDeviceControlPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_DEVICE_CONTROL (pre)";
break;
case CALLBACK_TYPE::MfDeviceControlPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_DEVICE_CONTROL (post)";
break;
case CALLBACK_TYPE::MfInternalDeviceControlPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_INTERNAL_DEVICE_CONTROL (pre)";
break;
case CALLBACK_TYPE::MfInternalDeviceControlPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_INTERNAL_DEVICE_CONTROL (post)";
break;
case CALLBACK_TYPE::MfShutdownPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_SHUTDOWN (pre)";
break;
case CALLBACK_TYPE::MfShutdownPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_SHUTDOWN (post)";
break;
case CALLBACK_TYPE::MfLockControlPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_LOCK_CONTROL (pre)";
break;
case CALLBACK_TYPE::MfLockControlPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_LOCK_CONTROL (post)";
break;
case CALLBACK_TYPE::MfCleanupPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_CLEANUP (pre)";
break;
case CALLBACK_TYPE::MfCleanupPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_CLEANUP (post)";
break;
case CALLBACK_TYPE::MfCreateMailslotPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_CREATE_MAILSLOT (pre)";
break;
case CALLBACK_TYPE::MfCreateMailslotPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_CREATE_MAILSLOT (post)";
break;
case CALLBACK_TYPE::MfQuerySecurityPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_QUERY_SECURITY (pre)";
break;
case CALLBACK_TYPE::MfQuerySecurityPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_QUERY_SECURITY (post)";
break;
case CALLBACK_TYPE::MfSetSecurityPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_SET_SECURITY (pre)";
break;
case CALLBACK_TYPE::MfSetSecurityPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_SET_SECURITY (post)";
break;
case CALLBACK_TYPE::MfPowerPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_POWER (pre)";
break;
case CALLBACK_TYPE::MfPowerPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_POWER (post)";
break;
case CALLBACK_TYPE::MfSystemControlPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_SYSTEM_CONTROL (pre)";
break;
case CALLBACK_TYPE::MfSystemControlPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_SYSTEM_CONTROL (post)";
break;
case CALLBACK_TYPE::MfDeviceChangePre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_DEVICE_CHANGE (pre)";
break;
case CALLBACK_TYPE::MfDeviceChangePost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_DEVICE_CHANGE (post)";
break;
case CALLBACK_TYPE::MfQueryQuotaPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_QUERY_QUOTA (pre)";
break;
case CALLBACK_TYPE::MfQueryQuotaPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_QUERY_QUOTA (post)";
break;
case CALLBACK_TYPE::MfSetQuotaPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_SET_QUOTA (pre)";
break;
case CALLBACK_TYPE::MfSetQuotaPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_SET_QUOTA (post)";
break;
case CALLBACK_TYPE::MfPnpPre:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_PNP (pre)";
break;
case CALLBACK_TYPE::MfPnpPost:
plvdi->item.pszText = (LPWSTR)L"IRP_MJ_PNP (post)";
break;
default:
plvdi->item.pszText = (LPWSTR)L"Unknown";
break;
}
break;
}
case 2:
{
plvdi->item.pszText = Module;
break;
}
case 3:
{
plvdi->item.pszText = (Callback->Suppressed) ? (LPWSTR)L"Yes" : (LPWSTR)L"No";
break;
}
default:
plvdi->item.pszText = (LPWSTR)L"N/A";
break;
}
}
case NM_CUSTOMDRAW:
{
LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)lParam;
BOOL IsNotable = FALSE;
BOOL IsSuppressed = FALSE;
ULONG CallbackIndex = lplvcd->nmcd.lItemlParam;
if (wd.KmcCallbacks.size())
{
PCALLBACK_ENTRY Callback = wd.KmcCallbacks.at(CallbackIndex);
if (Callback->Notable)
IsNotable = TRUE;
if (Callback->Suppressed)
IsSuppressed = TRUE;
}
switch (lplvcd->nmcd.dwDrawStage)
{
case CDDS_PREPAINT:
return CDRF_NOTIFYITEMDRAW;
case CDDS_ITEMPREPAINT:
{
if (IsSuppressed)
{
lplvcd->clrText = RGB(255, 255, 255);
lplvcd->clrTextBk = RGB(128, 128, 128);
}
else if (IsNotable)
{
lplvcd->clrText = RGB(0, 0, 0);
lplvcd->clrTextBk = RGB(255, 255, 200);
}
else
{
lplvcd->clrText = RGB(0, 0, 0);
lplvcd->clrTextBk = RGB(255, 255, 255);
}
return CDRF_NEWFONT;
}
case CDDS_SUBITEM | CDDS_ITEMPREPAINT:
return CDRF_NEWFONT;
}
break;
}
}
break;
}
default:
return DefWindowProc(hWnd, message, wParam, lParam);
break;
}
return 0;
}
// Function: UmhWndProc
// Description: Processes messages for the user-mode hooks tab.
LRESULT CALLBACK UmhWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_COMMAND:
{
switch (HIWORD(wParam))
{
case BN_CLICKED:
{
if (wh.UmhRefreshButton == (HWND)lParam)
UmhLoadResults();
else if (wh.UmhRestoreButton == (HWND)lParam)
UmhRestoreFunction();
else if (wh.UmhLoadButton == (HWND)lParam)
UmhLoadDll();
break;
}
}
break;
}
case WM_NOTIFY:
{
NMLVDISPINFO* plvdi;
switch (((LPNMHDR)lParam)->code)
{
case LVN_GETDISPINFO:
{
plvdi = (NMLVDISPINFO*)lParam;
int ModuleIndex = HIWORD(plvdi->item.lParam);
int FunctionIndex = LOWORD(plvdi->item.lParam);
PLOADED_MODULE lm = wd.UmhModules.at(ModuleIndex);
PHOOKED_FUNCTION hf = lm->HookedFunctions.at(FunctionIndex);
LPWSTR Ordinal = (LPWSTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MAX_PATH);
StringCbPrintfW(Ordinal, MAX_PATH, L"%d", hf->Ordinal);
LPWSTR Address = (LPWSTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MAX_PATH);
StringCbPrintfW(Address, MAX_PATH, L"0x%p", (ULONG64)hf->Address);
switch (plvdi->item.iSubItem)
{
case 0:
plvdi->item.pszText = (LPWSTR)lm->Path;
break;
case 1:
plvdi->item.pszText = (LPWSTR)hf->Name;
break;
case 2:
plvdi->item.pszText = Ordinal;
break;
case 3:
plvdi->item.pszText = Address;
break;
default:
plvdi->item.pszText = (LPWSTR)L"N/A";
break;
}
}
}
break;
}
default:
return DefWindowProc(hWnd, message, wParam, lParam);
break;
}
return 0;
}
// Function: UmeWndProc
// Description: Processes messages for the ETW sessions tab.
LRESULT CALLBACK UmeWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_COMMAND:
{
switch (HIWORD(wParam))
{
case BN_CLICKED:
{
if (wh.UmeRefreshButton == (HWND)lParam)
UmeLoadResults();
else if (wh.UmeDisableButton == (HWND)lParam)
UmeDisableSelectedProvider();
else if (wh.UmeStopButton == (HWND)lParam)
UmeStopTracingSession();
break;
}
}
break;
}
case WM_NOTIFY:
{
NMLVDISPINFO* plvdi;
switch (((LPNMHDR)lParam)->code)
{
case LVN_GETDISPINFO:
{
plvdi = (NMLVDISPINFO*)lParam;
int SessionIndex = HIWORD(plvdi->item.lParam);
int ProviderIndex = LOWORD(plvdi->item.lParam);
PTRACING_SESSION ts = wd.UmeSessions.at(SessionIndex);
PTRACE_PROVIDER tp = ts->EnabledProviders.at(ProviderIndex);
switch (plvdi->item.iSubItem)
{
case 0:
plvdi->item.pszText = (LPWSTR)ts->InstanceName;
break;
case 1:
plvdi->item.pszText = (LPWSTR)tp->ProviderName;
break;
default:
plvdi->item.pszText = (LPWSTR)L"N/A";
break;
}
break;
}
case NM_CUSTOMDRAW:
{
LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)lParam;
BOOL IsNotable = FALSE;
int SessionIndex = HIWORD(lplvcd->nmcd.lItemlParam);
int ProviderIndex = LOWORD(lplvcd->nmcd.lItemlParam);
if (wd.UmeSessions.size())
{
PTRACING_SESSION ts = wd.UmeSessions.at(SessionIndex);
if (ts->Notable)
IsNotable = TRUE;
else if (ts->EnabledProviders.size())
IsNotable = ts->EnabledProviders.at(ProviderIndex)->Notable;
}
switch (lplvcd->nmcd.dwDrawStage)
{
case CDDS_PREPAINT:
return CDRF_NOTIFYITEMDRAW;
case CDDS_ITEMPREPAINT:
{
if (IsNotable)
{
lplvcd->clrText = RGB(0, 0, 0);
lplvcd->clrTextBk = RGB(255, 255, 200);
}
else
{
lplvcd->clrText = RGB(0, 0, 0);
lplvcd->clrTextBk = RGB(255, 255, 255);
}
return CDRF_NEWFONT;
}
case CDDS_SUBITEM | CDDS_ITEMPREPAINT:
return CDRF_NEWFONT;
}
break;
}
}
break;
}
default:
return DefWindowProc(hWnd, message, wParam, lParam);
break;
}
return 0;
}
// Function: PaintWindow
// Description: Paints the main window.
// Called from: MainWndProc
VOID PaintWindow(HWND hWnd)
{
// Get global instance.
g_hInst = (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE);
// Get bounding box for window.
RECT rcMain;
GetClientRect(hWnd, &rcMain);
// Set font to default GUI font.
LOGFONT lf;
GetObject(GetStockObject(DEFAULT_GUI_FONT), sizeof(LOGFONT), &lf);
HFONT hFont = CreateFont(
lf.lfHeight, lf.lfWidth,
lf.lfEscapement, lf.lfOrientation, lf.lfWeight,
lf.lfItalic, lf.lfUnderline, lf.lfStrikeOut,
lf.lfCharSet, lf.lfOutPrecision, lf.lfClipPrecision,
lf.lfQuality, lf.lfPitchAndFamily, lf.lfFaceName);
SendMessage(hWnd, WM_SETFONT, (WPARAM)hFont, TRUE);
// Begin painting.
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hWnd, &ps);
// Status bar.
wh.StatusBar = CreateWindowEx(
NULL, // no extended styles
STATUSCLASSNAME, // name of status bar class
(PCTSTR)NULL, // no text when first created
WS_CHILD | WS_VISIBLE, // creates a visible child window
0, 0, 0, 0, // ignores size and position
hWnd, // handle to parent window
(HMENU)0, // child window identifier
g_hInst, // handle to application instance
NULL); // no window creation data
SendMessage(wh.StatusBar, SB_SETTEXT, (WPARAM)0, (LPARAM)L"Ready");
// Tab control.
wh.TabControl = CreateWindowEx(
NULL, // Extended styles
WC_TABCONTROL, // Predefined class; Unicode assumed
L"", // Control text
WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE, // Styles
0, // X position
0, // Y position
rcMain.right, // Control width
rcMain.bottom - 22, // Control height
hWnd, // Parent window
NULL, // No menu.
g_hInst, // Global instance handle
NULL); // Pointer not needed
SendMessage(wh.TabControl, WM_SETFONT, (WPARAM)hFont, TRUE);
/**
* Kernel-mode Callbacks
*/
TCITEM tie;
tie.mask = TCIF_TEXT;
tie.pszText = (LPWSTR)L"Kernel-mode Callbacks";
TabCtrl_InsertItem(wh.TabControl, 0, &tie);
wh.KmcPage = CreateWindowEx(
NULL,
WC_STATIC,
L"",
WS_CHILD | WS_VISIBLE,
0,
25,
rcMain.right - 5,
rcMain.bottom - 55,
wh.TabControl,
NULL,
g_hInst,
NULL);
SetWindowLongPtr(wh.KmcPage, GWLP_WNDPROC, (LONG_PTR)KmcWndProc);
wh.KmcRefreshButton = CreateWindowEx(
NULL,
L"BUTTON",
L"Refresh Results",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
5,
5,
100,
30,
wh.KmcPage,
(HMENU)1,
g_hInst,
NULL);
SendMessage(wh.KmcRefreshButton, WM_SETFONT, (WPARAM)hFont, TRUE);
wh.KmcSuppressButton = CreateWindowEx(
NULL,
L"BUTTON",
L"Suppress Callback",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
110,
5,
100,
30,
wh.KmcPage,
NULL,
g_hInst,
NULL);
SendMessage(wh.KmcSuppressButton, WM_SETFONT, (WPARAM)hFont, TRUE);
wh.KmcRevertButton = CreateWindowEx(
NULL,
L"BUTTON",
L"Revert Callback",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
215,
5,
100,
30,
wh.KmcPage,
NULL,
g_hInst,
NULL);
SendMessage(wh.KmcRevertButton, WM_SETFONT, (WPARAM)hFont, TRUE);
wh.KmcCountLabel = CreateWindowEx(
NULL,
WC_STATIC,
L"Count: 0 callbacks.",
WS_CHILD | WS_VISIBLE,
320,
5,
350,
15,
wh.KmcPage,
NULL,
g_hInst,
NULL);
SendMessage(wh.KmcCountLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
wh.KmcTipLabel = CreateWindowEx(
NULL,
WC_STATIC,
L"Tip: No results? Run elevated to load the driver.",
WS_CHILD | WS_VISIBLE,
320,
20,
250,
15,
wh.KmcPage,
NULL,
g_hInst,
NULL);
SendMessage(wh.KmcTipLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
wh.KmcListView = CreateWindowEx(
NULL,
WC_LISTVIEW,
L"",
WS_CHILD | WS_VISIBLE | WS_BORDER | LVS_REPORT | LVS_SINGLESEL,
5,
40,
rcMain.right - 15,
rcMain.bottom - 100,
wh.KmcPage,
(HMENU)0,
g_hInst,
NULL);
ListView_SetExtendedListViewStyle(wh.KmcListView, LVS_EX_FULLROWSELECT);
LVCOLUMN lvc = { 0 };
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvc.iSubItem = 0;
lvc.pszText = (LPWSTR)L"Collection Type";
lvc.cx = 150;
ListView_InsertColumn(wh.KmcListView, 0, &lvc);
lvc.iSubItem = 1;
lvc.pszText = (LPWSTR)L"Callback Type";
lvc.cx = 300;
ListView_InsertColumn(wh.KmcListView, 1, &lvc);
lvc.iSubItem = 2;
lvc.pszText = (LPWSTR)L"Module";
lvc.cx = 250;
ListView_InsertColumn(wh.KmcListView, 2, &lvc);
lvc.iSubItem = 3;
lvc.pszText = (LPWSTR)L"Is Suppressed?";
lvc.cx = 100;
ListView_InsertColumn(wh.KmcListView, 3, &lvc);
/**
* User-mode Hooks
*/
tie.pszText = (LPWSTR)L"User-mode Hooks";
TabCtrl_InsertItem(wh.TabControl, 1, &tie);
wh.UmhPage = CreateWindowEx(
NULL,
WC_STATIC,
L"",
WS_CHILD | WS_VISIBLE,
0,
25,
rcMain.right - 5,
rcMain.bottom - 55,
wh.TabControl,
NULL,
g_hInst,
NULL);
SetWindowLongPtr(wh.UmhPage, GWLP_WNDPROC, (LONG_PTR)UmhWndProc);
wh.UmhRefreshButton = CreateWindowEx(
NULL,
L"BUTTON",
L"Refresh Results",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
5,
5,
100,
30,
wh.UmhPage,
NULL,
g_hInst,
NULL);
SendMessage(wh.UmhRefreshButton, WM_SETFONT, (WPARAM)hFont, TRUE);
wh.UmhRestoreButton = CreateWindowEx(
NULL,
L"BUTTON",
L"Restore Function",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
110,
5,
100,
30,
wh.UmhPage,
NULL,
g_hInst,
NULL);
SendMessage(wh.UmhRestoreButton, WM_SETFONT, (WPARAM)hFont, TRUE);
wh.UmhLoadButton = CreateWindowEx(
NULL,
L"BUTTON",
L"Load Testing DLL",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
215,
5,
100,
30,
wh.UmhPage,
NULL,
g_hInst,
NULL);
SendMessage(wh.UmhLoadButton, WM_SETFONT, (WPARAM)hFont, TRUE);
wh.UmhCountLabel = CreateWindowEx(
NULL,
WC_STATIC,
L"Count: 0 hooked functions.",
WS_CHILD | WS_VISIBLE,
320,
5,
350,
15,
wh.UmhPage,
NULL,
g_hInst,
NULL);
SendMessage(wh.UmhCountLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
wh.UmhTipLabel = CreateWindowEx(
NULL,
WC_STATIC,
L"Tip: Validate unhooking by loading a test DLL.",
WS_CHILD | WS_VISIBLE,
320,
20,
250,
15,
wh.UmhPage,
NULL,
g_hInst,
NULL);
SendMessage(wh.UmhTipLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
wh.UmhListView = CreateWindowEx(
NULL,
WC_LISTVIEW,
L"",
WS_CHILD | WS_VISIBLE | WS_BORDER | LVS_REPORT | LVS_SINGLESEL,
5,
40,
rcMain.right - 15,
rcMain.bottom - 100,
wh.UmhPage,
(HMENU)0,
g_hInst,
NULL);
ListView_SetExtendedListViewStyle(wh.UmhListView, LVS_EX_FULLROWSELECT);
lvc.iSubItem = 0;
lvc.pszText = (LPWSTR)L"Module";
lvc.cx = 250;
ListView_InsertColumn(wh.UmhListView, 0, &lvc);
lvc.iSubItem = 1;
lvc.pszText = (LPWSTR)L"Function Name";
lvc.cx = 300;
ListView_InsertColumn(wh.UmhListView, 1, &lvc);
lvc.iSubItem = 2;
lvc.pszText = (LPWSTR)L"Ordinal";
lvc.cx = 100;
ListView_InsertColumn(wh.UmhListView, 2, &lvc);
lvc.iSubItem = 3;
lvc.pszText = (LPWSTR)L"Virtual Address";
lvc.cx = 200;
ListView_InsertColumn(wh.UmhListView, 3, &lvc);
/**
* ETW Trace Sessions
*/
tie.pszText = (LPWSTR)L"ETW Trace Sessions";
TabCtrl_InsertItem(wh.TabControl, 2, &tie);
wh.UmePage = CreateWindowEx(
NULL,
WC_STATIC,
L"",
WS_CHILD | WS_VISIBLE,
0,
25,
rcMain.right - 5,
rcMain.bottom - 55,
wh.TabControl,
NULL,
g_hInst,
NULL);
SetWindowLongPtr(wh.UmePage, GWLP_WNDPROC, (LONG_PTR)UmeWndProc);
wh.UmeRefreshButton = CreateWindowEx(
NULL,
L"BUTTON",
L"Refresh Results",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
5,
5,
100,
30,
wh.UmePage,
NULL,
g_hInst,
NULL);
SendMessage(wh.UmeRefreshButton, WM_SETFONT, (WPARAM)hFont, TRUE);
wh.UmeDisableButton = CreateWindowEx(
NULL,
L"BUTTON",
L"Disable Provider",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
110,
5,
100,
30,
wh.UmePage,
NULL,
g_hInst,
NULL);
SendMessage(wh.UmeDisableButton, WM_SETFONT, (WPARAM)hFont, TRUE);
wh.UmeStopButton = CreateWindowEx(
NULL,
L"BUTTON",
L"Stop Session",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
215,
5,
100,
30,
wh.UmePage,
NULL,
g_hInst,
NULL);
SendMessage(wh.UmeStopButton, WM_SETFONT, (WPARAM)hFont, TRUE);
wh.UmeCountLabel = CreateWindowEx(
NULL,
WC_STATIC,
L"Count: 0 sessions.",
WS_CHILD | WS_VISIBLE,
320,
5,
350,
15,
wh.UmePage,
NULL,
g_hInst,
NULL);
SendMessage(wh.UmeCountLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
wh.UmeTipLabel = CreateWindowEx(
NULL,
WC_STATIC,
L"Tip: Missing results? Run as SYSTEM to view more sessions.",
WS_CHILD | WS_VISIBLE,
320,
20,
300,
15,
wh.UmePage,
NULL,
g_hInst,
NULL);
SendMessage(wh.UmeTipLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
wh.UmeListView = CreateWindowEx(
NULL,
WC_LISTVIEW,
L"",
WS_CHILD | WS_VISIBLE | WS_BORDER | LVS_REPORT | LVS_SINGLESEL,
5,
40,
rcMain.right - 15,
rcMain.bottom - 100,
wh.UmePage,
(HMENU)0,
g_hInst,
NULL);
ListView_SetExtendedListViewStyle(wh.UmeListView, LVS_EX_FULLROWSELECT);
lvc.iSubItem = 0;
lvc.pszText = (LPWSTR)L"Session";
lvc.cx = 300;
ListView_InsertColumn(wh.UmeListView, 0, &lvc);
lvc.iSubItem = 1;
lvc.pszText = (LPWSTR)L"Enabled Provider";
lvc.cx = 300;
ListView_InsertColumn(wh.UmeListView, 1, &lvc);
/**
* About Page
*/
tie.pszText = (LPWSTR)L"About";
TabCtrl_InsertItem(wh.TabControl, 3, &tie);
wh.AbtPage = CreateWindowEx(
NULL,
WC_STATIC,
L"",
WS_CHILD | WS_VISIBLE, // | WS_BORDER,
0,
25,
rcMain.right - 5,
rcMain.bottom - 55,
wh.TabControl,
NULL,
g_hInst,
NULL);
wh.AbtLabel = CreateWindowEx(
NULL,
WC_STATIC,
L"Telemetry Sourcerer is a utility that can be used to enumerate "
L"and disable common sources of events used by endpoint security "
L"products (AV/EDR).\n\n"
L"Developed by @Jackson_T (2020), leveraging code from @gentilkiwi, "
L"@fdiskyou, and @0x00dtm. Licenced under the Apache License v2.0.\n\n"
L"Use of this tool is intended for research purposes only and does "
L"not attempt to be OPSEC-safe.\n\n"
L"Code: github.com/jthuraisamy/TelemetrySourcerer\n"
L"Methodology: jackson-t.ca/edr-reversing-evading-01.html\n",
WS_CHILD | WS_VISIBLE | SS_CENTER,
5,
150,
rcMain.right - 10,
rcMain.bottom - 60,
wh.AbtPage,
NULL,
g_hInst,
NULL);
SendMessage(wh.AbtLabel, WM_SETFONT, (WPARAM)hFont, TRUE);
// END PAINTING
ShowWindow(wh.UmhPage, SW_HIDE);
ShowWindow(wh.UmePage, SW_HIDE);
ShowWindow(wh.AbtPage, SW_HIDE);
ShowWindow(wh.KmcPage, SW_HIDE);
EndPaint(hWnd, &ps);
}
// Function: ResizeWindow
// Description: Handles window resizes (currently not supported).
// Called from: MainWndProc
VOID ResizeWindow(HWND hWnd)
{
RECT rcClient;
GetClientRect(hWnd, &rcClient);
SetWindowPos(wh.TabControl, HWND_TOP, 0, 0, rcClient.right, rcClient.bottom - 22, SWP_SHOWWINDOW);
SetWindowPos(wh.KmcPage, HWND_TOP, 0, 25, rcClient.right - 5, rcClient.bottom - 40, SWP_SHOWWINDOW);
SetWindowPos(wh.StatusBar, NULL, 0, rcClient.bottom - 10, rcClient.right, 10, SWP_NOZORDER);
}
// Function: KmcLoadResults
// Description: Loads kernel-mode callback results.
// Called from: MainWndProc after painting, and KmcWndProc when clicking the refresh button.
VOID KmcLoadResults()
{
DWORD DriverStatus = LoadDriver();
switch (DriverStatus)
{
case ERROR_FILE_NOT_FOUND:
MessageBox(
NULL,
L"Could not find TelemetrySourcererDriver.sys.\n\n"
L"Please ensure it is in the same directory as the executable.",
TOOL_NAME,
MB_ICONERROR);
break;
case ERROR_INVALID_IMAGE_HASH:
MessageBox(
NULL,
L"The signature for the driver failed verification.\n\n"
L"To load kernel-mode callback results, either enable test signing, "
L"or sign this driver with a valid certificate.",
TOOL_NAME,
MB_ICONERROR);
break;
default:
break;
}
SendMessage(wh.StatusBar, SB_SETTEXT, (WPARAM)0, (LPARAM)L"Loading kernel-mode callbacks...");
// Delete rows and fetch latest results.
ListView_DeleteAllItems(wh.KmcListView);
wd.KmcCallbacks = GetCallbacks(wd.KmcCallbacks);
DWORD ListItemCount = 0;
for (int CallbackIndex = 0; CallbackIndex < wd.KmcCallbacks.size(); CallbackIndex++)
{
LVITEM lvi = { 0 };
lvi.pszText = LPSTR_TEXTCALLBACK; // Sends an LVN_GETDISPINFO message.
lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_PARAM;
lvi.stateMask = 0;
lvi.iSubItem = 0;
lvi.state = 0;
lvi.iItem = ListItemCount++;
lvi.lParam = CallbackIndex;
ListView_InsertItem(wh.KmcListView, &lvi);
}
LPWSTR CountText = (LPWSTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MAX_PATH);
StringCbPrintfW(CountText, MAX_PATH, L"Count: %d callbacks.", wd.KmcCallbacks.size());
Static_SetText(wh.KmcCountLabel, CountText);
SendMessage(wh.StatusBar, SB_SETTEXT, (WPARAM)0, (LPARAM)L"Ready");
}
// Function: KmcSuppressCallback
// Description: Suppresses the selected callback (if eligible).
// Called from: KmcWndProc when clicking the suppress button.
VOID KmcSuppressCallback()
{
int SelectedIndex = ListView_GetNextItem(wh.KmcListView, -1, LVNI_SELECTED);
if (SelectedIndex != -1)
{
LVITEM lvi = { 0 };
lvi.mask = LVIF_PARAM;
lvi.iItem = SelectedIndex;
lvi.iSubItem = 0;
ListView_GetItem(wh.KmcListView, &lvi);
PCALLBACK_ENTRY Callback = wd.KmcCallbacks.at(lvi.lParam);
WCHAR MessageTitle[MAX_PATH] = { 0 };
StringCbPrintfW(MessageTitle, MAX_PATH, L"%ls + 0x%x", Callback->ModuleName, Callback->ModuleOffset);
if (SuppressCallback(Callback))
{
Callback->Suppressed = TRUE;
MessageBox(NULL, L"Successfully suppressed callback!", MessageTitle, MB_OK | MB_ICONINFORMATION);
KmcLoadResults();
ListView_EnsureVisible(wh.KmcListView, SelectedIndex, FALSE);
}
else
{
MessageBox(NULL, L"Callback could not be suppressed for unspecified reason.", MessageTitle, MB_OK | MB_ICONERROR);
}
}
}
// Function: KmcRevertCallback
// Description: Reverts the selected callback (if suppressed/eligible).
// Called from: KmcWndProc when clicking the revert button.
VOID KmcRevertCallback()
{
int SelectedIndex = ListView_GetNextItem(wh.KmcListView, -1, LVNI_SELECTED);
if (SelectedIndex != -1)
{
LVITEM lvi = { 0 };
lvi.mask = LVIF_PARAM;
lvi.iItem = SelectedIndex;
lvi.iSubItem = 0;
ListView_GetItem(wh.KmcListView, &lvi);
PCALLBACK_ENTRY Callback = wd.KmcCallbacks.at(lvi.lParam);
WCHAR MessageTitle[MAX_PATH] = { 0 };
StringCbPrintfW(MessageTitle, MAX_PATH, L"%ls + 0x%x", &Callback->ModuleName, Callback->ModuleOffset);
if (Callback->Suppressed)
{
if (Callback->OriginalQword == GetSuppressionValue(Callback->Type))
{
MessageBox(NULL, L"The callback could not be reverted because the function's original first bytes are unknown.", MessageTitle, MB_OK | MB_ICONERROR);
}
else if (RevertCallback(Callback))
{
Callback->Suppressed = FALSE;
MessageBox(NULL, L"Successfully reverted callback!", MessageTitle, MB_OK | MB_ICONINFORMATION);
KmcLoadResults();
ListView_EnsureVisible(wh.KmcListView, SelectedIndex, FALSE);
}
else
{
MessageBox(NULL, L"Callback could not be reverted for unspecified reason.", MessageTitle, MB_OK | MB_ICONERROR);
}
}
else
{
MessageBox(NULL, L"The selected callback is currently not suppressed.", MessageTitle, MB_OK | MB_ICONERROR);
}
}
}
// Function: UmhLoadResults
// Description: Loads user-mode inline hook results.
// Called from: MainWndProc after painting, and UmhWndProc when clicking the refresh button.
VOID UmhLoadResults()
{
SendMessage(wh.StatusBar, SB_SETTEXT, (WPARAM)0, (LPARAM)L"Loading user-mode hooks...");
// Delete rows and fetch latest results.
ListView_DeleteAllItems(wh.UmhListView);
wd.UmhModules = CheckAllModulesForHooks();
DWORD ListItemCount = 0;
for (int ModuleIndex = 0; ModuleIndex < wd.UmhModules.size(); ModuleIndex++)
{
PLOADED_MODULE lm = wd.UmhModules.at(ModuleIndex);
for (int FunctionIndex = 0; FunctionIndex < lm->HookedFunctions.size(); FunctionIndex++)
{
LVITEM lvi = { 0 };
lvi.pszText = LPSTR_TEXTCALLBACK; // Sends an LVN_GETDISPINFO message.
lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_PARAM;
lvi.stateMask = 0;
lvi.iSubItem = 0;
lvi.state = 0;
lvi.iItem = ListItemCount++;
lvi.lParam = (ModuleIndex << 16) | FunctionIndex;
ListView_InsertItem(wh.UmhListView, &lvi);
}
}
LPWSTR CountText = (LPWSTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MAX_PATH);
StringCbPrintfW(CountText, MAX_PATH, L"Count: %d hooked functions.", ListItemCount);
Static_SetText(wh.UmhCountLabel, CountText);
SendMessage(wh.StatusBar, SB_SETTEXT, (WPARAM)0, (LPARAM)L"Ready");
}
// Function: UmhRestoreFunction
// Description: Unhooks the selected function.
// Called from: UmhWndProc when clicking the restore button.
VOID UmhRestoreFunction()
{
int SelectedIndex = ListView_GetNextItem(wh.UmhListView, -1, LVNI_SELECTED);
if (SelectedIndex != -1)
{
LVITEM lvi = { 0 };
lvi.mask = LVIF_PARAM;
lvi.iItem = SelectedIndex;
lvi.iSubItem = 0;
ListView_GetItem(wh.UmhListView, &lvi);
int ModuleIndex = HIWORD(lvi.lParam);
int FunctionIndex = LOWORD(lvi.lParam);
PLOADED_MODULE Module = wd.UmhModules.at(ModuleIndex);
PHOOKED_FUNCTION Function = Module->HookedFunctions.at(FunctionIndex);
WCHAR MessageTitle[MAX_PATH] = { 0 };
StringCbPrintfW(MessageTitle, MAX_PATH, L"%ls: %ls", Module->Path, Function->Name);
if (RestoreHookedFunction(Function))
MessageBox(NULL, L"Successfully unhooked function!", MessageTitle, MB_OK | MB_ICONINFORMATION);
else
MessageBox(NULL, L"Function could not be unhooked for unspecified reason.", MessageTitle, MB_OK | MB_ICONERROR);
UmhLoadResults();
ListView_EnsureVisible(wh.UmhListView, SelectedIndex, FALSE);
}
}
// Function: UmhLoadDll
// Description: Loads a testing DLL to validate unhooking efficacy.
// Called from: UmhWndProc when clicking the load DLL button.
VOID UmhLoadDll()
{
SendMessage(wh.StatusBar, SB_SETTEXT, (WPARAM)0, (LPARAM)L"Loading test DLL...");
WCHAR DllPath[MAX_PATH] = { 0 };
OPENFILENAMEW OpenFileName = { 0 };
OpenFileName.lStructSize = sizeof(OpenFileName);
OpenFileName.hwndOwner = wh.Main;
OpenFileName.lpstrFilter = L"DLL Files (*.dll)\0*.DLL\0";
OpenFileName.lpstrFile = DllPath;
OpenFileName.nMaxFile = MAX_PATH;
GetOpenFileNameW(&OpenFileName);
LoadLibraryW(DllPath); // ToDo validation.
SendMessage(wh.StatusBar, SB_SETTEXT, (WPARAM)0, (LPARAM)L"Ready");
}
// Function: UmeLoadResults
// Description: Load ETW trace session results.
// Called from: MainWndProc after painting, and UmeWndProc when clicking the refresh button.
VOID UmeLoadResults()
{
SendMessage(wh.StatusBar, SB_SETTEXT, (WPARAM)0, (LPARAM)L"Loading ETW sessions...");
// Delete rows and fetch latest results.
ListView_DeleteAllItems(wh.UmeListView);
wd.UmeSessions = GetSessions();
DWORD ListItemCount = 0;
for (int SessionIndex = 0; SessionIndex < wd.UmeSessions.size(); SessionIndex++)
{
PTRACING_SESSION ts = wd.UmeSessions.at(SessionIndex);
for (int ProviderIndex = 0; ProviderIndex < ts->EnabledProviders.size(); ProviderIndex++)
{
LVITEM lvi = { 0 };
lvi.pszText = LPSTR_TEXTCALLBACK; // Sends an LVN_GETDISPINFO message.
lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_PARAM;
lvi.stateMask = 0;
lvi.iSubItem = 0;
lvi.state = 0;
lvi.iItem = ListItemCount++;
lvi.lParam = ((ULONG)SessionIndex << 16) | ProviderIndex;
ListView_InsertItem(wh.UmeListView, &lvi);
}
}
LPWSTR CountText = (LPWSTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MAX_PATH);
StringCbPrintfW(CountText, MAX_PATH, L"Count: %d sessions.", wd.UmeSessions.size());
Static_SetText(wh.UmeCountLabel, CountText);
SendMessage(wh.StatusBar, SB_SETTEXT, (WPARAM)0, (LPARAM)L"Ready");
}
// Function: UmeDisableSelectedProvider
// Description: Disables the selected provider for the session (if eligible).
// Called from: UmeWndProc when clicking the disable provider button.
VOID UmeDisableSelectedProvider()
{
int SelectedIndex = ListView_GetNextItem(wh.UmeListView, -1, LVNI_SELECTED);
if (SelectedIndex != -1)
{
LVITEM lvi = { 0 };
lvi.mask = LVIF_PARAM;
lvi.iItem = SelectedIndex;
lvi.iSubItem = 0;
ListView_GetItem(wh.UmeListView, &lvi);
int SessionIndex = HIWORD(lvi.lParam);
int ProviderIndex = LOWORD(lvi.lParam);
PTRACING_SESSION Session = wd.UmeSessions.at(SessionIndex);
PTRACE_PROVIDER Provider = Session->EnabledProviders.at(ProviderIndex);
WCHAR MessageTitle[MAX_PATH] = { 0 };
StringCbPrintfW(MessageTitle, MAX_PATH, L"%ls: %ls", Session->InstanceName, Provider->ProviderName);
DWORD Status = DisableProvider(Session->LoggerId, &Provider->ProviderId);
switch (Status)
{
case ERROR_SUCCESS:
MessageBox(NULL, L"Successfully disabled provider!", MessageTitle, MB_OK | MB_ICONINFORMATION);
break;
case ERROR_ACCESS_DENIED:
MessageBox(NULL, L"Denied. Administrative privileges required.", MessageTitle, MB_OK | MB_ICONERROR);
break;
default:
MessageBox(NULL, L"Provider could not be disabled for unspecified reason.", MessageTitle, MB_OK | MB_ICONERROR);
break;
}
UmeLoadResults();
ListView_EnsureVisible(wh.UmeListView, SelectedIndex, FALSE);
}
}
// Function: UmeDisableSelectedProvider
// Description: Stops the selected session (if eligible).
// Called from: UmeWndProc when clicking the stop session button.
VOID UmeStopTracingSession()
{
int SelectedIndex = ListView_GetNextItem(wh.UmeListView, -1, LVNI_SELECTED);
if (SelectedIndex != -1)
{
LVITEM lvi = { 0 };
lvi.mask = LVIF_PARAM;
lvi.iItem = SelectedIndex;
lvi.iSubItem = 0;
ListView_GetItem(wh.UmeListView, &lvi);
int SessionIndex = HIWORD(lvi.lParam);
int ProviderIndex = LOWORD(lvi.lParam);
PTRACING_SESSION Session = wd.UmeSessions.at(SessionIndex);
PTRACE_PROVIDER Provider = Session->EnabledProviders.at(ProviderIndex);
DWORD Status = StopTracingSession(Session->LoggerId);
switch (Status)
{
case ERROR_SUCCESS:
MessageBox(NULL, L"Successfully stopped tracing session!", Session->InstanceName, MB_OK | MB_ICONINFORMATION);
break;
case ERROR_ACCESS_DENIED:
MessageBox(NULL, L"Denied. Administrative privileges required.", Session->InstanceName, MB_OK | MB_ICONERROR);
break;
default:
MessageBox(NULL, L"Session could not be stopped for unspecified reason.", Session->InstanceName, MB_OK | MB_ICONERROR);
break;
}
UmeLoadResults();
ListView_EnsureVisible(wh.UmeListView, SelectedIndex, FALSE);
}
} | 33.82284 | 165 | 0.56447 | fcccode |
4f12a2671100892beca4832941ba211623aca4ab | 1,538 | hpp | C++ | include/network/Client.hpp | raccoman/ft_irc | c510c70feeb193a7da6de995478bf75d25014f6e | [
"MIT"
] | 2 | 2022-03-03T22:28:13.000Z | 2022-03-09T10:17:16.000Z | include/network/Client.hpp | raccoman/ft_irc | c510c70feeb193a7da6de995478bf75d25014f6e | [
"MIT"
] | null | null | null | include/network/Client.hpp | raccoman/ft_irc | c510c70feeb193a7da6de995478bf75d25014f6e | [
"MIT"
] | null | null | null | #ifndef FT_IRC_CLIENT_HPP
# define FT_IRC_CLIENT_HPP
enum ClientState {
HANDSHAKE,
LOGIN,
PLAY,
DISCONNECTED
};
class Client;
#include <vector>
#include <string>
#include <sys/poll.h>
#include <sys/socket.h>
#include "utils.hpp"
#include "Channel.hpp"
class Client {
typedef std::vector<pollfd>::iterator pollfds_iterator;
private:
int _fd;
std::string _hostname;
int _port;
std::string _nickname;
std::string _username;
std::string _realname;
ClientState _state;
Channel *_channel;
public:
Client(int fd, const std::string &hostname, int port);
~Client();
int getFD() const { return _fd; };
std::string getHostname() const { return _hostname; };
int getPort() const { return _port; };
bool isRegistered() const { return _state == ::PLAY; };
std::string getNickname() const { return _nickname; };
std::string getUsername() const { return _username; };
std::string getRealName() const { return _realname; };
std::string getPrefix() const;
Channel *getChannel() const { return _channel; };
void setNickname(const std::string &nickname) { _nickname = nickname; };
void setUsername(const std::string &username) { _username = username; };
void setRealName(const std::string &realname) { _realname = realname; };
void setState(ClientState state) { _state = state; };
void setChannel(Channel *channel) { _channel = channel; };
void write(const std::string &message) const;
void reply(const std::string &reply);
void welcome();
void join(Channel *channel);
void leave();
};
#endif
| 18.756098 | 73 | 0.704811 | raccoman |
4f17469cfa992c7baf9e80d81660f488403846d1 | 33,733 | cpp | C++ | src/r_utility.cpp | protocultor/gzdoom | ec2c69e76abbd1eb48f2b7c5b1c0c1e22867f47c | [
"RSA-MD"
] | 1 | 2020-09-22T22:34:00.000Z | 2020-09-22T22:34:00.000Z | src/r_utility.cpp | protocultor/gzdoom | ec2c69e76abbd1eb48f2b7c5b1c0c1e22867f47c | [
"RSA-MD"
] | null | null | null | src/r_utility.cpp | protocultor/gzdoom | ec2c69e76abbd1eb48f2b7c5b1c0c1e22867f47c | [
"RSA-MD"
] | null | null | null | //-----------------------------------------------------------------------------
//
// Copyright 1993-1996 id Software
// Copyright 1994-1996 Raven Software
// Copyright 1999-2016 Randy Heit
// Copyright 2002-2016 Christoph Oelckers
//
// 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/
//
//-----------------------------------------------------------------------------
//
// DESCRIPTION:
// Rendering main loop and setup functions,
// utility functions (BSP, geometry, trigonometry).
// See tables.c, too.
//
//-----------------------------------------------------------------------------
// HEADER FILES ------------------------------------------------------------
#include <stdlib.h>
#include <math.h>
#include "templates.h"
#include "doomdef.h"
#include "d_net.h"
#include "doomstat.h"
#include "m_random.h"
#include "m_bbox.h"
#include "r_sky.h"
#include "st_stuff.h"
#include "c_dispatch.h"
#include "v_video.h"
#include "stats.h"
#include "i_video.h"
#include "a_sharedglobal.h"
#include "p_3dmidtex.h"
#include "r_data/r_interpolate.h"
#include "po_man.h"
#include "p_effect.h"
#include "st_start.h"
#include "v_font.h"
#include "r_renderer.h"
#include "serializer.h"
#include "r_utility.h"
#include "d_player.h"
#include "p_local.h"
#include "g_levellocals.h"
#include "p_maputl.h"
#include "sbar.h"
#include "vm.h"
#include "i_time.h"
#include "actorinlines.h"
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
extern bool DrawFSHUD; // [RH] Defined in d_main.cpp
EXTERN_CVAR (Bool, cl_capfps)
// TYPES -------------------------------------------------------------------
struct InterpolationViewer
{
struct instance
{
DVector3 Pos;
DRotator Angles;
};
AActor *ViewActor;
int otic;
instance Old, New;
};
// PRIVATE DATA DECLARATIONS -----------------------------------------------
static TArray<InterpolationViewer> PastViewers;
static FRandom pr_torchflicker ("TorchFlicker");
static FRandom pr_hom;
bool NoInterpolateView; // GL needs access to this.
static TArray<DVector3a> InterpolationPath;
// PUBLIC DATA DEFINITIONS -------------------------------------------------
CVAR (Bool, r_deathcamera, false, CVAR_ARCHIVE)
CVAR (Int, r_clearbuffer, 0, 0)
CVAR (Bool, r_drawvoxels, true, 0)
CVAR (Bool, r_drawplayersprites, true, 0) // [RH] Draw player sprites?
CUSTOM_CVAR(Float, r_quakeintensity, 1.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{
if (self < 0.f) self = 0.f;
else if (self > 1.f) self = 1.f;
}
int viewwindowx;
int viewwindowy;
int viewwidth;
int viewheight;
FRenderViewpoint::FRenderViewpoint()
{
player = nullptr;
Pos = { 0.0, 0.0, 0.0 };
ActorPos = { 0.0, 0.0, 0.0 };
Angles = { 0.0, 0.0, 0.0 };
Path[0] = { 0.0, 0.0, 0.0 };
Path[1] = { 0.0, 0.0, 0.0 };
Cos = 0.0;
Sin = 0.0;
TanCos = 0.0;
TanSin = 0.0;
camera = nullptr;
sector = nullptr;
FieldOfView = 90.; // Angles in the SCREENWIDTH wide window
TicFrac = 0.0;
FrameTime = 0;
extralight = 0;
showviewer = false;
}
FRenderViewpoint r_viewpoint;
FViewWindow r_viewwindow;
bool r_NoInterpolate;
angle_t LocalViewAngle;
int LocalViewPitch;
bool LocalKeyboardTurner;
int setblocks;
bool setsizeneeded;
unsigned int R_OldBlend = ~0;
int validcount = 1; // increment every time a check is made
FCanvasTextureInfo *FCanvasTextureInfo::List;
DVector3a view;
DAngle viewpitch;
DEFINE_GLOBAL(LocalViewPitch);
// CODE --------------------------------------------------------------------
//==========================================================================
//
// R_SetFOV
//
// Changes the field of view in degrees
//
//==========================================================================
void R_SetFOV (FRenderViewpoint &viewpoint, DAngle fov)
{
if (fov < 5.) fov = 5.;
else if (fov > 170.) fov = 170.;
if (fov != viewpoint.FieldOfView)
{
viewpoint.FieldOfView = fov;
setsizeneeded = true;
}
}
//==========================================================================
//
// R_SetViewSize
//
// Do not really change anything here, because it might be in the middle
// of a refresh. The change will take effect next refresh.
//
//==========================================================================
void R_SetViewSize (int blocks)
{
setsizeneeded = true;
setblocks = blocks;
}
//==========================================================================
//
// R_SetWindow
//
//==========================================================================
void R_SetWindow (FRenderViewpoint &viewpoint, FViewWindow &viewwindow, int windowSize, int fullWidth, int fullHeight, int stHeight, bool renderingToCanvas)
{
if (windowSize >= 11)
{
viewwidth = fullWidth;
freelookviewheight = viewheight = fullHeight;
}
else if (windowSize == 10)
{
viewwidth = fullWidth;
viewheight = stHeight;
freelookviewheight = fullHeight;
}
else
{
viewwidth = ((setblocks*fullWidth)/10) & (~15);
viewheight = ((setblocks*stHeight)/10)&~7;
freelookviewheight = ((setblocks*fullHeight)/10)&~7;
}
if (renderingToCanvas)
{
viewwindow.WidescreenRatio = fullWidth / (float)fullHeight;
}
else
{
viewwindow.WidescreenRatio = ActiveRatio(fullWidth, fullHeight);
DrawFSHUD = (windowSize == 11);
}
// [RH] Sky height fix for screens not 200 (or 240) pixels tall
R_InitSkyMap ();
viewwindow.centery = viewheight/2;
viewwindow.centerx = viewwidth/2;
if (AspectTallerThanWide(viewwindow.WidescreenRatio))
{
viewwindow.centerxwide = viewwindow.centerx;
}
else
{
viewwindow.centerxwide = viewwindow.centerx * AspectMultiplier(viewwindow.WidescreenRatio) / 48;
}
DAngle fov = viewpoint.FieldOfView;
// For widescreen displays, increase the FOV so that the middle part of the
// screen that would be visible on a 4:3 display has the requested FOV.
if (viewwindow.centerxwide != viewwindow.centerx)
{ // centerxwide is what centerx would be if the display was not widescreen
fov = DAngle::ToDegrees(2 * atan(viewwindow.centerx * tan(fov.Radians()/2) / double(viewwindow.centerxwide)));
if (fov > 170.) fov = 170.;
}
viewwindow.FocalTangent = tan(fov.Radians() / 2);
}
//==========================================================================
//
// R_ExecuteSetViewSize
//
//==========================================================================
void R_ExecuteSetViewSize (FRenderViewpoint &viewpoint, FViewWindow &viewwindow)
{
setsizeneeded = false;
V_SetBorderNeedRefresh();
R_SetWindow (viewpoint, viewwindow, setblocks, SCREENWIDTH, SCREENHEIGHT, StatusBar->GetTopOfStatusbar());
// Handle resize, e.g. smaller view windows with border and/or status bar.
viewwindowx = (screen->GetWidth() - viewwidth) >> 1;
// Same with base row offset.
viewwindowy = (viewwidth == screen->GetWidth()) ? 0 : (StatusBar->GetTopOfStatusbar() - viewheight) >> 1;
}
//==========================================================================
//
// r_visibility
//
// Controls how quickly light ramps across a 1/z range.
//
//==========================================================================
double R_ClampVisibility(double vis)
{
// Allow negative visibilities, just for novelty's sake
return clamp(vis, -204.7, 204.7); // (205 and larger do not work in 5:4 aspect ratio)
}
CUSTOM_CVAR(Float, r_visibility, 8.0f, CVAR_NOINITCALL)
{
if (netgame && self != 8.0f)
{
Printf("Visibility cannot be changed in net games.\n");
self = 8.0f;
}
else
{
float clampValue = (float)R_ClampVisibility(self);
if (self != clampValue)
self = clampValue;
}
}
//==========================================================================
//
// R_GetGlobVis
//
// Calculates the global visibility constant used by the software renderer
//
//==========================================================================
double R_GetGlobVis(const FViewWindow &viewwindow, double vis)
{
vis = R_ClampVisibility(vis);
double virtwidth = screen->GetWidth();
double virtheight = screen->GetHeight();
if (AspectTallerThanWide(viewwindow.WidescreenRatio))
{
virtheight = (virtheight * AspectMultiplier(viewwindow.WidescreenRatio)) / 48;
}
else
{
virtwidth = (virtwidth * AspectMultiplier(viewwindow.WidescreenRatio)) / 48;
}
double YaspectMul = 320.0 * virtheight / (200.0 * virtwidth);
double InvZtoScale = YaspectMul * viewwindow.centerx;
double wallVisibility = vis;
// Prevent overflow on walls
double maxVisForWall = (InvZtoScale * (screen->GetWidth() * r_Yaspect) / (viewwidth * screen->GetHeight() * viewwindow.FocalTangent));
maxVisForWall = 32767.0 / maxVisForWall;
if (vis < 0 && vis < -maxVisForWall)
wallVisibility = -maxVisForWall;
else if (vis > 0 && vis > maxVisForWall)
wallVisibility = maxVisForWall;
wallVisibility = InvZtoScale * screen->GetWidth() * AspectBaseHeight(viewwindow.WidescreenRatio) / (viewwidth * screen->GetHeight() * 3) * (wallVisibility * viewwindow.FocalTangent);
return wallVisibility / viewwindow.FocalTangent;
}
//==========================================================================
//
// CVAR screenblocks
//
// Selects the size of the visible window
//
//==========================================================================
CUSTOM_CVAR (Int, screenblocks, 10, CVAR_ARCHIVE)
{
if (self > 12)
self = 12;
else if (self < 3)
self = 3;
else
R_SetViewSize (self);
}
//==========================================================================
//
// R_PointInSubsector
//
//==========================================================================
subsector_t *R_PointInSubsector (fixed_t x, fixed_t y)
{
node_t *node;
int side;
// single subsector is a special case
if (level.nodes.Size() == 0)
return &level.subsectors[0];
node = level.HeadNode();
do
{
side = R_PointOnSide (x, y, node);
node = (node_t *)node->children[side];
}
while (!((size_t)node & 1));
return (subsector_t *)((uint8_t *)node - 1);
}
//==========================================================================
//
// R_Init
//
//==========================================================================
void R_Init ()
{
StartScreen->Progress();
// Colormap init moved back to InitPalette()
//R_InitColormaps ();
//StartScreen->Progress();
R_InitTranslationTables ();
R_SetViewSize (screenblocks);
Renderer->Init();
}
//==========================================================================
//
// R_Shutdown
//
//==========================================================================
void R_Shutdown ()
{
FCanvasTextureInfo::EmptyList();
}
//==========================================================================
//
// R_InterpolateView
//
//==========================================================================
//CVAR (Int, tf, 0, 0)
EXTERN_CVAR (Bool, cl_noprediction)
void R_InterpolateView (FRenderViewpoint &viewpoint, player_t *player, double Frac, InterpolationViewer *iview)
{
if (NoInterpolateView)
{
InterpolationPath.Clear();
NoInterpolateView = false;
iview->Old = iview->New;
}
int oldgroup = R_PointInSubsector(iview->Old.Pos)->sector->PortalGroup;
int newgroup = R_PointInSubsector(iview->New.Pos)->sector->PortalGroup;
DAngle oviewangle = iview->Old.Angles.Yaw;
DAngle nviewangle = iview->New.Angles.Yaw;
if (!cl_capfps)
{
if ((iview->Old.Pos.X != iview->New.Pos.X || iview->Old.Pos.Y != iview->New.Pos.Y) && InterpolationPath.Size() > 0)
{
DVector3 view = iview->New.Pos;
// Interpolating through line portals is a messy affair.
// What needs be done is to store the portal transitions of the camera actor as waypoints
// and then find out on which part of the path the current view lies.
// Needless to say, this doesn't work for chasecam mode.
if (!viewpoint.showviewer)
{
double pathlen = 0;
double zdiff = 0;
double totalzdiff = 0;
DAngle adiff = 0.;
DAngle totaladiff = 0.;
double oviewz = iview->Old.Pos.Z;
double nviewz = iview->New.Pos.Z;
DVector3a oldpos = { { iview->Old.Pos.X, iview->Old.Pos.Y, 0 }, 0. };
DVector3a newpos = { { iview->New.Pos.X, iview->New.Pos.Y, 0 }, 0. };
InterpolationPath.Push(newpos); // add this to the array to simplify the loops below
for (unsigned i = 0; i < InterpolationPath.Size(); i += 2)
{
DVector3a &start = i == 0 ? oldpos : InterpolationPath[i - 1];
DVector3a &end = InterpolationPath[i];
pathlen += (end.pos - start.pos).Length();
totalzdiff += start.pos.Z;
totaladiff += start.angle;
}
double interpolatedlen = Frac * pathlen;
for (unsigned i = 0; i < InterpolationPath.Size(); i += 2)
{
DVector3a &start = i == 0 ? oldpos : InterpolationPath[i - 1];
DVector3a &end = InterpolationPath[i];
double fraglen = (end.pos - start.pos).Length();
zdiff += start.pos.Z;
adiff += start.angle;
if (fraglen <= interpolatedlen)
{
interpolatedlen -= fraglen;
}
else
{
double fragfrac = interpolatedlen / fraglen;
oviewz += zdiff;
nviewz -= totalzdiff - zdiff;
oviewangle += adiff;
nviewangle -= totaladiff - adiff;
DVector2 viewpos = start.pos + (fragfrac * (end.pos - start.pos));
viewpoint.Pos = { viewpos, oviewz + Frac * (nviewz - oviewz) };
break;
}
}
InterpolationPath.Pop();
viewpoint.Path[0] = iview->Old.Pos;
viewpoint.Path[1] = viewpoint.Path[0] + (InterpolationPath[0].pos - viewpoint.Path[0]).XY().MakeResize(pathlen);
}
}
else
{
DVector2 disp = Displacements.getOffset(oldgroup, newgroup);
viewpoint.Pos = iview->Old.Pos + (iview->New.Pos - iview->Old.Pos - disp) * Frac;
viewpoint.Path[0] = viewpoint.Path[1] = iview->New.Pos;
}
}
else
{
viewpoint.Pos = iview->New.Pos;
viewpoint.Path[0] = viewpoint.Path[1] = iview->New.Pos;
}
if (player != NULL &&
!(player->cheats & CF_INTERPVIEW) &&
player - players == consoleplayer &&
viewpoint.camera == player->mo &&
!demoplayback &&
iview->New.Pos.X == viewpoint.camera->X() &&
iview->New.Pos.Y == viewpoint.camera->Y() &&
!(player->cheats & (CF_TOTALLYFROZEN|CF_FROZEN)) &&
player->playerstate == PST_LIVE &&
player->mo->reactiontime == 0 &&
!NoInterpolateView &&
!paused &&
(!netgame || !cl_noprediction) &&
!LocalKeyboardTurner)
{
viewpoint.Angles.Yaw = (nviewangle + AngleToFloat(LocalViewAngle & 0xFFFF0000)).Normalized180();
DAngle delta = player->centering ? DAngle(0.) : AngleToFloat(int(LocalViewPitch & 0xFFFF0000));
viewpoint.Angles.Pitch = clamp<DAngle>((iview->New.Angles.Pitch - delta).Normalized180(), player->MinPitch, player->MaxPitch);
viewpoint.Angles.Roll = iview->New.Angles.Roll.Normalized180();
}
else
{
viewpoint.Angles.Pitch = (iview->Old.Angles.Pitch + deltaangle(iview->Old.Angles.Pitch, iview->New.Angles.Pitch) * Frac).Normalized180();
viewpoint.Angles.Yaw = (oviewangle + deltaangle(oviewangle, nviewangle) * Frac).Normalized180();
viewpoint.Angles.Roll = (iview->Old.Angles.Roll + deltaangle(iview->Old.Angles.Roll, iview->New.Angles.Roll) * Frac).Normalized180();
}
// Due to interpolation this is not necessarily the same as the sector the camera is in.
viewpoint.sector = R_PointInSubsector(viewpoint.Pos)->sector;
bool moved = false;
while (!viewpoint.sector->PortalBlocksMovement(sector_t::ceiling))
{
if (viewpoint.Pos.Z > viewpoint.sector->GetPortalPlaneZ(sector_t::ceiling))
{
viewpoint.Pos += viewpoint.sector->GetPortalDisplacement(sector_t::ceiling);
viewpoint.ActorPos += viewpoint.sector->GetPortalDisplacement(sector_t::ceiling);
viewpoint.sector = R_PointInSubsector(viewpoint.Pos)->sector;
moved = true;
}
else break;
}
if (!moved)
{
while (!viewpoint.sector->PortalBlocksMovement(sector_t::floor))
{
if (viewpoint.Pos.Z < viewpoint.sector->GetPortalPlaneZ(sector_t::floor))
{
viewpoint.Pos += viewpoint.sector->GetPortalDisplacement(sector_t::floor);
viewpoint.ActorPos += viewpoint.sector->GetPortalDisplacement(sector_t::floor);
viewpoint.sector = R_PointInSubsector(viewpoint.Pos)->sector;
moved = true;
}
else break;
}
}
}
//==========================================================================
//
// R_ResetViewInterpolation
//
//==========================================================================
void R_ResetViewInterpolation ()
{
InterpolationPath.Clear();
NoInterpolateView = true;
}
//==========================================================================
//
// R_SetViewAngle
//
//==========================================================================
void R_SetViewAngle (FRenderViewpoint &viewpoint, const FViewWindow &viewwindow)
{
viewpoint.Sin = viewpoint.Angles.Yaw.Sin();
viewpoint.Cos = viewpoint.Angles.Yaw.Cos();
viewpoint.TanSin = viewwindow.FocalTangent * viewpoint.Sin;
viewpoint.TanCos = viewwindow.FocalTangent * viewpoint.Cos;
}
//==========================================================================
//
// FindPastViewer
//
//==========================================================================
static InterpolationViewer *FindPastViewer (AActor *actor)
{
for (unsigned int i = 0; i < PastViewers.Size(); ++i)
{
if (PastViewers[i].ViewActor == actor)
{
return &PastViewers[i];
}
}
// Not found, so make a new one
InterpolationViewer iview;
memset(&iview, 0, sizeof(iview));
iview.ViewActor = actor;
iview.otic = -1;
InterpolationPath.Clear();
return &PastViewers[PastViewers.Push (iview)];
}
//==========================================================================
//
// R_FreePastViewers
//
//==========================================================================
void R_FreePastViewers ()
{
InterpolationPath.Clear();
PastViewers.Clear ();
}
//==========================================================================
//
// R_ClearPastViewer
//
// If the actor changed in a non-interpolatable way, remove it.
//
//==========================================================================
void R_ClearPastViewer (AActor *actor)
{
InterpolationPath.Clear();
for (unsigned int i = 0; i < PastViewers.Size(); ++i)
{
if (PastViewers[i].ViewActor == actor)
{
// Found it, so remove it.
if (i == PastViewers.Size())
{
PastViewers.Delete (i);
}
else
{
PastViewers.Pop (PastViewers[i]);
}
}
}
}
//==========================================================================
//
// R_RebuildViewInterpolation
//
//==========================================================================
void R_RebuildViewInterpolation(player_t *player)
{
if (player == NULL || player->camera == NULL)
return;
if (!NoInterpolateView)
return;
NoInterpolateView = false;
InterpolationViewer *iview = FindPastViewer(player->camera);
iview->Old = iview->New;
InterpolationPath.Clear();
}
//==========================================================================
//
// R_GetViewInterpolationStatus
//
//==========================================================================
bool R_GetViewInterpolationStatus()
{
return NoInterpolateView;
}
//==========================================================================
//
// R_ClearInterpolationPath
//
//==========================================================================
void R_ClearInterpolationPath()
{
InterpolationPath.Clear();
}
//==========================================================================
//
// R_AddInterpolationPoint
//
//==========================================================================
void R_AddInterpolationPoint(const DVector3a &vec)
{
InterpolationPath.Push(vec);
}
//==========================================================================
//
// QuakePower
//
//==========================================================================
static double QuakePower(double factor, double intensity, double offset)
{
double randumb;
if (intensity == 0)
{
randumb = 0;
}
else
{
randumb = pr_torchflicker.GenRand_Real2() * (intensity * 2) - intensity;
}
return factor * (offset + randumb);
}
//==========================================================================
//
// R_SetupFrame
//
//==========================================================================
void R_SetupFrame (FRenderViewpoint &viewpoint, FViewWindow &viewwindow, AActor *actor)
{
if (actor == NULL)
{
I_Error ("Tried to render from a NULL actor.");
}
player_t *player = actor->player;
unsigned int newblend;
InterpolationViewer *iview;
bool unlinked = false;
if (player != NULL && player->mo == actor)
{ // [RH] Use camera instead of viewplayer
viewpoint.camera = player->camera;
if (viewpoint.camera == NULL)
{
viewpoint.camera = player->camera = player->mo;
}
}
else
{
viewpoint.camera = actor;
}
if (viewpoint.camera == NULL)
{
I_Error ("You lost your body. Bad dehacked work is likely to blame.");
}
iview = FindPastViewer (viewpoint.camera);
int nowtic = I_GetTime ();
if (iview->otic != -1 && nowtic > iview->otic)
{
iview->otic = nowtic;
iview->Old = iview->New;
}
if (player != NULL && gamestate != GS_TITLELEVEL &&
((player->cheats & CF_CHASECAM) || (r_deathcamera && viewpoint.camera->health <= 0)))
{
sector_t *oldsector = R_PointInSubsector(iview->Old.Pos)->sector;
// [RH] Use chasecam view
DVector3 campos;
DAngle camangle;
P_AimCamera (viewpoint.camera, campos, camangle, viewpoint.sector, unlinked); // fixme: This needs to translate the angle, too.
iview->New.Pos = campos;
iview->New.Angles.Yaw = camangle;
viewpoint.showviewer = true;
// Interpolating this is a very complicated thing because nothing keeps track of the aim camera's movement, so whenever we detect a portal transition
// it's probably best to just reset the interpolation for this move.
// Note that this can still cause problems with unusually linked portals
if (viewpoint.sector->PortalGroup != oldsector->PortalGroup || (unlinked && ((iview->New.Pos.XY() - iview->Old.Pos.XY()).LengthSquared()) > 256*256))
{
iview->otic = nowtic;
iview->Old = iview->New;
r_NoInterpolate = true;
}
viewpoint.ActorPos = campos;
}
else
{
viewpoint.ActorPos = iview->New.Pos = { viewpoint.camera->Pos().XY(), viewpoint.camera->player ? viewpoint.camera->player->viewz : viewpoint.camera->Z() + viewpoint.camera->GetCameraHeight() };
viewpoint.sector = viewpoint.camera->Sector;
viewpoint.showviewer = false;
}
iview->New.Angles = viewpoint.camera->Angles;
if (viewpoint.camera->player != 0)
{
player = viewpoint.camera->player;
}
if (iview->otic == -1 || r_NoInterpolate)
{
R_ResetViewInterpolation ();
iview->otic = nowtic;
}
viewpoint.TicFrac = I_GetTimeFrac ();
if (cl_capfps || r_NoInterpolate)
{
viewpoint.TicFrac = 1.;
}
R_InterpolateView (viewpoint, player, viewpoint.TicFrac, iview);
R_SetViewAngle (viewpoint, viewwindow);
interpolator.DoInterpolations (viewpoint.TicFrac);
// Keep the view within the sector's floor and ceiling
if (viewpoint.sector->PortalBlocksMovement(sector_t::ceiling))
{
double theZ = viewpoint.sector->ceilingplane.ZatPoint(viewpoint.Pos) - 4;
if (viewpoint.Pos.Z > theZ)
{
viewpoint.Pos.Z = theZ;
}
}
if (viewpoint.sector->PortalBlocksMovement(sector_t::floor))
{
double theZ = viewpoint.sector->floorplane.ZatPoint(viewpoint.Pos) + 4;
if (viewpoint.Pos.Z < theZ)
{
viewpoint.Pos.Z = theZ;
}
}
if (!paused)
{
FQuakeJiggers jiggers;
memset(&jiggers, 0, sizeof(jiggers));
if (DEarthquake::StaticGetQuakeIntensities(viewpoint.TicFrac, viewpoint.camera, jiggers) > 0)
{
double quakefactor = r_quakeintensity;
DVector3 pos; pos.Zero();
if (jiggers.RollIntensity != 0 || jiggers.RollWave != 0)
{
viewpoint.Angles.Roll += QuakePower(quakefactor, jiggers.RollIntensity, jiggers.RollWave);
}
if (jiggers.RelIntensity.X != 0 || jiggers.RelOffset.X != 0)
{
pos.X += QuakePower(quakefactor, jiggers.RelIntensity.X, jiggers.RelOffset.X);
}
if (jiggers.RelIntensity.Y != 0 || jiggers.RelOffset.Y != 0)
{
pos.Y += QuakePower(quakefactor, jiggers.RelIntensity.Y, jiggers.RelOffset.Y);
}
if (jiggers.RelIntensity.Z != 0 || jiggers.RelOffset.Z != 0)
{
pos.Z += QuakePower(quakefactor, jiggers.RelIntensity.Z, jiggers.RelOffset.Z);
}
// [MC] Tremendous thanks to Marisa Kirisame for helping me with this.
// Use a rotation matrix to make the view relative.
if (!pos.isZero())
{
DAngle yaw = viewpoint.camera->Angles.Yaw;
DAngle pitch = viewpoint.camera->Angles.Pitch;
DAngle roll = viewpoint.camera->Angles.Roll;
DVector3 relx, rely, relz;
DMatrix3x3 rot =
DMatrix3x3(DVector3(0., 0., 1.), yaw.Cos(), yaw.Sin()) *
DMatrix3x3(DVector3(0., 1., 0.), pitch.Cos(), pitch.Sin()) *
DMatrix3x3(DVector3(1., 0., 0.), roll.Cos(), roll.Sin());
relx = DVector3(1., 0., 0.)*rot;
rely = DVector3(0., 1., 0.)*rot;
relz = DVector3(0., 0., 1.)*rot;
viewpoint.Pos += relx * pos.X + rely * pos.Y + relz * pos.Z;
}
if (jiggers.Intensity.X != 0 || jiggers.Offset.X != 0)
{
viewpoint.Pos.X += QuakePower(quakefactor, jiggers.Intensity.X, jiggers.Offset.X);
}
if (jiggers.Intensity.Y != 0 || jiggers.Offset.Y != 0)
{
viewpoint.Pos.Y += QuakePower(quakefactor, jiggers.Intensity.Y, jiggers.Offset.Y);
}
if (jiggers.Intensity.Z != 0 || jiggers.Offset.Z != 0)
{
viewpoint.Pos.Z += QuakePower(quakefactor, jiggers.Intensity.Z, jiggers.Offset.Z);
}
}
}
viewpoint.extralight = viewpoint.camera->player ? viewpoint.camera->player->extralight : 0;
// killough 3/20/98, 4/4/98: select colormap based on player status
// [RH] Can also select a blend
newblend = 0;
TArray<lightlist_t> &lightlist = viewpoint.sector->e->XFloor.lightlist;
if (lightlist.Size() > 0)
{
for(unsigned int i = 0; i < lightlist.Size(); i++)
{
secplane_t *plane;
int viewside;
plane = (i < lightlist.Size()-1) ? &lightlist[i+1].plane : &viewpoint.sector->floorplane;
viewside = plane->PointOnSide(viewpoint.Pos);
// Reverse the direction of the test if the plane was downward facing.
// We want to know if the view is above it, whatever its orientation may be.
if (plane->fC() < 0)
viewside = -viewside;
if (viewside > 0)
{
// 3d floor 'fog' is rendered as a blending value
PalEntry blendv = lightlist[i].blend;
// If no alpha is set, use 50%
if (blendv.a==0 && blendv!=0) blendv.a=128;
newblend = blendv.d;
break;
}
}
}
else
{
const sector_t *s = viewpoint.sector->GetHeightSec();
if (s != NULL)
{
newblend = s->floorplane.PointOnSide(viewpoint.Pos) < 0
? s->bottommap
: s->ceilingplane.PointOnSide(viewpoint.Pos) < 0
? s->topmap
: s->midmap;
if (APART(newblend) == 0 && newblend >= fakecmaps.Size())
newblend = 0;
}
}
// [RH] Don't override testblend unless entering a sector with a
// blend different from the previous sector's. Same goes with
// NormalLight's maps pointer.
if (R_OldBlend != newblend)
{
R_OldBlend = newblend;
if (APART(newblend))
{
BaseBlendR = RPART(newblend);
BaseBlendG = GPART(newblend);
BaseBlendB = BPART(newblend);
BaseBlendA = APART(newblend) / 255.f;
}
else
{
BaseBlendR = BaseBlendG = BaseBlendB = 0;
BaseBlendA = 0.f;
}
}
validcount++;
if (r_clearbuffer != 0)
{
int color;
int hom = r_clearbuffer;
if (hom == 3)
{
hom = ((screen->FrameTime / 128) & 1) + 1;
}
if (hom == 1)
{
color = GPalette.BlackIndex;
}
else if (hom == 2)
{
color = GPalette.WhiteIndex;
}
else if (hom == 4)
{
color = (screen->FrameTime / 32) & 255;
}
else
{
color = pr_hom();
}
Renderer->SetClearColor(color);
}
}
//==========================================================================
//
// FCanvasTextureInfo :: Add
//
// Assigns a camera to a canvas texture.
//
//==========================================================================
void FCanvasTextureInfo::Add (AActor *viewpoint, FTextureID picnum, double fov)
{
FCanvasTextureInfo *probe;
FCanvasTexture *texture;
if (!picnum.isValid())
{
return;
}
texture = static_cast<FCanvasTexture *>(TexMan[picnum]);
if (!texture->bHasCanvas)
{
Printf ("%s is not a valid target for a camera\n", texture->Name.GetChars());
return;
}
// Is this texture already assigned to a camera?
for (probe = List; probe != NULL; probe = probe->Next)
{
if (probe->Texture == texture)
{
// Yes, change its assignment to this new camera
if (probe->Viewpoint != viewpoint || probe->FOV != fov)
{
texture->bFirstUpdate = true;
}
probe->Viewpoint = viewpoint;
probe->FOV = fov;
return;
}
}
// No, create a new assignment
probe = new FCanvasTextureInfo;
probe->Viewpoint = viewpoint;
probe->Texture = texture;
probe->PicNum = picnum;
probe->FOV = fov;
probe->Next = List;
texture->bFirstUpdate = true;
List = probe;
}
// [ZZ] expose this to ZScript
void SetCameraToTexture(AActor *viewpoint, const FString &texturename, double fov)
{
FTextureID textureid = TexMan.CheckForTexture(texturename, ETextureType::Wall, FTextureManager::TEXMAN_Overridable);
if (textureid.isValid())
{
// Only proceed if the texture actually has a canvas.
FTexture *tex = TexMan[textureid];
if (tex && tex->bHasCanvas)
{
FCanvasTextureInfo::Add(viewpoint, textureid, fov);
}
}
}
DEFINE_ACTION_FUNCTION_NATIVE(_TexMan, SetCameraToTexture, SetCameraToTexture)
{
PARAM_PROLOGUE;
PARAM_OBJECT(viewpoint, AActor);
PARAM_STRING(texturename); // [ZZ] there is no point in having this as FTextureID because it's easier to refer to a cameratexture by name and it isn't executed too often to cache it.
PARAM_FLOAT(fov);
SetCameraToTexture(viewpoint, texturename, fov);
return 0;
}
//==========================================================================
//
// FCanvasTextureInfo :: UpdateAll
//
// Updates all canvas textures that were visible in the last frame.
//
//==========================================================================
void FCanvasTextureInfo::UpdateAll ()
{
FCanvasTextureInfo *probe;
for (probe = List; probe != NULL; probe = probe->Next)
{
if (probe->Viewpoint != NULL && probe->Texture->bNeedsUpdate)
{
Renderer->RenderTextureView(probe->Texture, probe->Viewpoint, probe->FOV);
}
}
}
//==========================================================================
//
// FCanvasTextureInfo :: EmptyList
//
// Removes all camera->texture assignments.
//
//==========================================================================
void FCanvasTextureInfo::EmptyList ()
{
FCanvasTextureInfo *probe, *next;
for (probe = List; probe != NULL; probe = next)
{
next = probe->Next;
probe->Texture->Unload();
delete probe;
}
List = NULL;
}
//==========================================================================
//
// FCanvasTextureInfo :: Serialize
//
// Reads or writes the current set of mappings in an archive.
//
//==========================================================================
void FCanvasTextureInfo::Serialize(FSerializer &arc)
{
if (arc.isWriting())
{
if (List != nullptr)
{
if (arc.BeginArray("canvastextures"))
{
FCanvasTextureInfo *probe;
for (probe = List; probe != nullptr; probe = probe->Next)
{
if (probe->Texture != nullptr && probe->Viewpoint != nullptr)
{
if (arc.BeginObject(nullptr))
{
arc("viewpoint", probe->Viewpoint)
("fov", probe->FOV)
("texture", probe->PicNum)
.EndObject();
}
}
}
arc.EndArray();
}
}
}
else
{
if (arc.BeginArray("canvastextures"))
{
AActor *viewpoint = nullptr;
double fov;
FTextureID picnum;
while (arc.BeginObject(nullptr))
{
arc("viewpoint", viewpoint)
("fov", fov)
("texture", picnum)
.EndObject();
Add(viewpoint, picnum, fov);
}
arc.EndArray();
}
}
}
//==========================================================================
//
// FCanvasTextureInfo :: Mark
//
// Marks all viewpoints in the list for the collector.
//
//==========================================================================
void FCanvasTextureInfo::Mark()
{
for (FCanvasTextureInfo *probe = List; probe != NULL; probe = probe->Next)
{
GC::Mark(probe->Viewpoint);
}
}
//==========================================================================
//
// CVAR transsouls
//
// How translucent things drawn with STYLE_SoulTrans are. Normally, only
// Lost Souls have this render style.
// Values less than 0.25 will automatically be set to
// 0.25 to ensure some degree of visibility. Likewise, values above 1.0 will
// be set to 1.0, because anything higher doesn't make sense.
//
//==========================================================================
CUSTOM_CVAR(Float, transsouls, 0.75f, CVAR_ARCHIVE)
{
if (self < 0.25f)
{
self = 0.25f;
}
else if (self > 1.f)
{
self = 1.f;
}
}
CUSTOM_CVAR(Float, maxviewpitch, 90.f, CVAR_ARCHIVE | CVAR_SERVERINFO)
{
if (self>90.f) self = 90.f;
else if (self<-90.f) self = -90.f;
if (usergame)
{
// [SP] Update pitch limits to the netgame/gamesim.
players[consoleplayer].SendPitchLimits();
}
}
| 27.358475 | 195 | 0.582041 | protocultor |
4f1c3eba82e7e3b0a78a6eb8bbf7a3ca78280a0e | 1,686 | cpp | C++ | src/knMotor/WheelGroupSample.cpp | hhutz/kn_wheel_group | 18ed3220bd46282ec9cbe38e8a573e6f2de49f05 | [
"NASA-1.3"
] | null | null | null | src/knMotor/WheelGroupSample.cpp | hhutz/kn_wheel_group | 18ed3220bd46282ec9cbe38e8a573e6f2de49f05 | [
"NASA-1.3"
] | null | null | null | src/knMotor/WheelGroupSample.cpp | hhutz/kn_wheel_group | 18ed3220bd46282ec9cbe38e8a573e6f2de49f05 | [
"NASA-1.3"
] | null | null | null | /* -*- C++ -*- *****************************************************************
* Copyright (c) 2013 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All rights reserved.
*
* Licensed under the NASA Open Source Agreement, Version 1.3 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://opensource.org/licenses/NASA-1.3
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************
*
* Project: RoverSw
* Module: knMotor
* Author: Hans Utz
*
*****************************************************************************/
#include "WheelGroupSample.h"
#include <iostream>
namespace kn
{
using namespace std;
std::ostream& operator<< (std::ostream& ostr, WheelGroupSample const& rhs)
{
ostr << "{"
<< static_cast<MotorGroupSample const&>(rhs) << ", " << endl
<< " " << rhs.curvature << ", "
<< rhs.curvatureRate << ", "
<< rhs.speed << ", "
<< rhs.crabAngle << ", " << endl
<< " " << rhs.targetCurvature << ", "
<< rhs.targetCurvatureRate << ", "
<< rhs.targetSpeed << ", "
<< rhs.targetCrabAngle << ", "
<< rhs.targetCrabRate
<< "}";
return ostr;
}
}
| 33.058824 | 80 | 0.541518 | hhutz |
b7b4cc2ceeaca61f766274be7fbc063959f1fd1f | 9,423 | cpp | C++ | src/plugins/opls/oplsatomtyper.cpp | quizzmaster/chemkit | 803e4688b514008c605cb5c7790f7b36e67b68fc | [
"BSD-3-Clause"
] | 34 | 2015-01-24T23:59:41.000Z | 2020-11-12T13:48:01.000Z | src/plugins/opls/oplsatomtyper.cpp | soplwang/chemkit | d62b7912f2d724a05fa8be757f383776fdd5bbcb | [
"BSD-3-Clause"
] | 4 | 2015-12-28T20:29:16.000Z | 2016-01-26T06:48:19.000Z | src/plugins/opls/oplsatomtyper.cpp | soplwang/chemkit | d62b7912f2d724a05fa8be757f383776fdd5bbcb | [
"BSD-3-Clause"
] | 17 | 2015-01-23T14:50:24.000Z | 2021-06-10T15:43:50.000Z | /******************************************************************************
**
** Copyright (C) 2009-2011 Kyle Lutz <[email protected]>
** All rights reserved.
**
** This file is a part of the chemkit project. For more information
** see <http://www.chemkit.org>.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
**
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** * Neither the name of the chemkit project nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
******************************************************************************/
#include "oplsatomtyper.h"
// --- Construction and Destruction ---------------------------------------- //
OplsAtomTyper::OplsAtomTyper(const chemkit::Molecule *molecule)
: chemkit::AtomTyper("opls")
{
setMolecule(molecule);
}
OplsAtomTyper::~OplsAtomTyper()
{
}
// --- Properties ---------------------------------------------------------- //
void OplsAtomTyper::setMolecule(const chemkit::Molecule *molecule)
{
chemkit::AtomTyper::setMolecule(molecule);
if(!molecule){
m_typeNumbers.resize(0);
return;
}
m_typeNumbers = std::vector<int>(molecule->atomCount());
for(size_t index = 0; index < molecule->atomCount(); index++){
const chemkit::Atom *atom = molecule->atom(index);
// hydrogen
if(atom->is(chemkit::Atom::Hydrogen)){
if(atom->isTerminal()){
const chemkit::Atom *neighbor = atom->neighbor(0);
if(neighbor->is(chemkit::Atom::Oxygen)){
if(neighbor->neighborCount() == 2 &&
neighbor->neighborCount(chemkit::Atom::Hydrogen) == 2){
setTypeNumber(index, 76); // SPC hydrogen in water (HW)
}
else{
setTypeNumber(index, 94); // hydrogen in alcohol (HO)
}
}
else if(neighbor->is(chemkit::Atom::Carbon)){
setTypeNumber(index, 82); // alkane C-H
}
else if(neighbor->is(chemkit::Atom::Nitrogen)){
if(neighbor->neighborCount(chemkit::Atom::Hydrogen) == 3){
setTypeNumber(index, 70); // hydrogen in ammonia (H)
}
}
}
}
// helium
else if(atom->is(chemkit::Atom::Helium)){
setTypeNumber(index, 43); // helium atom
}
// lithium
else if(atom->is(chemkit::Atom::Lithium)){
setTypeNumber(index, 345); // lithium 1+ ion (Li)
}
// carbon
else if(atom->is(chemkit::Atom::Carbon)){
if(atom->neighborCount() == 4){
if(atom->neighborCount(chemkit::Atom::Carbon) == 2){
setTypeNumber(index, 78); // alkane -CH2-
}
else if(atom->neighborCount(chemkit::Atom::Carbon) == 1 &&
atom->neighborCount(chemkit::Atom::Hydrogen) == 3){
setTypeNumber(index, 77); // alkane -CH3
}
else if(atom->neighborCount(chemkit::Atom::Oxygen) == 1){
setTypeNumber(index, 96); // alcohol CH3OH
}
}
else if(atom->neighborCount() == 3){
if(atom->isAromatic()){
setTypeNumber(index, 87); // aromatic carbon
}
}
}
// nitrogen
else if(atom->is(chemkit::Atom::Nitrogen)){
if(atom->neighborCount() == 3){
if(atom->neighborCount(chemkit::Atom::Hydrogen) == 3){
setTypeNumber(index, 69); // nitrogen in ammonia (NT)
}
}
}
// oxygen
else if(atom->is(chemkit::Atom::Oxygen)){
if(atom->neighborCount() == 1){
const chemkit::Atom *neighbor = atom->neighbor(0);
const chemkit::Bond *neighborBond = atom->bonds()[0];
if(neighbor->is(chemkit::Atom::Carbon) && neighborBond->order() == chemkit::Bond::Double){
setTypeNumber(index, 220); // ketone C=O (O)
}
}
else if(atom->neighborCount() == 2){
if(atom->neighborCount(chemkit::Atom::Hydrogen) == 2){
setTypeNumber(index, 75); // SPC oxygen in water (OW)
}
else if(atom->neighborCount(chemkit::Atom::Hydrogen) == 1){
setTypeNumber(index, 93); // oxygen in alcohol (OH)
}
}
}
// fluorine
else if(atom->is(chemkit::Atom::Fluorine)){
if(atom->formalCharge() < 0){
setTypeNumber(index, 340); // fluoride ion (F)
}
}
// neon
else if(atom->is(chemkit::Atom::Neon)){
setTypeNumber(index, 44); // neon atom
}
// sodium
else if(atom->is(chemkit::Atom::Sodium)){
setTypeNumber(index, 346); // sodium ion
}
// magnesium
else if(atom->is(chemkit::Atom::Magnesium)){
setTypeNumber(index, 350); // magnesium ion (Mg)
}
// phosphorus
else if(atom->is(chemkit::Atom::Phosphorus)){
if(atom->neighborCount() == 4){
if(atom->neighborCount(chemkit::Atom::Oxygen) > 0){
setTypeNumber(index, 378); // phosphate P
}
}
}
// sulfur
else if(atom->is(chemkit::Atom::Sulfur)){
if(atom->neighborCount() == 2){
if(atom->neighborCount(chemkit::Atom::Hydrogen) == 1){
setTypeNumber(index, 139); // sulfur in thiol (SH)
}
else if(atom->neighborCount(chemkit::Atom::Hydrogen) == 2){
setTypeNumber(index, 140); // sulfur in hydrogen sulfide (SH)
}
else if(atom->neighborCount(chemkit::Atom::Sulfur) == 1){
setTypeNumber(index, 142); // disulfide -S-S- (S)
}
else{
setTypeNumber(index, 141); // sulfide -S- (S)
}
}
}
// chlorine
else if(atom->is(chemkit::Atom::Chlorine)){
if(atom->formalCharge() < 0){
setTypeNumber(index, 341); // chloride ion (Cl)
}
}
// argon
else if(atom->is(chemkit::Atom::Argon)){
setTypeNumber(index, 45); // argon atom
}
// potassium
else if(atom->is(chemkit::Atom::Potassium)){
setTypeNumber(index, 347); // potassium 1+ ion (K)
}
// calcium
else if(atom->is(chemkit::Atom::Calcium)){
setTypeNumber(index, 351); // calcium 2+ ion (Ca)
}
// zinc
else if(atom->is(chemkit::Atom::Zinc)){
if(atom->formalCharge() == 2){
setTypeNumber(index, 834); // zinc 2+ ion (Zn)
}
}
// bromine
else if(atom->is(chemkit::Atom::Bromine)){
if(atom->formalCharge() < 0){
setTypeNumber(index, 342); // bromide ion (Br)
}
}
// krypton
else if(atom->is(chemkit::Atom::Krypton)){
setTypeNumber(index, 46); // krypton atom
}
// iodine
else if(atom->is(chemkit::Atom::Iodine)){
setTypeNumber(index, 343); // iodide ion (I)
}
// xenon
else if(atom->is(chemkit::Atom::Xenon)){
setTypeNumber(index, 47); // xenon atom
}
}
}
// --- Types --------------------------------------------------------------- //
std::string OplsAtomTyper::type(const chemkit::Atom *atom) const
{
return boost::lexical_cast<std::string>(m_typeNumbers[atom->index()]);
}
void OplsAtomTyper::setTypeNumber(int index, int typeNumber)
{
m_typeNumbers[index] = typeNumber;
}
int OplsAtomTyper::typeNumber(const chemkit::Atom *atom) const
{
return m_typeNumbers[atom->index()];
}
| 38.304878 | 106 | 0.519898 | quizzmaster |
b7b8652b33682cdf1d93575f77c3fc2e073dd2ef | 602 | cpp | C++ | DEMCUASO.cpp | phuongnam2002/testlib | a5cb8e2be7ac7a7e7dca7942a79ec20076f5d1aa | [
"MIT"
] | 2 | 2022-01-14T13:34:09.000Z | 2022-02-21T07:27:29.000Z | DEMCUASO.cpp | phuongnam2002/testlib | a5cb8e2be7ac7a7e7dca7942a79ec20076f5d1aa | [
"MIT"
] | null | null | null | DEMCUASO.cpp | phuongnam2002/testlib | a5cb8e2be7ac7a7e7dca7942a79ec20076f5d1aa | [
"MIT"
] | null | null | null | #include <iostream>
using namespace std;
int main ()
{
int n, m;
cin>>m>>n;
char Building[600][600];
for (int i=0; i<5*m+1; i++)
{
for (int j=0; j<5*n+1; j++)
{
cin>>Building[i][j];
}
}
int tt[]={0, 0, 0, 0, 0};
int t=0;
int dauI=1, dauJ=1;
for (int i=0; i<m; i++)
{
if (i!=0) dauI+=5;
dauJ=1;
for (int j=0; j<n; j++)
{
if (j!=0) dauJ+=5;
tt[0]++;
for (int k=0; k<4; k++)
{
if (Building[dauI+k][dauJ]=='*')
{
tt[k+1]++;
tt[k]--;
}
}
}
}
for (int i=0; i<5; i++) cout<<tt[i]<<" ";
return 0;
}
| 15.05 | 43 | 0.405316 | phuongnam2002 |
b7c0d771b0b5697979aaf28bc3fd464c46f851eb | 954 | cpp | C++ | PrCmp/LeetCode/w3e2.cpp | ayhon/CPPWorkspace | 57d6410236096ffa0bae20b88b3e330632edc928 | [
"MIT"
] | null | null | null | PrCmp/LeetCode/w3e2.cpp | ayhon/CPPWorkspace | 57d6410236096ffa0bae20b88b3e330632edc928 | [
"MIT"
] | null | null | null | PrCmp/LeetCode/w3e2.cpp | ayhon/CPPWorkspace | 57d6410236096ffa0bae20b88b3e330632edc928 | [
"MIT"
] | null | null | null | #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <string>
using namespace std;
bool checkValidString(string s) {
stack<pair<char, int>> pila;
deque<int> stars;
for(int i = 0; i < s.size(); i++) {
if(s[i] == '{') pila.push(make_pair(s[i], i));
else if (s[i] == '}') {
if(!pila.empty() && pila.top().first != '}') pila.pop();
else pila.push(make_pair('}', i));
}
else if (s[i] == '*') stars.push_back(i);
}
if(pila.empty()) {
return true;
}
else {
bool ok = true;
while(!pila.empty() && pila.top().first == '{' && ok) {
if(stars.back() < pila.top().second) ok = false;
else {
stars.pop_back();
pila.pop();
}
}
while(!pila.empty() && ok) {
if(stars.front() > pila.top().second) ok = false;
else {
stars.pop_front();
pila.pop();
}
}
return ok;
}
}
int main() {
string s; cin >> s;
cout << (checkValidString(s)? "Válido" : "No válido") << '\n';
}
| 19.875 | 63 | 0.541929 | ayhon |
b7c825f624e2bd7eac8956f9f195c383a0d262cb | 2,888 | cpp | C++ | modules/gapi/src/api/kernels_video.cpp | tailsu/opencv | 743f1810c7ad4895b0df164395abfb54c9e8015d | [
"Apache-2.0"
] | 3 | 2020-06-18T07:35:48.000Z | 2021-06-14T15:34:25.000Z | modules/gapi/src/api/kernels_video.cpp | tailsu/opencv | 743f1810c7ad4895b0df164395abfb54c9e8015d | [
"Apache-2.0"
] | 3 | 2019-08-28T14:18:49.000Z | 2020-02-11T10:02:57.000Z | modules/gapi/src/api/kernels_video.cpp | tailsu/opencv | 743f1810c7ad4895b0df164395abfb54c9e8015d | [
"Apache-2.0"
] | 1 | 2021-04-20T08:12:22.000Z | 2021-04-20T08:12:22.000Z | // This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
//
// Copyright (C) 2020 Intel Corporation
#include "precomp.hpp"
#include <opencv2/gapi/video.hpp>
namespace cv { namespace gapi {
using namespace video;
GBuildPyrOutput buildOpticalFlowPyramid(const GMat &img,
const Size &winSize,
const GScalar &maxLevel,
bool withDerivatives,
int pyrBorder,
int derivBorder,
bool tryReuseInputImage)
{
return GBuildOptFlowPyramid::on(img, winSize, maxLevel, withDerivatives, pyrBorder,
derivBorder, tryReuseInputImage);
}
GOptFlowLKOutput calcOpticalFlowPyrLK(const GMat &prevImg,
const GMat &nextImg,
const cv::GArray<cv::Point2f> &prevPts,
const cv::GArray<cv::Point2f> &predPts,
const Size &winSize,
const GScalar &maxLevel,
const TermCriteria &criteria,
int flags,
double minEigThresh)
{
return GCalcOptFlowLK::on(prevImg, nextImg, prevPts, predPts, winSize, maxLevel,
criteria, flags, minEigThresh);
}
GOptFlowLKOutput calcOpticalFlowPyrLK(const cv::GArray<cv::GMat> &prevPyr,
const cv::GArray<cv::GMat> &nextPyr,
const cv::GArray<cv::Point2f> &prevPts,
const cv::GArray<cv::Point2f> &predPts,
const Size &winSize,
const GScalar &maxLevel,
const TermCriteria &criteria,
int flags,
double minEigThresh)
{
return GCalcOptFlowLKForPyr::on(prevPyr, nextPyr, prevPts, predPts, winSize, maxLevel,
criteria, flags, minEigThresh);
}
GMat BackgroundSubtractor(const GMat& src, const BackgroundSubtractorParams& bsp)
{
return GBackgroundSubtractor::on(src, bsp);
}
} //namespace gapi
} //namespace cv
| 46.580645 | 90 | 0.441828 | tailsu |
b7cc715ec2ea825ba120709b548e5c4eb2a3696d | 32,912 | cpp | C++ | csgocheat/hacks/c_ragebot.cpp | garryhvh420/e_xyz | 668d8c8c2b7ccfc3bae9e321b1a50379a5e33ec9 | [
"Apache-2.0"
] | null | null | null | csgocheat/hacks/c_ragebot.cpp | garryhvh420/e_xyz | 668d8c8c2b7ccfc3bae9e321b1a50379a5e33ec9 | [
"Apache-2.0"
] | null | null | null | csgocheat/hacks/c_ragebot.cpp | garryhvh420/e_xyz | 668d8c8c2b7ccfc3bae9e321b1a50379a5e33ec9 | [
"Apache-2.0"
] | null | null | null |
#include "c_ragebot.h"
#include "c_aimhelper.h"
#include "c_trace_system.h"
#include "../utils/math.h"
#include "../sdk/c_weapon_system.h"
#include "../sdk/c_debug_overlay.h"
#include "c_prediction_system.h"
#include "c_antiaim.h"
#include "c_resolver.h"
#include "../menu/c_menu.h"
#include "../hacks/c_hitmarker.h"
void c_ragebot::aim(c_cs_player* local, c_user_cmd* cmd, bool& send_packet)
{
last_pitch = std::nullopt;
const auto weapon = reinterpret_cast<c_base_combat_weapon*>(
client_entity_list()->get_client_entity_from_handle(local->get_current_weapon_handle()));
if (!weapon)
return;
const auto wpn_info = weapon_system->get_weapon_data(weapon->get_item_definition());
if (!wpn_info)
return;
if (!local->can_shoot(cmd, global_vars_base->curtime))
return;
const auto weapon_cfg = c_aimhelper::get_weapon_conf();
if (!weapon_cfg.has_value())
return;
std::vector<aim_info> hitpoints = {};
client_entity_list()->for_each_player([&](c_cs_player* player) -> void
{
if (!player->is_enemy() || !player->is_alive() || player->get_gun_game_immunity())
return;
const auto latest = animation_system->get_latest_animation(player);
if (!latest.has_value())
return;
const auto rtt = 2.f * net_channel->get_latency(flow_outgoing);
const auto breaking_lagcomp = latest.value()->lag && latest.value()->lag <= 17 && is_breaking_lagcomp(latest.value());
const auto can_delay_shot = (latest.value()->lag > time_to_ticks(rtt) + global_vars_base->interval_per_tick);
const auto delay_shot = (time_to_ticks(rtt) + time_to_ticks(global_vars_base->curtime - latest.value()->sim_time) + global_vars_base->interval_per_tick >= latest.value()->lag);
const auto oldest = animation_system->get_oldest_animation(player);
const auto firing = animation_system->get_latest_firing_animation(player); //firing
const auto upPitch = animation_system->get_latest_upPitch_animation(player); //uppitch
const auto sideways = animation_system->get_latest_sideways_animation(player); //sideways
const auto uncrouched = animation_system->get_uncrouched_animation(player);
if (breaking_lagcomp && delay_shot && can_delay_shot)
return;
if (breaking_lagcomp && !can_delay_shot)
return;
/*
priority order://highest chance of hitting
firing
uppitch
sideways
uncrouched
latest
oldest
*/
/*
we could add if the target is sideways to us
we could add something to check if its the highest damage potential (kill potential, prio a kill over doing dmg)
scan more than first and last
*/
std::optional<aim_info> aimbot_info;
if (firing.has_value()) {
const auto alternative = scan_record(local, firing.value());//shooting
if (alternative.has_value()) {
if (!aimbot_info.has_value() || (alternative.value().damage > aimbot_info.value().damage))
aimbot_info = alternative;
}
}
else if (sideways.has_value()) {
const auto alternative = scan_record(local, sideways.value());//sideways fuck desync
if (alternative.has_value()) {
if (!aimbot_info.has_value() || (alternative.value().damage > aimbot_info.value().damage))
aimbot_info = alternative;
}
}
else if (upPitch.has_value()) {
const auto alternative = scan_record(local, upPitch.value());//lookingup
if (alternative.has_value()) {
if (!aimbot_info.has_value() || (alternative.value().damage > aimbot_info.value().damage))
aimbot_info = alternative;
}
}
else if (!aimbot_info.has_value() && uncrouched.has_value()){//use this only if we have nothing better lol, i suppose this is against fakeduck?
const auto alternative = scan_record(local, uncrouched.value());//uncroched cuz we are gay or something?
if (alternative.has_value() &&
(!aimbot_info.has_value() || alternative.value().damage > aimbot_info.value().damage))
aimbot_info = alternative;
}
else if(!aimbot_info.has_value()){//we are running out of ideas, try some normal stuff
const auto alternative = scan_record(local, latest.value());//latest
if (alternative.has_value() &&
(!aimbot_info.has_value() || aimbot_info.value().damage < alternative.value().damage))
aimbot_info = alternative;
}
else if (!aimbot_info.has_value() && oldest.has_value() && latest.value() != oldest.value() /*&& oldest.value()->velocity.length2d() >= .1f*/) {//no need for velocity check he could have changed angles
const auto alternative = scan_record(local, oldest.value());
// is there no other record?
if ((alternative.has_value() && !aimbot_info.has_value()) ||
/*(aimbot_info.has_value() && aimbot_info.value().animation->velocity.length2d() < .1f) ||*///fucking useless
(alternative.has_value() && aimbot_info.has_value() && alternative.value().damage > aimbot_info.value().damage))
aimbot_info = alternative;
}
if (aimbot_info.has_value())
hitpoints.push_back(aimbot_info.value());
});
aim_info best_match = { c_vector3d(), -FLT_MAX, nullptr, false, c_vector3d(), 0.f, 0.f, c_cs_player::hitbox::head, 0 };
// find best target spot of all valid spots.
for (auto& hitpoint : hitpoints)
if (hitpoint.damage > best_match.damage)
best_match = hitpoint;
// stop if no target found.
if (best_match.damage < 0.f)
return;
// run autostop.
if (cmd->buttons & ~c_user_cmd::jump)
{
autostop(local, cmd);
}
if (config.rage.fakelag_settings.fake_lag_on_peek_delay && antiaim->is_on_peek)
{
const auto entity_weapon = reinterpret_cast<c_base_combat_weapon*>(client_entity_list()->get_client_entity_from_handle(best_match.animation->player->get_current_weapon_handle()));
auto should_return = true;
auto on_ground = best_match.animation->player->is_on_ground();
c_base_animating::animation_layers layers = *best_match.animation->player->get_animation_layers();
if (best_match.animation->player->get_health() <= weapon_cfg.value().body_aim_health)
should_return = false;
if (entity_weapon && entity_weapon->get_current_clip() <= 2)
should_return = false;
if (!on_ground)
should_return = false;
if (best_match.animation->player->get_sequence_activity(layers[1].sequence) == act_csgo_reload && layers[1].cycle < 0.99f)
should_return = false;
if (entity_weapon && entity_weapon->get_item_definition() == weapon_knife || entity_weapon->get_item_definition() == weapon_knife_t || entity_weapon->get_item_definition() == weapon_taser || entity_weapon->get_item_definition() == weapon_c4)
should_return = false;
if (should_return && !best_match.animation->didshot && !best_match.animation->upPitch && !best_match.animation->sideways)
return;
}
// scope the weapon.
if ((wpn_info->get_weapon_id() == weapon_g3sg1 || wpn_info->get_weapon_id() == weapon_scar20 || wpn_info->get_weapon_id() == weapon_ssg08 || wpn_info->get_weapon_id() == weapon_awp
|| wpn_info->get_weapon_id() == weapon_sg556 || wpn_info->get_weapon_id() == weapon_aug) && weapon->get_zoom_level() == 0)
cmd->buttons |= c_user_cmd::flags::attack2;
// calculate angle.
const auto angle = math::calc_angle(local->get_shoot_position(), best_match.position);
// store pitch for eye correction.
last_pitch = angle.x;
// optimize multipoint and select final aimpoint.
//c_aimhelper::optimize_multipoint(best_match);//nice to call this but its not doing anything, not changing the targetangle
//debug_overlay()->add_line_overlay(local->get_shoot_position(), best_match.position, 255, 0, 0, true, 0.1);
// auto doesmatch = best_match.animation->player->get_health() <= weapon_cfg.value().hp_health_override;
if (c_aimhelper::is_hitbox_a_body(best_match.hitbox))
{
if (!c_aimhelper::can_hit(local, best_match.animation, best_match.position, weapon_cfg.value().hitchance_body / 100.f, best_match.hitbox))
return;
}
else if (c_aimhelper::is_hitbox_a_body(best_match.hitbox) && best_match.animation->player->get_health() <= weapon_cfg.value().hp_health_override)
{
if (!c_aimhelper::can_hit(local, best_match.animation, best_match.position, weapon_cfg.value().hp_body_hitchance / 100.f, best_match.hitbox))
return;
}
else if (!(c_aimhelper::is_hitbox_a_body(best_match.hitbox)) && best_match.animation->player->get_health() <= weapon_cfg.value().hp_health_override)
{
if (!c_aimhelper::can_hit(local, best_match.animation, best_match.position, weapon_cfg.value().hp_head_hitchance / 100.f, best_match.hitbox))
return;
}
else
if (!c_aimhelper::can_hit(local, best_match.animation, best_match.position, weapon_cfg.value().hitchance_head / 100.f, best_match.hitbox))
return;
// store shot info for resolver.
if (!best_match.alt_attack)
{
resolver::shot shot{};
shot.damage = best_match.damage;
shot.start = local->get_shoot_position();
shot.end = best_match.position;
shot.hitgroup = best_match.hitgroup;
shot.hitbox = best_match.hitbox;
shot.time = global_vars_base->curtime;
shot.record = *best_match.animation;
shot.manual = false;
shot.tickcount = cmd->tick_count - time_to_ticks(best_match.animation->sim_time) + time_to_ticks(calculate_lerp());
shot.sideways = best_match.animation->sideways;
shot.uppitch = best_match.animation->upPitch;
shot.shotting = best_match.animation->didshot;
shot.index = best_match.animation->index;
char msg[255];
static const auto hit_msg = __("Fired at with BT %d. Type: %s Hitbox: %s");
_rt(hit, hit_msg);
char type[255]; char phitbox[255];
if (shot.shotting)
sprintf(type, "Shooting");
else if (shot.sideways)
sprintf(type, "SideW");
else if (shot.uppitch)
sprintf(type, "UP");
else
sprintf(type, "Nothing");
switch (shot.hitbox) {
case c_cs_player::hitbox::head:
sprintf(phitbox, "Head");
break;
case c_cs_player::hitbox::pelvis:
sprintf(phitbox, "Pelvis");
break;
default:
sprintf(phitbox, "Unk");
break;
}
sprintf_s(msg, hit, shot.tickcount, type, phitbox);
logging->info(msg);
switch (config.rage.resolver) {
case 1:c_resolver::register_shot(std::move(shot));
break;
case 2:c_resolver_beta::register_shot(std::move(shot));
break;
}
}
// set correct information to user_cmd.
cmd->viewangles = angle;
cmd->tick_count = time_to_ticks(best_match.animation->sim_time + calculate_lerp()) ;//+ time_to_ticks()
if (weapon_cfg.value().auto_shoot && GetAsyncKeyState(config.rage.fake_duck))
{
if (local->get_duck_amount() == 0.f)
{
cmd->buttons |= best_match.alt_attack ? c_user_cmd::attack2 : c_user_cmd::attack;
}
}
else if (weapon_cfg.value().auto_shoot && cmd->buttons & c_user_cmd::duck)
{
cmd->buttons |= best_match.alt_attack ? c_user_cmd::attack2 : c_user_cmd::attack;
}
else
{
cmd->buttons |= best_match.alt_attack ? c_user_cmd::attack2 : c_user_cmd::attack;
}
}
void c_ragebot::autostop(c_cs_player* local, c_user_cmd* cmd)
{
if (cmd->buttons & c_user_cmd::jump)
return;
static const auto nospread = cvar()->find_var(_("weapon_accuracy_nospread"));
const auto weapon = reinterpret_cast<c_base_combat_weapon*>(
client_entity_list()->get_client_entity_from_handle(local->get_current_weapon_handle()));
if (nospread->get_int() || !local->is_on_ground() ||
(weapon && weapon->get_item_definition() == weapon_taser) && local->is_on_ground())
return;
const auto wpn_info = weapon_system->get_weapon_data(weapon->get_item_definition());
if (!wpn_info)
return;
auto& info = get_autostop_info(cmd);
if (info.call_time == global_vars_base->curtime)
{
info.did_stop = true;
return;
}
info.did_stop = false;
info.call_time = global_vars_base->curtime;
if (local->get_velocity().length2d() <= wpn_info->get_standing_accuracy(weapon))
return;
else
{
cmd->forwardmove = 0.f;
cmd->sidemove = 0.f;
prediction_system->repredict(local, cmd);
if (config.rage.slow_walk && GetAsyncKeyState(config.rage.slow_walk))
{
antiaim->is_slow_walking = true;
info.did_stop = true;
return;
}
else
antiaim->is_slow_walking = false;
if (local->get_velocity().length2d() <= wpn_info->get_standing_accuracy(weapon))
return;
}
c_qangle dir;
math::vector_angles(prediction_system->unpredicted_velocity, dir);
const auto angles = engine_client()->get_view_angles();
dir.y = angles.y - dir.y;
c_vector3d move;
math::angle_vectors(dir, move);
if (prediction_system->unpredicted_velocity.length2d() > .1f)
move *= -math::forward_bounds / std::max(std::abs(move.x), std::abs(move.y));
cmd->forwardmove = move.x;
cmd->sidemove = move.y;
const auto backup = cmd->viewangles;
cmd->viewangles = angles;
prediction_system->repredict(local, cmd);
cmd->viewangles = backup;
if (local->get_velocity().length2d() > prediction_system->unpredicted_velocity.length2d())
{
cmd->forwardmove = 0.f;
cmd->sidemove = 0.f;
}
prediction_system->repredict(local, cmd);
}
std::optional<c_ragebot::aim_info> c_ragebot::scan_record(c_cs_player* local, c_animation_system::animation* animation)
{
const auto weapon = reinterpret_cast<c_base_combat_weapon*>(
client_entity_list()->get_client_entity_from_handle(local->get_current_weapon_handle()));
if (!weapon)
return std::nullopt;
const auto info = weapon_system->get_weapon_data(weapon->get_item_definition());
if (!info)
return std::nullopt;
const auto is_zeus = weapon->get_item_definition() == weapon_taser;
const auto is_knife = !is_zeus && info->WeaponType == weapontype_knife;
if (is_knife)
return scan_record_knife(local, animation);
return scan_record_aimbot(local, animation);
}
std::optional<c_ragebot::aim_info> c_ragebot::scan_record_aimbot(c_cs_player * local, c_animation_system::animation* animation, std::optional<c_vector3d> pos)
{
const auto weapon_cfg = c_aimhelper::get_weapon_conf();
if (!animation || !animation->player || !weapon_cfg.has_value())
return std::nullopt;
const auto weapon = reinterpret_cast<c_base_combat_weapon*>(client_entity_list()->get_client_entity_from_handle(local->get_current_weapon_handle()));
if (!weapon)
return std::nullopt;
const auto info = animation_system->get_animation_info(animation->player);
if (!info)
return std::nullopt;
const auto cfg = weapon_cfg.value();
/*TODO:
89 1D ? ? ? ? 8B C3 + 2 + //g_netgraph xref: "vgui/white",
0x131B8 = (int)(1.0f / m_Framerate) lets use the game :)
FPS OPTIMIZATION MODE USING ABOVE
*/
const float client_frame_rate = (int)(1.0f / *(float*)(net_graph + 0x131B8));
auto should_optimize = client_frame_rate <= cfg.optimize_fps;
auto should_baim = false;
const auto center = animation->player->get_hitbox_position(c_cs_player::hitbox::pelvis, animation->bones);
const auto slow_walk = animation->anim_state.feet_yaw_rate >= 0.01 && animation->anim_state.feet_yaw_rate <= 0.8;
const auto is_moving = animation->velocity.length2d() > 0.1f && animation->player->is_on_ground() && !slow_walk;
if (center.has_value())
{
const auto center_wall = trace_system->wall_penetration(pos.value_or(local->get_shoot_position()),
center.value(), animation);
if (center_wall.has_value() && center_wall.value().hitbox == c_cs_player::hitbox::pelvis
&& center_wall.value().damage - 10.f > animation->player->get_health())
should_baim = true;
}
if (!should_baim)
{
const auto data = weapon_system->get_weapon_data(weapon->get_item_definition());
if (!data)
return std::nullopt;
if (animation->player->get_health() <= cfg.body_aim_health)
should_baim = true;
if (cfg.smart_aim)
{
if (animation->player->get_health() <= 50)
should_baim = true;
if (animation->player->get_velocity().length2d() > 0.1 && !animation->player->is_on_ground())
should_baim = true;
if (slow_walk)
should_baim = true;
}
if (cfg.body_aim_in_air)
if (animation->player->get_velocity().length2d() > 0.1 && !animation->player->is_on_ground())
should_baim = true;
if (cfg.body_aim_lethal && animation->player->get_health() < data->iDamage)
should_baim = true;
if (cfg.body_aim_slow_walk)
if (slow_walk)
should_baim = true;
if (GetAsyncKeyState(cfg.body_aim_key))
should_baim = true;
if (info->missed_due_to_resolver >= cfg.body_after_x_missed_resolver + 1)
should_baim = true;
if (info->missed_due_to_spread >= cfg.body_after_x_missed_spread + 1)
should_baim = true;
if (cfg.body_aim_if_not_on_shot && !animation->didshot)
should_baim = true;
}
aim_info best_match = { c_vector3d(), -FLT_MAX, nullptr, false, c_vector3d(), 0.f, 0.f, c_cs_player::hitbox::head, 0 };
const auto scan_box = [&](c_cs_player::hitbox hitbox)
{
auto box = animation->player->get_hitbox_position(hitbox, const_cast<matrix3x4*>(animation->bones));
if (!box.has_value())
return;
auto scale_hitbox = 0.f;
switch (hitbox)
{
case c_cs_player::hitbox::head:
scale_hitbox = cfg.head_scale / 100.f;
break;
case c_cs_player::hitbox::neck:
scale_hitbox = cfg.head_scale / 100.f;
break;
case c_cs_player::hitbox::upper_chest:
scale_hitbox = cfg.chest_scale / 100.f;
break;
case c_cs_player::hitbox::chest:
scale_hitbox = cfg.chest_scale / 100.f;
break;
case c_cs_player::hitbox::thorax:
scale_hitbox = cfg.stomach_scale / 100.f;
break;
case c_cs_player::hitbox::pelvis:
scale_hitbox = cfg.pelvis_scale / 100.f;
break;
case c_cs_player::hitbox::left_thigh:
scale_hitbox = cfg.legs_scale / 100.f;
break;
case c_cs_player::hitbox::right_thigh:
scale_hitbox = cfg.legs_scale / 100.f;
break;
case c_cs_player::hitbox::left_foot:
scale_hitbox = cfg.feet_scale / 100.f;
break;
case c_cs_player::hitbox::right_foot:
scale_hitbox = cfg.feet_scale / 100.f;
break;
}
auto points = pos.has_value() ? std::vector<aim_info>() : c_aimhelper::select_multipoint(animation, hitbox, hitgroup_head, scale_hitbox);
points.emplace_back(box.value(), 0.f, animation, false, box.value(), 0.f, 0.f, hitbox, hitgroup_head);
const auto low_hitchance = pos.has_value();
for (auto& point : points)
{
if (point.rs > 0.f && low_hitchance)
continue;
const auto wall = trace_system->wall_penetration(pos.value_or(local->get_shoot_position()),
point.position, animation);
if (!wall.has_value())
continue;
if (hitbox == c_cs_player::hitbox::head && hitbox != wall.value().hitbox)
continue;
point.hitgroup = wall.value().hitgroup;
if (hitbox == c_cs_player::hitbox::upper_chest
&& (wall.value().hitbox == c_cs_player::hitbox::head || wall.value().hitbox == c_cs_player::hitbox::neck))
continue;
point.damage = wall.value().damage;
if (point.damage > best_match.damage)
best_match = point;
}
};
std::vector<c_cs_player::hitbox> hitboxes_scan;
auto should_head_neck_only = animation->didshot;
auto should_override_head_aim = cfg.override_head_aim_only;
if (should_head_neck_only && should_override_head_aim)
{
if (should_baim)
should_head_neck_only = false;
//todo other conditions.
}
if (should_head_neck_only && cfg.head_aim_only_while_firing) // run our only head/neck hitscan
{
if (hitboxes_scan.size() > 0)
hitboxes_scan.clear();
if (cfg.on_shot_hitscan_head)
{
hitboxes_scan.push_back(c_cs_player::hitbox::head);
//hitboxes_scan.push_back(c_cs_player::hitbox::neck);
}
if (cfg.on_shot_hitscan_body)
{
hitboxes_scan.push_back(c_cs_player::hitbox::upper_chest);
hitboxes_scan.push_back(c_cs_player::hitbox::chest);
hitboxes_scan.push_back(c_cs_player::hitbox::thorax);
hitboxes_scan.push_back(c_cs_player::hitbox::pelvis);
}
}
else if (should_baim) // run our standard body_aim hitscan
{
if (hitboxes_scan.size() > 0)
hitboxes_scan.clear();
if (is_moving ? cfg.hitscan_chest_moving : cfg.hitscan_chest_moving)
{
hitboxes_scan.push_back(c_cs_player::hitbox::upper_chest);
//hitboxes_scan.push_back(c_cs_player::hitbox::chest);//i dont like this
}
if (is_moving ? cfg.hitscan_stomach_moving : cfg.hitscan_stomach)
hitboxes_scan.push_back(c_cs_player::hitbox::thorax);
if (is_moving ? cfg.hitscan_pelvis_moving : cfg.hitscan_pelvis)
hitboxes_scan.push_back(c_cs_player::hitbox::pelvis);
if (is_moving ? cfg.hitscan_legs_moving : cfg.hitscan_legs)
{
hitboxes_scan.push_back(c_cs_player::hitbox::left_thigh);
hitboxes_scan.push_back(c_cs_player::hitbox::right_thigh);
}
if (is_moving ? cfg.hitscan_feet_moving : cfg.hitscan_feet)
{
//hitboxes_scan.push_back(c_cs_player::hitbox::left_calf);//lets not waste ressources
//hitboxes_scan.push_back(c_cs_player::hitbox::right_calf);
hitboxes_scan.push_back(c_cs_player::hitbox::left_foot);
hitboxes_scan.push_back(c_cs_player::hitbox::right_foot);
}
}
else // run our normal hitscan
{
if (hitboxes_scan.size() > 0)
hitboxes_scan.clear();
if (is_moving ? cfg.hitscan_head_moving : cfg.hitscan_head)
{
hitboxes_scan.push_back(c_cs_player::hitbox::head);
//hitboxes_scan.push_back(c_cs_player::hitbox::neck);//dont need 1000 scans
}
if (is_moving ? cfg.hitscan_chest_moving : cfg.hitscan_chest)
{
hitboxes_scan.push_back(c_cs_player::hitbox::upper_chest);
//hitboxes_scan.push_back(c_cs_player::hitbox::chest);//i dont like this
}
if (is_moving ? cfg.hitscan_stomach_moving : cfg.hitscan_stomach)
hitboxes_scan.push_back(c_cs_player::hitbox::thorax);
if (is_moving ? cfg.hitscan_pelvis_moving : cfg.hitscan_pelvis)
hitboxes_scan.push_back(c_cs_player::hitbox::pelvis);
if (is_moving ? cfg.hitscan_legs_moving : cfg.hitscan_legs)
{
hitboxes_scan.push_back(c_cs_player::hitbox::left_thigh);
hitboxes_scan.push_back(c_cs_player::hitbox::right_thigh);
}
if (is_moving ? cfg.hitscan_feet_moving : cfg.hitscan_feet)
{
//hitboxes_scan.push_back(c_cs_player::hitbox::left_calf);//lets not waste ressources
//hitboxes_scan.push_back(c_cs_player::hitbox::right_calf);
hitboxes_scan.push_back(c_cs_player::hitbox::left_foot);
hitboxes_scan.push_back(c_cs_player::hitbox::right_foot);
}
}
auto can_fire_at_hitbox = false;
if (animation->didshot || animation->sideways) {//cuz we can
hitboxes_scan.clear();
hitboxes_scan.push_back(c_cs_player::hitbox::head);
hitboxes_scan.push_back(c_cs_player::hitbox::pelvis);
}
//if(!hitboxes_scan.size())
//hitboxes_scan.push_back(c_cs_player::hitbox::head);//scan head or we wont do anything jesus
for (const auto& hitbox : hitboxes_scan) //do our hitscan for our hitboxes
scan_box(hitbox);
//check if we can hit the hitbox!
if (weapon_cfg.value().min_dmg_hp && animation->player->get_health() <= weapon_cfg.value().hp || animation->player->get_health() < weapon_cfg.value().min_dmg)
{
if (best_match.damage >= animation->player->get_health() + cfg.min_dmg_hp_slider || best_match.damage - 10.f >= static_cast<float>(animation->player->get_health()))
{
can_fire_at_hitbox = true;
}
}
else if (animation->player->get_health() <= weapon_cfg.value().hp_health_override)
{
if (best_match.damage >= cfg.hp_mindmg || best_match.damage - 10.f >= static_cast<float>(animation->player->get_health()))
{
can_fire_at_hitbox = true;
}
}
else if (!(weapon_cfg.value().min_dmg_hp) && !(animation->player->get_health() <= weapon_cfg.value().hp) || !(animation->player->get_health() < weapon_cfg.value().min_dmg))
{
if (best_match.damage >= cfg.min_dmg || best_match.damage - 10.f >= static_cast<float>(animation->player->get_health()))
{
can_fire_at_hitbox = true;
}
}
else if (can_fire_at_hitbox == false)
{
//aimbot cannot fire at the player lets figure out why?
//lets try head :)
//scan_box(c_cs_player::hitbox::head); //lets hitscan the head only! :)
if (weapon_cfg.value().min_dmg_hp && animation->player->get_health() <= weapon_cfg.value().hp || animation->player->get_health() < weapon_cfg.value().min_dmg)
{
if (best_match.damage >= animation->player->get_health() + cfg.min_dmg_hp_slider || best_match.damage - 10.f >= static_cast<float>(animation->player->get_health()))
can_fire_at_hitbox = true;
}
else
{
if (best_match.damage >= cfg.min_dmg || best_match.damage - 10.f >= static_cast<float>(animation->player->get_health()))
can_fire_at_hitbox = true;
}
}
if (can_fire_at_hitbox == true)
return best_match;
else
return std::nullopt;
}
std::optional<c_ragebot::aim_info> c_ragebot::scan_record_knife(c_cs_player * local, c_animation_system::animation* animation)
{
static const auto is_behind = [] (c_cs_player* local, c_animation_system::animation* animation) -> bool
{
auto vec_los = animation->origin - local->get_origin();
vec_los.z = 0.0f;
c_vector3d forward;
math::angle_vectors(animation->eye_angles, forward);
forward.z = 0.0f;
return vec_los.normalize().dot(forward) > 0.475f;
};
static const auto should_stab = [] (c_cs_player* local, c_animation_system::animation* animation) -> bool
{
struct table_t
{
unsigned char swing[2][2][2];
unsigned char stab[2][2];
};
static const table_t table = {
{
{
{ 25, 90 },
{ 21, 76 }
},
{
{ 40, 90 },
{ 34, 76 }
}
},
{
{ 65, 180 },
{ 55, 153 }
}
};
const auto weapon = reinterpret_cast<c_base_combat_weapon*>(
client_entity_list()->get_client_entity_from_handle(local->get_current_weapon_handle()));
if (!weapon)
return false;
const auto has_armor = animation->player->get_armor() > 0;
const auto first_swing = weapon->get_next_primary_attack() + 0.4f < global_vars_base->curtime;
const auto behind = is_behind(local, animation);
const int stab_dmg = table.stab[has_armor][behind];
const int slash_dmg = table.swing[false][has_armor][behind];
const int swing_dmg = table.swing[first_swing][has_armor][behind];
if (animation->player->get_health() <= swing_dmg)
return false;
if (animation->player->get_health() <= stab_dmg)
return true;
if (animation->player->get_health() > swing_dmg + slash_dmg + stab_dmg)
return true;
return false;
};
const auto studio_model = model_info_client()->get_studio_model(animation->player->get_model());
if (!studio_model)
return std::nullopt;
const auto stab = should_stab(local, animation);
const auto range = stab ? 32.0f : 48.0f;
game_trace tr;
auto spot = animation->player->get_hitbox_position(c_cs_player::hitbox::upper_chest, animation->bones);
const auto hitbox = studio_model->get_hitbox(static_cast<uint32_t>(c_cs_player::hitbox::upper_chest), 0);
if (!spot.has_value() || !hitbox)
return std::nullopt;
c_vector3d forward;
const auto calc = math::calc_angle(local->get_shoot_position(), spot.value());
math::angle_vectors(calc, forward);
spot.value() += forward * hitbox->radius;
c_trace_system::run_emulated(animation, [&] () -> void
{
uint32_t filter[4] = { c_engine_trace::get_filter_simple_vtable(), reinterpret_cast<uint32_t>(local), 0, 0 };
ray r;
c_vector3d aim;
const auto angle = math::calc_angle(local->get_shoot_position(), spot.value());
math::angle_vectors(angle, aim);
const auto end = local->get_shoot_position() + aim * range;
r.init(local->get_shoot_position(), end);
engine_trace()->trace_ray(r, mask_solid, reinterpret_cast<trace_filter*>(filter), &tr);
if (tr.fraction >= 1.0f)
{
const c_vector3d min(-16.f, -16.f, -18.f);
const c_vector3d max(16.f, 16.f, 18.f);
r.init(local->get_shoot_position(), end, min, max);
engine_trace()->trace_ray(r, mask_solid, reinterpret_cast<trace_filter*>(filter), &tr);
}
});
if (tr.entity != animation->player)
return std::nullopt;
return aim_info { tr.endpos, 100.f, animation, stab, c_vector3d(), 0.f, 0.f, c_cs_player::hitbox::head, 0 };
}
std::optional<c_ragebot::aim_info> c_ragebot::scan_record_gun(c_cs_player* local, c_animation_system::animation* animation, std::optional<c_vector3d> pos)
{
const auto weapon_cfg = c_aimhelper::get_weapon_conf();
if (!animation || !animation->player || !weapon_cfg.has_value())
return std::nullopt;
const auto weapon = reinterpret_cast<c_base_combat_weapon*>(client_entity_list()->get_client_entity_from_handle(local->get_current_weapon_handle()));
if (!weapon)
return std::nullopt;
const auto info = animation_system->get_animation_info(animation->player);
if (!info)
return std::nullopt;
const auto cfg = weapon_cfg.value();
auto should_baim = false;
const auto center = animation->player->get_hitbox_position(c_cs_player::hitbox::pelvis, animation->bones);
if (center.has_value())
{
const auto center_wall = trace_system->wall_penetration(pos.value_or(local->get_shoot_position()), center.value(), animation);
if (center_wall.has_value() && center_wall.value().hitbox == c_cs_player::hitbox::pelvis && center_wall.value().damage - 10.f > animation->player->get_health())
should_baim = true;
}
aim_info best_match = { c_vector3d(), -FLT_MAX, nullptr, false, c_vector3d(), 0.f, 0.f, c_cs_player::hitbox::head, 0 };
const auto scan_box = [&](c_cs_player::hitbox hitbox)
{
auto box = animation->player->get_hitbox_position(hitbox, const_cast<matrix3x4*>(animation->bones));
if (!box.has_value())
return;
auto scale_hitbox = 0.f;
switch (hitbox)
{
case c_cs_player::hitbox::head:
scale_hitbox = cfg.head_scale / 100.f;
break;
case c_cs_player::hitbox::neck:
scale_hitbox = cfg.head_scale / 100.f;
break;
case c_cs_player::hitbox::upper_chest:
scale_hitbox = cfg.chest_scale / 100.f;
break;
case c_cs_player::hitbox::chest:
scale_hitbox = cfg.chest_scale / 100.f;
break;
case c_cs_player::hitbox::thorax:
scale_hitbox = cfg.stomach_scale / 100.f;
break;
case c_cs_player::hitbox::pelvis:
scale_hitbox = cfg.pelvis_scale / 100.f;
break;
case c_cs_player::hitbox::left_thigh:
scale_hitbox = cfg.legs_scale / 100.f;
break;
case c_cs_player::hitbox::right_thigh:
scale_hitbox = cfg.legs_scale / 100.f;
break;
}
auto points = pos.has_value() ? std::vector<aim_info>() : c_aimhelper::select_multipoint(animation, hitbox, hitgroup_head, scale_hitbox);
points.emplace_back(box.value(), 0.f, animation, false, box.value(), 0.f, 0.f, hitbox, hitgroup_head);
for (auto& point : points)
{
const auto wall = trace_system->wall_penetration(pos.value_or(local->get_shoot_position()), point.position, animation);
if (!wall.has_value())
continue;
if (hitbox == c_cs_player::hitbox::head && hitbox != wall.value().hitbox)
continue;
point.hitgroup = wall.value().hitgroup;
if (hitbox == c_cs_player::hitbox::upper_chest && (wall.value().hitbox == c_cs_player::hitbox::head || wall.value().hitbox == c_cs_player::hitbox::neck))
continue;
point.damage = wall.value().damage;
if (point.damage > best_match.damage)
best_match = point;
}
};
if (should_baim)
for (const auto& hitbox : c_cs_player::hitboxes_baim)
scan_box(hitbox);
else
for (const auto& hitbox : c_cs_player::hitboxes_aiming)
scan_box(hitbox);
if (weapon_cfg.value().min_dmg_hp && animation->player->get_health() <= weapon_cfg.value().hp || animation->player->get_health() < weapon_cfg.value().min_dmg)
{
if (best_match.damage >= animation->player->get_health() + cfg.min_dmg_hp_slider || best_match.damage - 10.f >= animation->player->get_health())
return best_match;
}
else if (animation->player->get_health() <= weapon_cfg.value().hp_health_override)
{
if (best_match.damage >= cfg.hp_mindmg || best_match.damage - 10.f >= animation->player->get_health())
return best_match;
}
else if (!weapon_cfg.value().min_dmg_hp && !(animation->player->get_health() <= weapon_cfg.value().hp) || !(animation->player->get_health() < weapon_cfg.value().min_dmg))
{
if (best_match.damage >= cfg.min_dmg || best_match.damage - 10.f >= animation->player->get_health())
return best_match;
}
//else if (should_baim)
//scan_box(c_cs_player::hitbox::head);
return std::nullopt;
}
c_ragebot::autostop_info& c_ragebot::get_autostop_info(c_user_cmd *cmd)
{
if (cmd->buttons & ~c_user_cmd::jump)
{
static autostop_info info{ -FLT_MAX, false };
return info;
}
c_ragebot::autostop_info stop;
return stop;
}
bool c_ragebot::is_breaking_lagcomp(c_animation_system::animation* animation)
{
static constexpr auto teleport_dist = 64 * 64;
const auto info = animation_system->get_animation_info(animation->player);
if (!info || info->frames.size() < 2)
return false;
if (info->frames[0].dormant)
return false;
auto prev_org = info->frames[0].origin;
auto skip_first = true;
// walk context looking for any invalidating event
for (auto& record : info->frames)
{
if (skip_first)
{
skip_first = false;
continue;
}
if (record.dormant)
break;
auto delta = record.origin - prev_org;
if (delta.length2dsqr() > teleport_dist)
{
// lost track, too much difference
return true;
}
// did we find a context smaller than target time?
if (record.sim_time <= animation->sim_time)
break; // hurra, stop
prev_org = record.origin;
}
return false;
}
| 31.953398 | 243 | 0.713934 | garryhvh420 |
b7ce090af68997617309ec3bc87022de75d8d4c5 | 1,358 | cpp | C++ | Source/Renderer/Framebuffer.cpp | RichierichorgYoutube/First | e1908df3743683424a1bbe2275c54a9089f2a462 | [
"Apache-2.0"
] | null | null | null | Source/Renderer/Framebuffer.cpp | RichierichorgYoutube/First | e1908df3743683424a1bbe2275c54a9089f2a462 | [
"Apache-2.0"
] | null | null | null | Source/Renderer/Framebuffer.cpp | RichierichorgYoutube/First | e1908df3743683424a1bbe2275c54a9089f2a462 | [
"Apache-2.0"
] | null | null | null | #include "Framebuffer.h"
#include <iostream>
GLuint g_FBO;
GLuint g_Tex;
GLuint g_RBO;
bool setupFrameBuffers(){
glGenFramebuffers(1, &g_FBO);
glBindFramebuffer(GL_FRAMEBUFFER, g_FBO);
//Render texture
glGenTextures(1, &g_Tex);
glBindTexture(GL_TEXTURE_2D, g_Tex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, g_X, g_Y, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
//Bind render texture to framebuffer
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, g_Tex, 0);
//Render Buffer
glGenRenderbuffers(1, &g_RBO);
glBindRenderbuffer(GL_RENDERBUFFER, g_RBO);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, g_X, g_Y);
glBindRenderbuffer(GL_RENDERBUFFER, 0);
//Bind render buffer to framebuffer
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, g_RBO);
if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE){
glBindFramebuffer(GL_FRAMEBUFFER, 0);
std::cout << "FRAME BUFFER ERROR: NOT COMPLETE" << std::endl;
return false;
}
//Disable new framebuffer
glBindFramebuffer(GL_FRAMEBUFFER, 0);
return true;
} | 30.863636 | 99 | 0.731222 | RichierichorgYoutube |
b7ce28795d72c30bcd582da19ecfd2bbd99ee28f | 15,428 | cpp | C++ | Engine/Source/Assets/Material.cpp | jkorn2324/jkornEngine | 5822f2a311ed62e6ca495919872f0f436d300733 | [
"MIT"
] | null | null | null | Engine/Source/Assets/Material.cpp | jkorn2324/jkornEngine | 5822f2a311ed62e6ca495919872f0f436d300733 | [
"MIT"
] | null | null | null | Engine/Source/Assets/Material.cpp | jkorn2324/jkornEngine | 5822f2a311ed62e6ca495919872f0f436d300733 | [
"MIT"
] | null | null | null | #include "EnginePCH.h"
#include "Material.h"
#include "JsonFileParser.h"
#include "JsonUtils.h"
#include "AssetSerializer.h"
#include "AssetManager.h"
#include "AssetCache.h"
#include "AssetMapper.h"
#include <rapidjson\stringbuffer.h>
namespace Engine
{
static ConstantBuffer* s_internalMaterialConstantBuffer = nullptr;
static uint32_t s_numMaterials = 0;
Material::Material()
: m_shader(),
m_materialConstantBuffer(nullptr),
m_textures(nullptr),
m_numTextures(1),
m_materialConstants({}),
m_internalMaterialConstants({})
{
if (s_numMaterials <= 0)
{
s_internalMaterialConstantBuffer = ConstantBuffer::Create(
&m_internalMaterialConstants, sizeof(InternalMaterialConstants));
}
s_numMaterials++;
m_textures = new MaterialTextureData[m_numTextures];
for (uint32_t i = 0; i < m_numTextures; i++)
{
m_textures[i] = MaterialTextureData();
}
}
Material::Material(const MaterialConstantsLayout& layout)
: m_shader(),
m_materialConstantBuffer(nullptr),
m_textures(nullptr),
m_numTextures(1),
m_materialConstants(layout),
m_internalMaterialConstants({})
{
if (s_numMaterials <= 0)
{
s_internalMaterialConstantBuffer = ConstantBuffer::Create(
&m_internalMaterialConstants, sizeof(InternalMaterialConstants));
}
s_numMaterials++;
m_textures = new MaterialTextureData[m_numTextures];
for (uint32_t i = 0; i < m_numTextures; i++)
{
m_textures[i] = MaterialTextureData();
}
m_materialConstantBuffer = ConstantBuffer::Create(
m_materialConstants.GetRawBuffer(),
m_materialConstants.GetBufferSize());
}
Material::Material(const Material& material)
: m_shader(material.m_shader),
m_materialConstantBuffer(nullptr),
m_textures(nullptr),
m_numTextures(material.m_numTextures),
m_materialConstants(material.m_materialConstants),
m_internalMaterialConstants(material.m_internalMaterialConstants)
{
s_numMaterials++;
m_textures = new MaterialTextureData[m_numTextures];
for (uint32_t i = 0; i < m_numTextures; i++)
{
m_textures[i] = MaterialTextureData(
material.m_textures[i].texture);
}
m_materialConstantBuffer = ConstantBuffer::Create(
m_materialConstants.GetRawBuffer(),
m_materialConstants.GetBufferSize());
}
Material::~Material()
{
s_numMaterials--;
if (s_numMaterials <= 0)
{
delete s_internalMaterialConstantBuffer;
}
delete[] m_textures;
delete m_materialConstantBuffer;
}
Material& Material::operator=(const Material& material)
{
delete[] m_textures;
delete m_materialConstantBuffer;
m_shader = material.m_shader;
m_numTextures = material.m_numTextures;
m_materialConstants = material.m_materialConstants;
m_internalMaterialConstants = material.m_internalMaterialConstants;
m_textures = new MaterialTextureData[m_numTextures];
for (uint32_t i = 0; i < m_numTextures; i++)
{
m_textures[i] = MaterialTextureData(
material.m_textures[i].texture);
}
m_materialConstantBuffer = ConstantBuffer::Create(
m_materialConstants.GetRawBuffer(),
m_materialConstants.GetBufferSize());
return *this;
}
void Material::SetConstantsLayout(const MaterialConstantsLayout& layout)
{
m_materialConstants = MaterialConstants(layout);
if (m_materialConstantBuffer != nullptr)
{
delete m_materialConstantBuffer;
}
m_materialConstantBuffer = ConstantBuffer::Create(
m_materialConstants.GetRawBuffer(),
m_materialConstants.GetBufferSize());
}
void Material::SetConstantsLayout(const MaterialConstantsLayout& layout, size_t layoutSize)
{
m_materialConstants = MaterialConstants(layout, layoutSize);
if (m_materialConstantBuffer != nullptr)
{
delete m_materialConstantBuffer;
}
m_materialConstantBuffer = ConstantBuffer::Create(
m_materialConstants.GetRawBuffer(),
m_materialConstants.GetBufferSize());
}
void Material::SetShader(const AssetRef<Shader>& shader)
{
m_shader = shader;
}
void Material::SetTextureData(uint32_t slot, const MaterialTextureData& materialTextureData)
{
SetTexture(slot, materialTextureData.texture);
}
void Material::SetTexture(uint32_t slot, const AssetRef<Texture>& texture)
{
if (slot >= m_numTextures)
{
return;
}
switch (slot)
{
// Default Texture Slot.
case 0:
{
if (!texture)
{
// Removes the flag only if it exists.
if (m_internalMaterialConstants.c_materialFlags & MaterialFlag_DefaultTexture)
{
m_internalMaterialConstants.c_materialFlags ^= MaterialFlag_DefaultTexture;
}
}
else
{
m_internalMaterialConstants.c_materialFlags |= MaterialFlag_DefaultTexture;
}
break;
}
}
MaterialTextureData& materialTextureData = m_textures[slot];
materialTextureData.texture = texture;
}
void Material::Bind() const
{
Bind(PER_SHADER_CONSTANTS_SLOT);
}
void Material::Bind(uint32_t constantBufferSlot) const
{
if (m_materialConstantBuffer == nullptr
|| !m_shader)
{
return;
}
m_shader->Bind();
m_materialConstantBuffer->SetData(
m_materialConstants.GetRawBuffer(), m_materialConstants.GetBufferSize());
m_materialConstantBuffer->Bind(constantBufferSlot,
PIXEL_SHADER | VERTEX_SHADER);
s_internalMaterialConstantBuffer->SetData(
&m_internalMaterialConstants, sizeof(m_internalMaterialConstants));
s_internalMaterialConstantBuffer->Bind(MATERIAL_CONSTANTS_SLOT,
PIXEL_SHADER | VERTEX_SHADER);
for (uint32_t i = 0; i < m_numTextures; i++)
{
const auto& texture = m_textures[i];
if (texture.texture)
{
texture.texture->Bind(i);
}
}
}
#pragma region serialization
static MaterialConstantLayoutAttribute LoadMaterialAttributeConstantLayoutType(rapidjson::Value& value,
char*& valueBuffer, size_t& offset)
{
std::string name;
MaterialConstantLayoutType layoutType;
bool padding = false;
ReadString(value, "Name", name);
ReadEnum<MaterialConstantLayoutType>(value, "Type", layoutType);
ReadBool(value, "Pad", padding);
MaterialConstantLayoutAttribute attribute = { name, layoutType, padding };
// Appends the attribute data to the value buffer.
char* ptrValue = valueBuffer + offset;
switch (layoutType)
{
case LayoutType_Bool:
{
bool boolValue;
ReadBool(value, "Value", boolValue);
std::memcpy(ptrValue, reinterpret_cast<char*>(&boolValue), attribute.layoutStride);
break;
}
case LayoutType_Float:
{
float floatValue;
ReadFloat(value, "Value", floatValue);
std::memcpy(ptrValue, reinterpret_cast<char*>(&floatValue), attribute.layoutStride);
break;
}
case LayoutType_Int16:
{
int16_t int16Value;
ReadInt16(value, "Value", int16Value);
std::memcpy(ptrValue, reinterpret_cast<char*>(&int16Value), attribute.layoutStride);
break;
}
case LayoutType_Int32:
{
int32_t int32Value;
ReadInt32(value, "Value", int32Value);
std::memcpy(ptrValue, reinterpret_cast<char*>(&int32Value), attribute.layoutStride);
break;
}
case LayoutType_Int64:
{
int64_t int64Value;
ReadInt64(value, "Value", int64Value);
std::memcpy(ptrValue, reinterpret_cast<char*>(&int64Value), attribute.layoutStride);
break;
}
case LayoutType_Uint16:
{
uint16_t int16Value;
ReadUint16(value, "Value", int16Value);
std::memcpy(ptrValue, reinterpret_cast<char*>(&int16Value), attribute.layoutStride);
break;
}
case LayoutType_Uint32:
{
uint32_t int32Value;
ReadUint32(value, "Value", int32Value);
std::memcpy(ptrValue, reinterpret_cast<char*>(&int32Value), attribute.layoutStride);
break;
}
case LayoutType_Uint64:
{
uint64_t int64Value;
ReadUint64(value, "Value", int64Value);
std::memcpy(ptrValue, reinterpret_cast<char*>(&int64Value), attribute.layoutStride);
break;
}
case LayoutType_Vector2:
{
MathLib::Vector2 vector2Value;
ReadVector2(value, "Value", vector2Value);
std::memcpy(ptrValue, reinterpret_cast<char*>(&vector2Value), attribute.layoutStride);
break;
}
case LayoutType_Vector3:
{
MathLib::Vector3 vector3Value;
ReadVector3(value, "Value", vector3Value);
std::memcpy(ptrValue, reinterpret_cast<char*>(&vector3Value), attribute.layoutStride);
break;
}
case LayoutType_Vector4:
{
MathLib::Vector4 vector4Value;
ReadVector4(value, "Value", vector4Value);
std::memcpy(ptrValue, reinterpret_cast<char*>(&vector4Value), attribute.layoutStride);
break;
}
case LayoutType_Quaternion:
{
MathLib::Quaternion quaternionValue;
ReadQuaternion(value, "Value", quaternionValue);
std::memcpy(ptrValue, reinterpret_cast<char*>(&quaternionValue), attribute.layoutStride);
break;
}
}
offset += attribute.layoutStride;
return attribute;
}
bool Material::DeserializeFromFile(Material& material, AssetDeserializationFileData& value)
{
JsonFileParser jsonFileParser(value.filePath);
if (!jsonFileParser.IsValid())
{
return false;
}
MaterialConstantsLayout layout;
char* materialConstantBuffer = nullptr;
rapidjson::Document& document = jsonFileParser.GetDocument();
size_t layoutByteSize = 0;
// Deserializes the buffer layout with values.
if (document.HasMember("Layout"))
{
rapidjson::Value& layoutValue = document["Layout"].GetObject();
if (!ReadSize(layoutValue, "Size", layoutByteSize)
|| layoutByteSize <= 0)
{
return false;
}
materialConstantBuffer = new char[layoutByteSize];
size_t currentOffset = 0;
if (layoutValue.HasMember("Attributes"))
{
rapidjson::Value& attributes = layoutValue["Attributes"].GetArray();
for (rapidjson::SizeType i = 0; i < attributes.Size(); i++)
{
rapidjson::Value& attributeValue = attributes[i].GetObject();
MaterialConstantLayoutAttribute attribute
= LoadMaterialAttributeConstantLayoutType(attributeValue, materialConstantBuffer, currentOffset);
layout.layoutAttributes.push_back(attribute);
}
}
}
// Applies the material constants.
{
material.SetConstantsLayout(layout, layoutByteSize);
MaterialConstants& constants = material.GetMaterialConstants();
constants.SetRawBuffer(materialConstantBuffer);
delete[] materialConstantBuffer;
}
// Reads & Loads the shader from its GUID.
{
uint64_t shaderGUID;
ReadUint64(document, "Shader", shaderGUID);
std::filesystem::path assetPath = AssetManager::GetAssetMapper().GetPath(shaderGUID);
if (std::filesystem::exists(assetPath))
{
AssetManager::GetShaders().Load(material.m_shader, assetPath);
}
}
// Reads and loads the textures from its GUIDs.
{
uint64_t currentTextureGUID;
if (document.HasMember("Textures"))
{
ReadUint32(document, "NumTextures", material.m_numTextures);
rapidjson::Value& texturesArray = document["Textures"].GetArray();
for (uint32_t i = 0; i < material.m_numTextures; i++)
{
rapidjson::Value& textureValue = texturesArray[i].GetObject();
ReadUint64(textureValue, "GUID", currentTextureGUID);
if (currentTextureGUID != 0)
{
GUID guid(currentTextureGUID);
AssetRef<Texture> texture;
AssetManager::GetTextures().Load(texture,
AssetManager::GetAssetMapper().GetPath(guid));
material.SetTexture(i, texture);
}
}
}
}
return true;
}
bool Material::SerializeToFile(Material& material, AssetSerializationFileData& metaData)
{
// Writes to a material file.
JsonFileWriter fileWriter(metaData.filePath);
// Writes the constant buffer attribute layout.
{
fileWriter.BeginObject("Layout");
fileWriter.Write("Size", material.m_materialConstants.m_totalBufferSize);
fileWriter.BeginArray("Attributes");
for (auto& pair : material.m_materialConstants.m_materialConstants)
{
fileWriter.BeginObject();
fileWriter.Write("Name", pair.first);
fileWriter.Write<uint32_t>("Type", pair.second.layoutType);
fileWriter.Write<bool>("Pad", pair.second.pad);
// Writes the Value of the given type.
switch (pair.second.layoutType)
{
case LayoutType_Bool:
{
fileWriter.Write("Value",
*material.m_materialConstants.GetMaterialConstant<bool>(pair.first));
break;
}
case LayoutType_Float:
{
fileWriter.Write("Value",
*material.m_materialConstants.GetMaterialConstant<float>(pair.first));
break;
}
case LayoutType_Int16:
{
fileWriter.Write("Value",
*material.m_materialConstants.GetMaterialConstant<int16_t>(pair.first));
break;
}
case LayoutType_Int32:
{
fileWriter.Write("Value",
*material.m_materialConstants.GetMaterialConstant<int32_t>(pair.first));
break;
}
case LayoutType_Int64:
{
fileWriter.Write("Value",
*material.m_materialConstants.GetMaterialConstant<int64_t>(pair.first));
break;
}
case LayoutType_Uint16:
{
fileWriter.Write("Value",
*material.m_materialConstants.GetMaterialConstant<uint16_t>(pair.first));
break;
}
case LayoutType_Uint32:
{
fileWriter.Write("Value",
*material.m_materialConstants.GetMaterialConstant<uint32_t>(pair.first));
break;
}
case LayoutType_Uint64:
{
fileWriter.Write("Value",
*material.m_materialConstants.GetMaterialConstant<uint64_t>(pair.first));
break;
}
case LayoutType_Quaternion:
{
fileWriter.Write("Value",
*material.m_materialConstants.GetMaterialConstant<MathLib::Quaternion>(pair.first));
break;
}
case LayoutType_Vector2:
{
fileWriter.Write("Value",
*material.m_materialConstants.GetMaterialConstant<MathLib::Vector2>(pair.first));
break;
}
case LayoutType_Vector3:
{
fileWriter.Write("Value",
*material.m_materialConstants.GetMaterialConstant<MathLib::Vector3>(pair.first));
break;
}
case LayoutType_Vector4:
{
fileWriter.Write("Value",
*material.m_materialConstants.GetMaterialConstant<MathLib::Vector4>(pair.first));
break;
}
}
fileWriter.EndObject();
}
fileWriter.EndArray();
fileWriter.EndObject();
}
// Writes the shadedr to the json.
if (material.HasShader())
{
GUID shaderGUID;
material.m_shader.GetGUID(shaderGUID);
fileWriter.Write("Shader", (uint64_t)shaderGUID);
}
else
{
fileWriter.Write("Shader", 0);
}
// Writes the textures to a json.
{
fileWriter.Write("NumTextures", material.m_numTextures);
fileWriter.BeginArray("Textures");
GUID guid;
for (uint32_t i = 0; i < material.m_numTextures; i++)
{
MaterialTextureData materialTextureData = material.m_textures[i];
fileWriter.BeginObject();
if (materialTextureData.texture)
{
materialTextureData.texture.GetGUID(guid);
fileWriter.Write("GUID", (uint64_t)guid);
}
else
{
fileWriter.Write("GUID", 0);
}
fileWriter.EndObject();
}
fileWriter.EndArray();
}
fileWriter.Flush();
return true;
}
bool Material::SerializeToMetaFile(Material& material, AssetSerializationMetaFileData& metaData)
{
{
JsonFileWriter writer(metaData.metaFilePath);
writer.Write("GUID", (uint64_t)metaData.guid);
writer.Flush();
}
return true;
}
bool Material::DeserializeMetaFile(Material& material, AssetDeserializationMetaFileData& metaData)
{
return true;
}
#pragma endregion
Material* Material::Create(const MaterialConstantsLayout& constants)
{
return new Material(constants);
}
Material* Material::Create()
{
return new Material;
}
} | 26.692042 | 104 | 0.717332 | jkorn2324 |
b7d25d4fdfd33fa8369a9adfdd25ea05cccce789 | 10,593 | tcc | C++ | src/flens/symmetricmatrix.tcc | wmotte/toolkid | 2a8f82e1492c9efccde9a4935ce3019df1c68cde | [
"MIT"
] | null | null | null | src/flens/symmetricmatrix.tcc | wmotte/toolkid | 2a8f82e1492c9efccde9a4935ce3019df1c68cde | [
"MIT"
] | null | null | null | src/flens/symmetricmatrix.tcc | wmotte/toolkid | 2a8f82e1492c9efccde9a4935ce3019df1c68cde | [
"MIT"
] | null | null | null | /*
* Copyright (c) 2007, Michael Lehn
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1) Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2) Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3) Neither the name of the FLENS development group nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
namespace flens {
// == SyMatrix =================================================================
template <typename FS>
SyMatrix<FS>::SyMatrix()
{
}
template <typename FS>
SyMatrix<FS>::SyMatrix(int dim, StorageUpLo upLo, int firstIndex)
: _fs(dim, dim, firstIndex, firstIndex), _upLo(upLo)
{
}
template <typename FS>
SyMatrix<FS>::SyMatrix(const FS &fs, StorageUpLo upLo)
: _fs(fs), _upLo(upLo)
{
}
template <typename FS>
SyMatrix<FS>::SyMatrix(const SyMatrix<FS> &rhs)
: _fs(rhs.engine()), _upLo(rhs.upLo())
{
}
template <typename FS>
template <typename RHS>
SyMatrix<FS>::SyMatrix(const SyMatrix<RHS> &rhs)
: _fs(rhs.engine()), _upLo(rhs.upLo())
{
}
template <typename FS>
SyMatrix<FS>::SyMatrix(const TrMatrix<FS> &rhs)
: _fs(rhs.engine()), _upLo(rhs.upLo())
{
assert(rhs.unitDiag()==NonUnit);
}
template <typename FS>
template <typename RHS>
SyMatrix<FS>::SyMatrix(const TrMatrix<RHS> &rhs)
: _fs(rhs.engine()), _upLo(rhs.upLo())
{
assert(rhs.unitDiag()==NonUnit);
}
// -- operators ----------------------------------------------------------------
template <typename FS>
SyMatrix<FS> &
SyMatrix<FS>::operator*=(T alpha)
{
scal(alpha, *this);
return *this;
}
template <typename FS>
SyMatrix<FS> &
SyMatrix<FS>::operator/=(T alpha)
{
scal(T(1)/alpha, *this);
return *this;
}
template <typename FS>
const typename SyMatrix<FS>::T &
SyMatrix<FS>::operator()(int row, int col) const
{
#ifndef NDEBUG
if (_upLo==Upper) {
assert(col>=row);
} else {
assert(col<=row);
}
#endif
return _fs(row, col);
}
template <typename FS>
typename SyMatrix<FS>::T &
SyMatrix<FS>::operator()(int row, int col)
{
#ifndef NDEBUG
if (_upLo==Upper) {
assert(col>=row);
} else {
assert(col<=row);
}
#endif
return _fs(row, col);
}
// -- methods ------------------------------------------------------------------
// for BLAS/LAPACK
template <typename FS>
StorageUpLo
SyMatrix<FS>::upLo() const
{
return _upLo;
}
template <typename FS>
int
SyMatrix<FS>::dim() const
{
assert(_fs.numRows()==_fs.numCols());
return _fs.numRows();
}
template <typename FS>
int
SyMatrix<FS>::leadingDimension() const
{
return _fs.leadingDimension();
}
template <typename FS>
const typename SyMatrix<FS>::T *
SyMatrix<FS>::data() const
{
return _fs.data();
}
template <typename FS>
typename SyMatrix<FS>::T *
SyMatrix<FS>::data()
{
return _fs.data();
}
// for element access
template <typename FS>
int
SyMatrix<FS>::firstRow() const
{
return _fs.firstRow();
}
template <typename FS>
int
SyMatrix<FS>::lastRow() const
{
return _fs.lastRow();
}
template <typename FS>
int
SyMatrix<FS>::firstCol() const
{
return _fs.firstCol();
}
template <typename FS>
int
SyMatrix<FS>::lastCol() const
{
return _fs.lastCol();
}
template <typename FS>
Range
SyMatrix<FS>::rows() const
{
return _(firstRow(), lastRow());
}
template <typename FS>
Range
SyMatrix<FS>::cols() const
{
return _(firstCol(), lastCol());
}
// -- implementation -----------------------------------------------------------
template <typename FS>
const FS &
SyMatrix<FS>::engine() const
{
return _fs;
}
template <typename FS>
FS &
SyMatrix<FS>::engine()
{
return _fs;
}
// == SbMatrix =================================================================
template <typename BS>
SbMatrix<BS>::SbMatrix()
{
}
template <typename BS>
SbMatrix<BS>::SbMatrix(int dim, StorageUpLo upLo, int numOffDiags, int firstIndex)
: _bs(dim, dim,
(upLo==Lower) ? numOffDiags : 0,
(upLo==Upper) ? numOffDiags : 0,
firstIndex),
_upLo(upLo)
{
}
template <typename BS>
SbMatrix<BS>::SbMatrix(const BS &bs, StorageUpLo upLo)
: _bs(bs), _upLo(upLo)
{
}
template <typename BS>
SbMatrix<BS>::SbMatrix(const SbMatrix<BS> &rhs)
: _bs(rhs.engine()), _upLo(rhs.upLo())
{
}
template <typename BS>
template <typename RHS>
SbMatrix<BS>::SbMatrix(const SbMatrix<RHS> &rhs)
: _bs(rhs.engine()), _upLo(rhs.upLo())
{
}
template <typename BS>
SbMatrix<BS>::SbMatrix(const TbMatrix<BS> &rhs)
: _bs(rhs.engine()), _upLo(rhs.upLo())
{
assert(rhs.unitDiag()==NonUnit);
}
template <typename BS>
template <typename RHS>
SbMatrix<BS>::SbMatrix(const TbMatrix<RHS> &rhs)
: _bs(rhs.engine()), _upLo(rhs.upLo())
{
assert(rhs.unitDiag()==NonUnit);
}
// -- operators ----------------------------------------------------------------
template <typename BS>
SbMatrix<BS> &
SbMatrix<BS>::operator*=(T alpha)
{
scal(alpha, *this);
return *this;
}
template <typename BS>
SbMatrix<BS> &
SbMatrix<BS>::operator/=(T alpha)
{
scal(T(1)/alpha, *this);
return *this;
}
template <typename BS>
const typename SbMatrix<BS>::T &
SbMatrix<BS>::operator()(int row, int col) const
{
#ifndef NDEBUG
if (_upLo==Upper) {
assert(col>=row);
assert(col-row<=numOffDiags());
} else {
assert(col<=row);
assert(row-col<=numOffDiags());
}
#endif
return _bs(row, col);
}
template <typename BS>
typename SbMatrix<BS>::T &
SbMatrix<BS>::operator()(int row, int col)
{
#ifndef NDEBUG
if (_upLo==Upper) {
assert(col>=row);
assert(col-row<=numOffDiags());
} else {
assert(col<=row);
assert(row-col<=numOffDiags());
}
#endif
return _bs(row, col);
}
// -- views --------------------------------------------------------------------
template <typename BS>
typename SbMatrix<BS>::ConstVectorView
SbMatrix<BS>::diag(int d) const
{
return _bs.viewDiag(d);
}
template <typename BS>
typename SbMatrix<BS>::VectorView
SbMatrix<BS>::diag(int d)
{
return _bs.viewDiag(d);
}
// -- methods ------------------------------------------------------------------
// for BLAS/LAPACK
template <typename BS>
StorageUpLo
SbMatrix<BS>::upLo() const
{
return _upLo;
}
template <typename BS>
int
SbMatrix<BS>::dim() const
{
assert (_bs.numRows()==_bs.numCols());
return _bs.numRows();
}
template <typename BS>
int
SbMatrix<BS>::numOffDiags() const
{
return (_upLo==Upper) ? _bs.numSuperDiags()
: _bs.numSubDiags();
}
template <typename BS>
int
SbMatrix<BS>::leadingDimension() const
{
return _bs.leadingDimension();
}
template <typename BS>
const typename SbMatrix<BS>::T *
SbMatrix<BS>::data() const
{
return _bs.data();
}
template <typename BS>
typename SbMatrix<BS>::T *
SbMatrix<BS>::data()
{
return _bs.data();
}
// for element access
template <typename BS>
int
SbMatrix<BS>::firstIndex() const
{
return _bs.firstRow();
}
template <typename BS>
int
SbMatrix<BS>::lastIndex() const
{
assert(_bs.lastRow()==_bs.lastCol());
return _bs.lastRow();
}
template <typename BS>
Range
SbMatrix<BS>::indices() const
{
return _(firstIndex(), lastIndex());
}
template <typename BS>
Range
SbMatrix<BS>::diags() const
{
return (_upLo==Upper) ? _(0, numOffDiags())
: _(-numOffDiags(),0);
}
// -- implementation -----------------------------------------------------------
template <typename BS>
const BS &
SbMatrix<BS>::engine() const
{
return _bs;
}
template <typename BS>
BS &
SbMatrix<BS>::engine()
{
return _bs;
}
// == SpMatrix =================================================================
template <typename PS>
SpMatrix<PS>::SpMatrix()
{
}
template <typename PS>
SpMatrix<PS>::SpMatrix(int dim, int firstIndex)
: _ps(dim, firstIndex)
{
}
template <typename PS>
SpMatrix<PS>::SpMatrix(const PS &ps)
: _ps(ps)
{
}
// -- operators ----------------------------------------------------------------
template <typename PS>
const typename SpMatrix<PS>::T &
SpMatrix<PS>::operator()(int row, int col) const
{
return _ps(row, col);
}
template <typename PS>
typename SpMatrix<PS>::T &
SpMatrix<PS>::operator()(int row, int col)
{
return _ps(row, col);
}
// -- methods ------------------------------------------------------------------
// for BLAS/LAPACK
template <typename PS>
StorageUpLo
SpMatrix<PS>::upLo() const
{
return StorageInfo<PS>::upLo;
}
template <typename PS>
int
SpMatrix<PS>::dim() const
{
return _ps.dim();
}
template <typename PS>
const typename SpMatrix<PS>::T *
SpMatrix<PS>::data() const
{
return _ps.data();
}
template <typename PS>
typename SpMatrix<PS>::T *
SpMatrix<PS>::data()
{
return _ps.data();
}
// for element access
template <typename PS>
int
SpMatrix<PS>::firstIndex() const
{
return _ps.firstIndex();
}
template <typename PS>
int
SpMatrix<PS>::lastIndex() const
{
return _ps.lastIndex();
}
template <typename PS>
Range
SpMatrix<PS>::indices() const
{
return _(firstIndex(), lastIndex());
}
// -- implementation -----------------------------------------------------------
template <typename PS>
const PS &
SpMatrix<PS>::engine() const
{
return _ps;
}
template <typename PS>
PS &
SpMatrix<PS>::engine()
{
return _ps;
}
} // namespace flens
| 19.472426 | 82 | 0.608515 | wmotte |
b7da5088d7622a8874588da7d57077b61ee4e02d | 205 | hpp | C++ | random/shuffle_container.hpp | ankit6776/cplib-cpp | b9f8927a6c7301374c470856828aa1f5667d967b | [
"MIT"
] | 20 | 2021-06-21T00:18:54.000Z | 2022-03-17T17:45:44.000Z | random/shuffle_container.hpp | ankit6776/cplib-cpp | b9f8927a6c7301374c470856828aa1f5667d967b | [
"MIT"
] | 56 | 2021-06-03T14:42:13.000Z | 2022-03-26T14:15:30.000Z | random/shuffle_container.hpp | ankit6776/cplib-cpp | b9f8927a6c7301374c470856828aa1f5667d967b | [
"MIT"
] | 3 | 2019-12-11T06:45:45.000Z | 2020-09-07T13:45:32.000Z | #pragma once
#include <algorithm>
#include <chrono>
#include <random>
// CUT begin
std::mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
// std::shuffle(v.begin(), v.end(), rng);
| 22.777778 | 78 | 0.687805 | ankit6776 |
b7dc786a4ffac993a857123d5a525252eef56964 | 3,464 | cpp | C++ | lib/slikenet/Samples/CrashReporter/SendFileTo.cpp | TRUEPADDii/GothicMultiplayerLauncher | 1ae083a62c083fc99bb9b1358a223ae02174af3f | [
"WTFPL"
] | 2 | 2018-04-09T12:54:20.000Z | 2018-12-07T20:34:53.000Z | lib/slikenet/Samples/CrashReporter/SendFileTo.cpp | TRUEPADDii/GothicMultiplayerLauncher | 1ae083a62c083fc99bb9b1358a223ae02174af3f | [
"WTFPL"
] | 4 | 2018-04-10T23:28:47.000Z | 2021-05-16T20:35:21.000Z | lib/slikenet/Samples/CrashReporter/SendFileTo.cpp | TRUEPADDii/GothicMultiplayerLauncher | 1ae083a62c083fc99bb9b1358a223ae02174af3f | [
"WTFPL"
] | 3 | 2019-02-13T15:10:03.000Z | 2021-07-12T19:24:07.000Z | /*
* Original work: Copyright (c) 2014, Oculus VR, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* RakNet License.txt file in the licenses directory of this source tree. An additional grant
* of patent rights can be found in the RakNet Patents.txt file in the same directory.
*
*
* Modified work: Copyright (c) 2016-2017, SLikeSoft UG (haftungsbeschränkt)
*
* This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
* license found in the license.txt file in the root directory of this source tree.
*/
#include "slikenet/WindowsIncludes.h"
#include "SendFileTo.h"
#include <shlwapi.h>
#include <tchar.h>
#include <stdio.h>
#include <direct.h>
#include "slikenet/linux_adapter.h"
#include "slikenet/osx_adapter.h"
bool CSendFileTo::SendMail(HWND hWndParent, const char *strAttachmentFilePath, const char *strAttachmentFileName, const char *strSubject, const char *strBody, const char *strRecipient)
{
// if (strAttachmentFileName==0)
// return false;
// if (!hWndParent || !::IsWindow(hWndParent))
// return false;
HINSTANCE hMAPI = LoadLibrary(_T("MAPI32.DLL"));
if (!hMAPI)
return false;
ULONG (PASCAL *SendMail)(ULONG, ULONG_PTR, MapiMessage*, FLAGS, ULONG);
(FARPROC&)SendMail = GetProcAddress(hMAPI, "MAPISendMail");
if (!SendMail)
return false;
// char szFileName[_MAX_PATH];
// char szPath[_MAX_PATH];
char szName[_MAX_PATH];
char szSubject[_MAX_PATH];
char szBody[_MAX_PATH];
char szAddress[_MAX_PATH];
char szSupport[_MAX_PATH];
//strcpy_s(szFileName, strAttachmentFileName);
//strcpy_s(szPath, strAttachmentFilePath);
if (strAttachmentFileName)
strcpy_s(szName, strAttachmentFileName);
strcpy_s(szSubject, strSubject);
strcpy_s(szBody, strBody);
sprintf_s(szAddress, "SMTP:%s", strRecipient);
//strcpy_s(szSupport, "Support");
char fullPath[_MAX_PATH];
if (strAttachmentFileName && strAttachmentFilePath)
{
if (strlen(strAttachmentFilePath)<3 ||
strAttachmentFilePath[1]!=':' ||
(strAttachmentFilePath[2]!='\\' &&
strAttachmentFilePath[2]!='/'))
{
// Make relative paths absolute
_getcwd(fullPath, _MAX_PATH);
strcat_s(fullPath, "/");
strcat_s(fullPath, strAttachmentFilePath);
}
else
strcpy_s(fullPath, strAttachmentFilePath);
// All slashes have to be \\ and not /
int len=(unsigned int)strlen(fullPath);
int i;
for (i=0; i < len; i++)
{
if (fullPath[i]=='/')
fullPath[i]='\\';
}
}
MapiFileDesc fileDesc;
if (strAttachmentFileName && strAttachmentFilePath)
{
ZeroMemory(&fileDesc, sizeof(fileDesc));
fileDesc.nPosition = (ULONG)-1;
fileDesc.lpszPathName = fullPath;
fileDesc.lpszFileName = szName;
}
MapiRecipDesc recipDesc;
ZeroMemory(&recipDesc, sizeof(recipDesc));
recipDesc.lpszName = szSupport;
recipDesc.ulRecipClass = MAPI_TO;
recipDesc.lpszName = szAddress+5;
recipDesc.lpszAddress = szAddress;
MapiMessage message;
ZeroMemory(&message, sizeof(message));
message.nRecipCount = 1;
message.lpRecips = &recipDesc;
message.lpszSubject = szSubject;
message.lpszNoteText = szBody;
if (strAttachmentFileName && strAttachmentFilePath)
{
message.nFileCount = 1;
message.lpFiles = &fileDesc;
}
int nError = SendMail(0, (ULONG_PTR)hWndParent, &message, MAPI_LOGON_UI|MAPI_DIALOG, 0);
if (nError != SUCCESS_SUCCESS && nError != MAPI_USER_ABORT && nError != MAPI_E_LOGIN_FAILURE)
return false;
return true;
}
| 28.393443 | 184 | 0.727771 | TRUEPADDii |
b7df2a6c877b4767b8bb6d2ddca849ced1e90ee1 | 3,909 | cpp | C++ | src/Event.cpp | irov/GOAP | f8d5f061537019fccdd143b232aa8a869fdb0b2d | [
"MIT"
] | 14 | 2016-10-07T21:53:02.000Z | 2021-12-13T02:57:19.000Z | src/Event.cpp | irov/GOAP | f8d5f061537019fccdd143b232aa8a869fdb0b2d | [
"MIT"
] | null | null | null | src/Event.cpp | irov/GOAP | f8d5f061537019fccdd143b232aa8a869fdb0b2d | [
"MIT"
] | 4 | 2016-09-01T10:06:29.000Z | 2021-12-13T02:57:20.000Z | /*
* Copyright (C) 2017-2019, Yuriy Levchenko <[email protected]>
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
#include "Event.h"
#include "GOAP/EventProviderInterface.h"
#include "GOAP/StlAllocator.h"
#include <algorithm>
namespace GOAP
{
//////////////////////////////////////////////////////////////////////////
Event::Event( Allocator * _allocator )
: EventInterface( _allocator )
, m_providers( StlAllocator<ProviderDesc>( _allocator ) )
, m_providersAdd( StlAllocator<ProviderDesc>( _allocator ) )
, m_process( 0 )
{
}
//////////////////////////////////////////////////////////////////////////
Event::~Event()
{
}
//////////////////////////////////////////////////////////////////////////
void Event::addProvider( const EventProviderInterfacePtr & _eventProvider )
{
ProviderDesc desc;
desc.provider = _eventProvider;
desc.dead = false;
if( m_process == 0 )
{
m_providers.emplace_back( desc );
}
else
{
m_providersAdd.emplace_back( desc );
}
}
//////////////////////////////////////////////////////////////////////////
bool Event::removeProvider( const EventProviderInterfacePtr & _eventProvider )
{
VectorProviders::iterator it_found_add = std::find_if( m_providersAdd.begin(), m_providersAdd.end(), [&_eventProvider]( const Event::ProviderDesc & _desc )
{
return _desc.provider == _eventProvider;
} );
if( it_found_add != m_providersAdd.end() )
{
m_providersAdd.erase( it_found_add );
return true;
}
VectorProviders::iterator it_found = std::find_if( m_providers.begin(), m_providers.end(), [&_eventProvider]( const Event::ProviderDesc & _desc )
{
return _desc.provider == _eventProvider;
} );
if( it_found == m_providers.end() )
{
return false;
}
if( m_process == 0 )
{
m_providers.erase( it_found );
}
else
{
ProviderDesc & desc = *it_found;
desc.provider = nullptr;
desc.dead = true;
}
return true;
}
//////////////////////////////////////////////////////////////////////////
void Event::clearProviders()
{
m_providersAdd.clear();
if( m_process != 0 )
{
for( ProviderDesc & desc : m_providers )
{
desc.dead = true;
}
return;
}
m_providers.clear();
}
//////////////////////////////////////////////////////////////////////////
void Event::call()
{
this->incref();
++m_process;
for( const ProviderDesc & desc : m_providers )
{
if( desc.dead == true )
{
continue;
}
EventProviderInterfacePtr provider = desc.provider;
bool remove = provider->onEvent();
if( remove == false )
{
continue;
}
if( desc.dead == true )
{
continue;
}
this->removeProvider( provider );
}
--m_process;
if( m_process == 0 )
{
m_providers.insert( m_providers.end(), m_providersAdd.begin(), m_providersAdd.end() );
m_providersAdd.clear();
VectorProviders::iterator it_erase = std::remove_if( m_providers.begin(), m_providers.end(), []( const Event::ProviderDesc & _desc )
{
return _desc.dead;
} );
m_providers.erase( it_erase, m_providers.end() );
}
this->decref();
}
} | 26.06 | 163 | 0.458173 | irov |
b7e0f7e05b98aa6f773744013e4cf0c614dfe08c | 2,670 | cpp | C++ | cpp/template_test.cpp | dibayendu/codekata | 4055af08d3e8fd373e3dd8107f5bde82c74fe92f | [
"MIT"
] | null | null | null | cpp/template_test.cpp | dibayendu/codekata | 4055af08d3e8fd373e3dd8107f5bde82c74fe92f | [
"MIT"
] | null | null | null | cpp/template_test.cpp | dibayendu/codekata | 4055af08d3e8fd373e3dd8107f5bde82c74fe92f | [
"MIT"
] | null | null | null | // To run the program, try the command below:
// g++ tempate_test.cpp -lgtest_main -lgtest
// This is a template unit testing file using googletest.
// This checks if the number is prime and its factorials.
#include <iostream>
#include <string>
#include <limits.h>
#include "gtest/gtest.h"
// Returns n! (the factorial of n). For negative n, n! is defined to be 1.
int Factorial(int n) {
int result = 1;
for (int i = 1; i <= n; i++) {
result *= i;
}
return result;
}
// Returns true iff n is a prime number.
bool IsPrime(int n) {
// Trivial case 1: small numbers
if (n <= 1) return false;
// Trivial case 2: even numbers
if (n % 2 == 0) return n == 2;
// Now, we have that n is odd and n >= 3.
// Try to divide n by every odd number i, starting from 3
for (int i = 3; ; i += 2) {
// We only have to try i up to the squre root of n
if (i > n/i) break;
// Now, we have i <= n/i < n.
// If n is divisible by i, n is not prime.
if (n % i == 0) return false;
}
// n has no integer factor in the range (1, n), and thus is prime.
return true;
}
// Tests factorial of negative numbers.
TEST(FactorialTest, Negative) {
// This test is named "Negative", and belongs to the "FactorialTest"
// test case.
EXPECT_EQ(1, Factorial(-5));
EXPECT_EQ(1, Factorial(-1));
EXPECT_GT(Factorial(-10), 0);
// <TechnicalDetails>
//
// EXPECT_EQ(expected, actual) is the same as
//
// EXPECT_TRUE((expected) == (actual))
//
// except that it will print both the expected value and the actual
// value when the assertion fails. This is very helpful for
// debugging. Therefore in this case EXPECT_EQ is preferred.
//
// On the other hand, EXPECT_TRUE accepts any Boolean expression,
// and is thus more general.
//
// </TechnicalDetails>
}
// Tests factorial of 0.
TEST(FactorialTest, Zero) {
EXPECT_EQ(1, Factorial(0));
}
// Tests factorial of positive numbers.
TEST(FactorialTest, Positive) {
EXPECT_EQ(1, Factorial(1));
EXPECT_EQ(2, Factorial(2));
EXPECT_EQ(6, Factorial(3));
EXPECT_EQ(40320, Factorial(8));
}
// Tests IsPrime()
// Tests negative input.
TEST(IsPrimeTest, Negative) {
// This test belongs to the IsPrimeTest test case.
EXPECT_FALSE(IsPrime(-1));
EXPECT_FALSE(IsPrime(-2));
EXPECT_FALSE(IsPrime(INT_MIN));
}
// Tests some trivial cases.
TEST(IsPrimeTest, Trivial) {
EXPECT_FALSE(IsPrime(0));
EXPECT_FALSE(IsPrime(1));
EXPECT_TRUE(IsPrime(2));
EXPECT_TRUE(IsPrime(3));
}
// Tests positive input.
TEST(IsPrimeTest, Positive) {
EXPECT_FALSE(IsPrime(4));
EXPECT_TRUE(IsPrime(5));
EXPECT_FALSE(IsPrime(6));
EXPECT_TRUE(IsPrime(23));
}
| 24.054054 | 75 | 0.657678 | dibayendu |
b7e6c12b01031b53dc9cd82ceabda05ae7eeee86 | 2,074 | hpp | C++ | client/systems/adminPanel/dialog/markerLog.hpp | Exonical/Vanguard_Wasteland.cup_chernarus_A3 | ee8f51807847f35c924bb8bf701e863387b603b8 | [
"MIT"
] | 1 | 2020-07-23T13:49:05.000Z | 2020-07-23T13:49:05.000Z | client/systems/adminPanel/dialog/markerLog.hpp | Exonical/Vanguard_Wasteland.cup_chernarus_A3 | ee8f51807847f35c924bb8bf701e863387b603b8 | [
"MIT"
] | null | null | null | client/systems/adminPanel/dialog/markerLog.hpp | Exonical/Vanguard_Wasteland.cup_chernarus_A3 | ee8f51807847f35c924bb8bf701e863387b603b8 | [
"MIT"
] | null | null | null | // ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2016 A3Wasteland.com *
// ******************************************************************************************
// @file Name: markerLog.hpp
#define markerLogDialog 56500
#define markerLogList 56501
class MarkerLog
{
idd = markerLogDialog;
movingEnable = false;
enableSimulation = true;
onLoad = "execVM 'client\systems\adminPanel\markerLog.sqf'";
class controlsBackground {
class MainBackground: IGUIBack
{
idc = -1;
colorText[] = {1, 1, 1, 1};
colorBackground[] = {0,0,0,0.6};
x = 0.1875 * (4/3) * SZ_SCALE_ABS + safezoneX;
y = 0.15 * SZ_SCALE_ABS + safezoneY;
w = 0.625 * (4/3) * SZ_SCALE_ABS;
h = 0.661111 * SZ_SCALE_ABS;
};
class TopBar: IGUIBack
{
idc = -1;
colorText[] = {1, 1, 1, 1};
colorBackground[] = {A3W_UICOLOR_R, A3W_UICOLOR_G, A3W_UICOLOR_B, 0.8};
x = 0.1875 * (4/3) * SZ_SCALE_ABS + safezoneX;
y = 0.15 * SZ_SCALE_ABS + safezoneY;
w = 0.625 * (4/3) * SZ_SCALE_ABS;
h = 0.05 * SZ_SCALE_ABS;
};
class DialogTitleText: w_RscText
{
idc = -1;
text = "Markers Log";
font = "PuristaMedium";
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
x = 0.20 * (4/3) * SZ_SCALE_ABS + safezoneX;
y = 0.155 * SZ_SCALE_ABS + safezoneY;
w = 0.0844792 * (4/3) * SZ_SCALE_ABS;
h = 0.0448148 * SZ_SCALE_ABS;
};
};
class controls {
class MarkerListBox: w_RscList
{
idc = markerLogList;
x = 0.2 * (4/3) * SZ_SCALE_ABS + safezoneX;
y = 0.225 * SZ_SCALE_ABS + safezoneY;
w = 0.5925 * (4/3) * SZ_SCALE_ABS;
h = 0.5 * SZ_SCALE_ABS;
};
class RefreshButton: w_RscButton
{
idc = -1;
text = "Refresh";
onButtonClick = "call compile preprocessFileLineNumbers 'client\systems\adminPanel\markerLog.sqf'";
x = 0.2 * (4/3) * SZ_SCALE_ABS + safezoneX;
y = 0.748 * SZ_SCALE_ABS + safezoneY;
w = 0.05 * (4/3) * SZ_SCALE_ABS;
h = 0.04 * SZ_SCALE_ABS;
};
};
};
| 26.253165 | 102 | 0.563645 | Exonical |
b7ea14bebef43c6e0b4aae9f1f572d0768277454 | 6,589 | hxx | C++ | libbutl/char-scanner.hxx | build2/libbutl | 405dfa3e28ab71d4f6b5210faba0e3600070a0f3 | [
"MIT"
] | 6 | 2018-05-31T06:16:37.000Z | 2021-03-19T10:37:11.000Z | libbutl/char-scanner.hxx | build2/libbutl | 405dfa3e28ab71d4f6b5210faba0e3600070a0f3 | [
"MIT"
] | 3 | 2020-06-19T05:08:42.000Z | 2021-09-29T05:23:07.000Z | libbutl/char-scanner.hxx | build2/libbutl | 405dfa3e28ab71d4f6b5210faba0e3600070a0f3 | [
"MIT"
] | 1 | 2020-06-16T14:56:48.000Z | 2020-06-16T14:56:48.000Z | // file : libbutl/char-scanner.hxx -*- C++ -*-
// license : MIT; see accompanying LICENSE file
#pragma once
#include <string> // char_traits
#include <cassert>
#include <cstddef> // size_t
#include <cstdint> // uint64_t
#include <climits> // INT_*
#include <utility> // pair, make_pair()
#include <istream>
#include <libbutl/bufstreambuf.hxx>
#include <libbutl/export.hxx>
namespace butl
{
// Refer to utf8_validator for details.
//
struct noop_validator
{
std::pair<bool, bool>
validate (char) {return std::make_pair (true, true);}
std::pair<bool, bool>
validate (char c, std::string&) {return validate (c);}
};
// Low-level character stream scanner. Normally used as a base for
// higher-level lexers.
//
template <typename V = noop_validator, std::size_t N = 1>
class char_scanner
{
public:
using validator_type = V;
static constexpr const std::size_t unget_depth = N;
// If the crlf argument is true, then recognize Windows newlines (0x0D
// 0x0A) and convert them to just '\n' (0x0A). Note that a standalone
// 0x0D is treated "as if" it was followed by 0x0A and multiple 0x0D
// are treated as one.
//
// Note also that if the stream happens to be bufstreambuf-based, then it
// includes a number of optimizations that assume nobody else is messing
// with the stream.
//
// The line and position arguments can be used to override the start line
// and position in the stream (useful when re-scanning data saved with the
// save_* facility).
//
char_scanner (std::istream&,
bool crlf = true,
std::uint64_t line = 1,
std::uint64_t position = 0);
char_scanner (std::istream&,
validator_type,
bool crlf = true,
std::uint64_t line = 1,
std::uint64_t position = 0);
char_scanner (const char_scanner&) = delete;
char_scanner& operator= (const char_scanner&) = delete;
// Scanner interface.
//
public:
// Extended character. It includes line/column/position information and is
// capable of representing EOF and invalid characters.
//
// Note that implicit conversion of EOF/invalid to char_type results in
// NUL character (which means in most cases it is safe to compare xchar to
// char without checking for EOF).
//
class xchar
{
public:
using traits_type = std::char_traits<char>;
using int_type = traits_type::int_type;
using char_type = traits_type::char_type;
int_type value;
// Note that the column is of the codepoint this byte belongs to.
//
std::uint64_t line;
std::uint64_t column;
// Logical character position (see bufstreambuf for details on the
// logical part) if the scanned stream is bufstreambuf-based and always
// zero otherwise.
//
std::uint64_t position;
static int_type
invalid () {return traits_type::eof () != INT_MIN ? INT_MIN : INT_MAX;}
operator char_type () const
{
return value != traits_type::eof () && value != invalid ()
? static_cast<char_type> (value)
: char_type (0);
}
xchar (int_type v = 0,
std::uint64_t l = 0,
std::uint64_t c = 0,
std::uint64_t p = 0)
: value (v), line (l), column (c), position (p) {}
};
// Note that if any of the get() or peek() functions return an invalid
// character, then the scanning has failed and none of them should be
// called again.
xchar
get ();
// As above but in case of an invalid character also return the
// description of why it is invalid.
//
xchar
get (std::string& what);
void
get (const xchar& peeked); // Get previously peeked character (faster).
void
unget (const xchar&);
// Note that if there is an "ungot" character, peek() will return that.
//
xchar
peek ();
// As above but in case of an invalid character also return the
// description of why it is invalid.
//
xchar
peek (std::string& what);
// Tests. In the future we can add tests line alpha(), alnum(), etc.
//
static bool
eos (const xchar& c) {return c.value == xchar::traits_type::eof ();}
static bool
invalid (const xchar& c) {return c.value == xchar::invalid ();}
// Line, column and position of the next character to be extracted from
// the stream by peek() or get().
//
std::uint64_t line;
std::uint64_t column;
std::uint64_t position;
// Ability to save raw data as it is being scanned. Note that the
// character is only saved when it is got, not peeked.
//
public:
void
save_start (std::string& b)
{
assert (save_ == nullptr);
save_ = &b;
}
void
save_stop ()
{
assert (save_ != nullptr);
save_ = nullptr;
}
struct save_guard
{
explicit
save_guard (char_scanner& s, std::string& b): s_ (&s) {s.save_start (b);}
void
stop () {if (s_ != nullptr) {s_->save_stop (); s_ = nullptr;}}
~save_guard () {stop ();}
private:
char_scanner* s_;
};
protected:
using int_type = typename xchar::int_type;
using char_type = typename xchar::char_type;
int_type
peek_ ();
void
get_ ();
std::uint64_t
pos_ () const;
xchar
get (std::string* what);
xchar
peek (std::string* what);
protected:
std::istream& is_;
validator_type val_;
bool decoded_ = true; // The peeked character is last byte of sequence.
bool validated_ = false; // The peeked character has been validated.
// Note that if you are reading from the buffer directly, then it is also
// your responsibility to call the validator and save the data (see
// save_*().
//
// Besides that, make sure that the peek() call preceding the scan is
// followed by the get() call (see validated_, decoded_, and unpeek_ for
// the hairy details; realistically, you would probably only direct-scan
// ASCII fragments).
//
bufstreambuf* buf_; // NULL if not bufstreambuf-based.
const char_type* gptr_;
const char_type* egptr_;
std::string* save_ = nullptr;
bool crlf_;
bool eos_ = false;
std::size_t ungetn_ = 0;
xchar ungetb_[N];
bool unpeek_ = false;
xchar unpeekc_ = '\0';
};
}
#include <libbutl/char-scanner.ixx>
#include <libbutl/char-scanner.txx>
| 26.676113 | 79 | 0.615116 | build2 |
b7f16117c343d641e1dc1375ef028ab26ede9c8f | 1,131 | hpp | C++ | code/binary/include/binary/implementations/simple_heap_buffer.hpp | afxres/binary-cxx | ef84b0d5324c5add5ea8a09340471efc6221f91f | [
"MIT"
] | 1 | 2019-11-21T06:37:04.000Z | 2019-11-21T06:37:04.000Z | code/binary/include/binary/implementations/simple_heap_buffer.hpp | afxres/binary-cxx | ef84b0d5324c5add5ea8a09340471efc6221f91f | [
"MIT"
] | null | null | null | code/binary/include/binary/implementations/simple_heap_buffer.hpp | afxres/binary-cxx | ef84b0d5324c5add5ea8a09340471efc6221f91f | [
"MIT"
] | 1 | 2019-11-26T16:47:56.000Z | 2019-11-26T16:47:56.000Z | #pragma once
#include "../abstract_buffer.hpp"
namespace mikodev::binary::implementations
{
class simple_heap_buffer final : public abstract_buffer
{
private:
byte_ptr buffer_;
simple_heap_buffer(byte_ptr buffer, length_t length) : abstract_buffer(length), buffer_(buffer) {}
public:
simple_heap_buffer() : simple_heap_buffer(nullptr, 0) {}
virtual byte_ptr buffer() override { return buffer_; }
virtual ~simple_heap_buffer() override
{
if (buffer_ == nullptr)
return;
std::free(reinterpret_cast<void*>(buffer_));
buffer_ = nullptr;
}
virtual abstract_buffer_ptr create(length_t length) override
{
if (length == 0)
return std::make_shared<simple_heap_buffer>();
byte_ptr buffer = reinterpret_cast<byte_ptr>(std::malloc(length));
if (buffer == nullptr)
exceptions::throw_helper::throw_out_of_memory();
return std::shared_ptr<simple_heap_buffer>(new simple_heap_buffer(buffer, length));
}
};
}
| 29.763158 | 106 | 0.617153 | afxres |
b7f779cc464e7d28a2721bad28df55d3bc650144 | 320 | cpp | C++ | VTable/Multiple_Inheritance/Child.cpp | PanagiotisDrakatos/Memory-Management-and-Advanced-Debugging-techniques | d0b9c6f6a43ba64781c859175a092d86f1ab784d | [
"MIT"
] | 25 | 2019-02-01T00:57:50.000Z | 2020-12-21T04:40:21.000Z | VTable/Multiple_Inheritance/Child.cpp | PanagiotisDrakatos/Memory-Management-and-Advanced-Debugging-techniques | d0b9c6f6a43ba64781c859175a092d86f1ab784d | [
"MIT"
] | null | null | null | VTable/Multiple_Inheritance/Child.cpp | PanagiotisDrakatos/Memory-Management-and-Advanced-Debugging-techniques | d0b9c6f6a43ba64781c859175a092d86f1ab784d | [
"MIT"
] | 2 | 2019-02-01T04:08:01.000Z | 2019-11-09T16:07:26.000Z | #include "Mother.cpp"
#include "Father.cpp"
class Child : public Mother, public Father {
public:
Child(){cout<<"Child constructor was called "<<endl<<endl;}
virtual void ChildMethod() {cout<<"Child::ChildMethod()"<<endl;}
void FatherFoo() override {cout<<"Child::FatherFoo()"<<endl;}
int child_data;
};
| 29.090909 | 68 | 0.675 | PanagiotisDrakatos |
b7f891a7ba52853c9a643b7027f065ab819ad0e3 | 7,570 | cpp | C++ | src/guidance/segregated_intersection_classification.cpp | aweatherlycap1/osrm-backend | 31d6d74f90fa760aa8d1f312c2593dabcbc9a69b | [
"BSD-2-Clause"
] | null | null | null | src/guidance/segregated_intersection_classification.cpp | aweatherlycap1/osrm-backend | 31d6d74f90fa760aa8d1f312c2593dabcbc9a69b | [
"BSD-2-Clause"
] | null | null | null | src/guidance/segregated_intersection_classification.cpp | aweatherlycap1/osrm-backend | 31d6d74f90fa760aa8d1f312c2593dabcbc9a69b | [
"BSD-2-Clause"
] | 1 | 2019-09-23T22:49:07.000Z | 2019-09-23T22:49:07.000Z | #include "guidance/segregated_intersection_classification.hpp"
#include "extractor/intersection/coordinate_extractor.hpp"
#include "extractor/node_based_graph_factory.hpp"
#include "util/coordinate_calculation.hpp"
#include "util/name_table.hpp"
namespace osrm
{
namespace guidance
{
namespace RoadPriorityClass = extractor::RoadPriorityClass;
struct EdgeInfo
{
NodeID node;
util::StringView name;
// 0 - outgoing (forward), 1 - incoming (reverse), 2 - both outgoing and incoming
int direction;
extractor::ClassData road_class;
RoadPriorityClass::Enum road_priority_class;
struct LessName
{
bool operator()(EdgeInfo const &e1, EdgeInfo const &e2) const { return e1.name < e2.name; }
};
};
bool IsSegregated(std::vector<EdgeInfo> v1,
std::vector<EdgeInfo> v2,
EdgeInfo const ¤t,
double edgeLength)
{
if (v1.size() < 2 || v2.size() < 2)
return false;
auto const sort_by_name_fn = [](std::vector<EdgeInfo> &v) {
std::sort(v.begin(), v.end(), EdgeInfo::LessName());
};
sort_by_name_fn(v1);
sort_by_name_fn(v2);
// Internal edge with the name should be connected with any other neibour edge with the same
// name, e.g. isolated edge with unique name is not segregated.
// b - 'b' road continues here
// |
// - - a - |
// b - segregated edge
// - - a - |
if (!current.name.empty())
{
auto const findNameFn = [¤t](std::vector<EdgeInfo> const &v) {
return std::binary_search(v.begin(), v.end(), current, EdgeInfo::LessName());
};
if (!findNameFn(v1) && !findNameFn(v2))
return false;
}
// set_intersection like routine to get equal result pairs
std::vector<std::pair<EdgeInfo const *, EdgeInfo const *>> commons;
auto i1 = v1.begin();
auto i2 = v2.begin();
while (i1 != v1.end() && i2 != v2.end())
{
if (i1->name == i2->name)
{
if (!i1->name.empty())
commons.push_back(std::make_pair(&(*i1), &(*i2)));
++i1;
++i2;
}
else if (i1->name < i2->name)
++i1;
else
++i2;
}
if (commons.size() < 2)
return false;
auto const check_equal_class = [](std::pair<EdgeInfo const *, EdgeInfo const *> const &e) {
// Or (e.first->road_class & e.second->road_class != 0)
return e.first->road_class == e.second->road_class;
};
size_t equal_class_count = 0;
for (auto const &e : commons)
if (check_equal_class(e))
++equal_class_count;
if (equal_class_count < 2)
return false;
auto const get_length_threshold = [](EdgeInfo const *e) {
switch (e->road_priority_class)
{
case RoadPriorityClass::MOTORWAY:
case RoadPriorityClass::TRUNK:
return 30.0;
case RoadPriorityClass::PRIMARY:
return 20.0;
case RoadPriorityClass::SECONDARY:
case RoadPriorityClass::TERTIARY:
return 10.0;
default:
return 5.0;
}
};
double threshold = std::numeric_limits<double>::max();
for (auto const &e : commons)
threshold =
std::min(threshold, get_length_threshold(e.first) + get_length_threshold(e.second));
return edgeLength <= threshold;
}
std::unordered_set<EdgeID> findSegregatedNodes(const extractor::NodeBasedGraphFactory &factory,
const util::NameTable &names)
{
auto const &graph = factory.GetGraph();
auto const &annotation = factory.GetAnnotationData();
extractor::intersection::CoordinateExtractor coordExtractor(
graph, factory.GetCompressedEdges(), factory.GetCoordinates());
auto const get_edge_length = [&](NodeID from_node, EdgeID edgeID, NodeID to_node) {
auto const geom = coordExtractor.GetCoordinatesAlongRoad(from_node, edgeID, false, to_node);
double length = 0.0;
for (size_t i = 1; i < geom.size(); ++i)
{
length += util::coordinate_calculation::haversineDistance(geom[i - 1], geom[i]);
}
return length;
};
auto const get_edge_info = [&](NodeID node, auto const &edgeData) -> EdgeInfo {
/// @todo Make string normalization/lowercase/trim for comparison ...
auto const id = annotation[edgeData.annotation_data].name_id;
BOOST_ASSERT(id != INVALID_NAMEID);
auto const name = names.GetNameForID(id);
return {node,
name,
edgeData.reversed ? 1 : 0,
annotation[edgeData.annotation_data].classes,
edgeData.flags.road_classification.GetClass()};
};
auto const collect_edge_info_fn = [&](auto const &edges1, NodeID node2) {
std::vector<EdgeInfo> info;
for (auto const &e : edges1)
{
NodeID const target = graph.GetTarget(e);
if (target == node2)
continue;
info.push_back(get_edge_info(target, graph.GetEdgeData(e)));
}
if (info.empty())
return info;
std::sort(info.begin(), info.end(), [](EdgeInfo const &e1, EdgeInfo const &e2) {
return e1.node < e2.node;
});
// Merge equal infos with correct direction.
auto curr = info.begin();
auto next = curr;
while (++next != info.end())
{
if (curr->node == next->node)
{
BOOST_ASSERT(curr->name == next->name);
BOOST_ASSERT(curr->road_class == next->road_class);
BOOST_ASSERT(curr->direction != next->direction);
curr->direction = 2;
}
else
curr = next;
}
info.erase(
std::unique(info.begin(),
info.end(),
[](EdgeInfo const &e1, EdgeInfo const &e2) { return e1.node == e2.node; }),
info.end());
return info;
};
auto const isSegregatedFn = [&](auto const &edgeData,
auto const &edges1,
NodeID node1,
auto const &edges2,
NodeID node2,
double edgeLength) {
return IsSegregated(collect_edge_info_fn(edges1, node2),
collect_edge_info_fn(edges2, node1),
get_edge_info(node1, edgeData),
edgeLength);
};
std::unordered_set<EdgeID> segregated_edges;
for (NodeID sourceID = 0; sourceID < graph.GetNumberOfNodes(); ++sourceID)
{
auto const sourceEdges = graph.GetAdjacentEdgeRange(sourceID);
for (EdgeID edgeID : sourceEdges)
{
auto const &edgeData = graph.GetEdgeData(edgeID);
if (edgeData.reversed)
continue;
NodeID const targetID = graph.GetTarget(edgeID);
auto const targetEdges = graph.GetAdjacentEdgeRange(targetID);
double const length = get_edge_length(sourceID, edgeID, targetID);
if (isSegregatedFn(edgeData, sourceEdges, sourceID, targetEdges, targetID, length))
segregated_edges.insert(edgeID);
}
}
return segregated_edges;
}
} // namespace guidance
} // namespace osrm
| 31.02459 | 100 | 0.561691 | aweatherlycap1 |
b7fe36fbf03d79dc8d8d22506dc21257c2ac1cb6 | 1,669 | inl | C++ | Shared/Base/Serialize/SerializableFactory.inl | LukaszByczynski/tbl-4edges | 11f8c2a1e40271c542321d9d4d0e4ed24cce92c8 | [
"MIT"
] | 21 | 2015-07-19T13:47:17.000Z | 2022-03-13T11:13:28.000Z | Shared/Base/Serialize/SerializableFactory.inl | theblacklotus/4edges | 11f8c2a1e40271c542321d9d4d0e4ed24cce92c8 | [
"MIT"
] | 1 | 2018-03-24T17:54:49.000Z | 2018-03-24T17:57:01.000Z | Shared/Base/Serialize/SerializableFactory.inl | jsvennevid/tbl-4edges | 11f8c2a1e40271c542321d9d4d0e4ed24cce92c8 | [
"MIT"
] | 2 | 2019-02-07T20:42:13.000Z | 2021-02-10T07:09:47.000Z | inline SerializableFactory::SerializableFactory(Identifier host, Identifier type, u32 size) : m_host(host), m_type(type), m_size(size), m_next(ms_first), m_structures(0)
{
ms_first = this;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
inline SerializableFactory::Identifier SerializableFactory::host() const
{
return m_host;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
inline SerializableFactory::Identifier SerializableFactory::type() const
{
return m_type;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
inline u32 SerializableFactory::size() const
{
return m_size;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
inline SerializableFactory* SerializableFactory::next() const
{
return m_next;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
inline SerializableFactory* SerializableFactory::first()
{
return ms_first;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
inline void SerializableFactory::setStructures(SerializableStructure* structures)
{
m_structures = structures;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
inline SerializableStructure* SerializableFactory::structures() const
{
return m_structures;
}
| 30.345455 | 169 | 0.388856 | LukaszByczynski |
4d0401bd5bb069de1dbc19d7e90723d4de2e9594 | 4,065 | cpp | C++ | build/cpp_test/src/haxe/CallStack.cpp | TomBebb/hxecs | 80620512df7b32d70f1b59facdf8f6349192a166 | [
"BSD-3-Clause"
] | null | null | null | build/cpp_test/src/haxe/CallStack.cpp | TomBebb/hxecs | 80620512df7b32d70f1b59facdf8f6349192a166 | [
"BSD-3-Clause"
] | null | null | null | build/cpp_test/src/haxe/CallStack.cpp | TomBebb/hxecs | 80620512df7b32d70f1b59facdf8f6349192a166 | [
"BSD-3-Clause"
] | null | null | null | // Generated by Haxe 3.4.7
#include <hxcpp.h>
#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_haxe_CallStack
#include <haxe/CallStack.h>
#endif
#ifndef INCLUDED_haxe_StackItem
#include <haxe/StackItem.h>
#endif
namespace haxe{
void CallStack_obj::__construct() { }
Dynamic CallStack_obj::__CreateEmpty() { return new CallStack_obj; }
void *CallStack_obj::_hx_vtable = 0;
Dynamic CallStack_obj::__Create(hx::DynamicArray inArgs)
{
hx::ObjectPtr< CallStack_obj > _hx_result = new CallStack_obj();
_hx_result->__construct();
return _hx_result;
}
bool CallStack_obj::_hx_isInstanceOf(int inClassId) {
return inClassId==(int)0x00000001 || inClassId==(int)0x6207a884;
}
::Array< ::Dynamic> CallStack_obj::exceptionStack(){
::Array< ::String > s = ::__hxcpp_get_exception_stack();
return ::haxe::CallStack_obj::makeStack(s);
}
STATIC_HX_DEFINE_DYNAMIC_FUNC0(CallStack_obj,exceptionStack,return )
::Array< ::Dynamic> CallStack_obj::makeStack(::Array< ::String > s){
::Array< ::String > stack = s;
::Array< ::Dynamic> m = ::Array_obj< ::Dynamic>::__new();
{
int _g = (int)0;
while((_g < stack->length)){
::String func = stack->__get(_g);
_g = (_g + (int)1);
::Array< ::String > words = func.split(HX_("::",c0,32,00,00));
if ((words->length == (int)0)) {
m->push(::haxe::StackItem_obj::CFunction_dyn());
}
else {
if ((words->length == (int)2)) {
m->push(::haxe::StackItem_obj::Method(words->__get((int)0),words->__get((int)1)));
}
else {
if ((words->length == (int)4)) {
::haxe::StackItem _hx_tmp = ::haxe::StackItem_obj::Method(words->__get((int)0),words->__get((int)1));
::String words1 = words->__get((int)2);
m->push(::haxe::StackItem_obj::FilePos(_hx_tmp,words1,::Std_obj::parseInt(words->__get((int)3))));
}
}
}
}
}
return m;
}
STATIC_HX_DEFINE_DYNAMIC_FUNC1(CallStack_obj,makeStack,return )
CallStack_obj::CallStack_obj()
{
}
bool CallStack_obj::__GetStatic(const ::String &inName, Dynamic &outValue, hx::PropertyAccess inCallProp)
{
switch(inName.length) {
case 9:
if (HX_FIELD_EQ(inName,"makeStack") ) { outValue = makeStack_dyn(); return true; }
break;
case 14:
if (HX_FIELD_EQ(inName,"exceptionStack") ) { outValue = exceptionStack_dyn(); return true; }
}
return false;
}
#if HXCPP_SCRIPTABLE
static hx::StorageInfo *CallStack_obj_sMemberStorageInfo = 0;
static hx::StaticInfo *CallStack_obj_sStaticStorageInfo = 0;
#endif
static void CallStack_obj_sMarkStatics(HX_MARK_PARAMS) {
HX_MARK_MEMBER_NAME(CallStack_obj::__mClass,"__mClass");
};
#ifdef HXCPP_VISIT_ALLOCS
static void CallStack_obj_sVisitStatics(HX_VISIT_PARAMS) {
HX_VISIT_MEMBER_NAME(CallStack_obj::__mClass,"__mClass");
};
#endif
hx::Class CallStack_obj::__mClass;
static ::String CallStack_obj_sStaticFields[] = {
HX_HCSTRING("exceptionStack","\x79","\x48","\x56","\x0b"),
HX_HCSTRING("makeStack","\x7a","\xde","\xa3","\x57"),
::String(null())
};
void CallStack_obj::__register()
{
hx::Object *dummy = new CallStack_obj;
CallStack_obj::_hx_vtable = *(void **)dummy;
hx::Static(__mClass) = new hx::Class_obj();
__mClass->mName = HX_HCSTRING("haxe.CallStack","\x62","\x4b","\x54","\x6d");
__mClass->mSuper = &super::__SGetClass();
__mClass->mConstructEmpty = &__CreateEmpty;
__mClass->mConstructArgs = &__Create;
__mClass->mGetStaticField = &CallStack_obj::__GetStatic;
__mClass->mSetStaticField = &hx::Class_obj::SetNoStaticField;
__mClass->mMarkFunc = CallStack_obj_sMarkStatics;
__mClass->mStatics = hx::Class_obj::dupFunctions(CallStack_obj_sStaticFields);
__mClass->mMembers = hx::Class_obj::dupFunctions(0 /* sMemberFields */);
__mClass->mCanCast = hx::TCanCast< CallStack_obj >;
#ifdef HXCPP_VISIT_ALLOCS
__mClass->mVisitFunc = CallStack_obj_sVisitStatics;
#endif
#ifdef HXCPP_SCRIPTABLE
__mClass->mMemberStorageInfo = CallStack_obj_sMemberStorageInfo;
#endif
#ifdef HXCPP_SCRIPTABLE
__mClass->mStaticStorageInfo = CallStack_obj_sStaticStorageInfo;
#endif
hx::_hx_RegisterClass(__mClass->mName, __mClass);
}
} // end namespace haxe
| 28.626761 | 108 | 0.717835 | TomBebb |
4d056b04fd4b4676573d90552810a11c624bf9d8 | 28,547 | cpp | C++ | src/tpe_flow_sc.cpp | duxingyi-charles/repulsive-curves | a2e7729357cf25de4147fbfaa17a039c57b13a7a | [
"MIT"
] | null | null | null | src/tpe_flow_sc.cpp | duxingyi-charles/repulsive-curves | a2e7729357cf25de4147fbfaa17a039c57b13a7a | [
"MIT"
] | null | null | null | src/tpe_flow_sc.cpp | duxingyi-charles/repulsive-curves | a2e7729357cf25de4147fbfaa17a039c57b13a7a | [
"MIT"
] | null | null | null | #include "tpe_flow_sc.h"
#include "utils.h"
#include "product/dense_matrix.h"
#include "circle_search.h"
namespace LWS {
TPEFlowSolverSC::TPEFlowSolverSC(PolyCurveNetwork* g, double a, double b) : constraint(g)
{
curveNetwork = g;
alpha = a;
beta = b;
ls_step_threshold = 1e-15;
backproj_threshold = 1e-4;
iterNum = 0;
lastStepSize = 0;
mg_tolerance = 1e-2;
double averageLength = g->TotalLength();
averageLength /= g->NumEdges();
mg_backproj_threshold = fmin(1e-4, averageLength * mg_tolerance * 1e-2);
std::cout << "Multigrid backprojection threshold set to " << mg_backproj_threshold << std::endl;
UpdateTargetLengths();
useEdgeLengthScale = false;
useTotalLengthScale = false;
perfLogEnabled = false;
}
TPEFlowSolverSC::~TPEFlowSolverSC() {
for (size_t i = 0; i < obstacles.size(); i++) {
delete obstacles[i];
}
obstacles.clear();
}
void TPEFlowSolverSC::UpdateTargetLengths() {
constraint.UpdateTargetValues(constraintTargets);
}
void TPEFlowSolverSC::ReplaceCurve(PolyCurveNetwork* new_p) {
curveNetwork = new_p;
constraint = ConstraintClassType(curveNetwork);
UpdateTargetLengths();
if (useEdgeLengthScale) {
double averageLength = curveNetwork->TotalLength() / curveNetwork->NumEdges();
lengthScaleStep = averageLength / 100;
}
}
void TPEFlowSolverSC::EnablePerformanceLog(std::string logFile) {
perfFile.open(logFile);
perfLogEnabled = true;
std::cout << "Started logging performance to " << logFile << std::endl;
}
void TPEFlowSolverSC::ClosePerformanceLog() {
perfFile.close();
}
void TPEFlowSolverSC::SetTotalLengthScaleTarget(double scale) {
useTotalLengthScale = true;
int startIndex = constraint.startIndexOfConstraint(ConstraintType::TotalLength);
if (startIndex < 0) {
useTotalLengthScale = false;
std::cout << "No total length constraint; ignoring total length scale" << std::endl;
return;
}
double len = curveNetwork->TotalLength();
targetLength = scale * len;
lengthScaleStep = len / 100;
}
void TPEFlowSolverSC::SetEdgeLengthScaleTarget(double scale) {
useEdgeLengthScale = true;
int startIndex = constraint.startIndexOfConstraint(ConstraintType::EdgeLengths);
if (startIndex < 0) {
useEdgeLengthScale = false;
std::cout << "No edge length constraint; ignoring edge length scale" << std::endl;
return;
}
targetLength = scale * curveNetwork->TotalLength();
std::cout << "Setting target length to " << targetLength << " (" << scale << " times original)" << std::endl;
double averageLength = curveNetwork->TotalLength() / curveNetwork->NumEdges();
lengthScaleStep = averageLength / 100;
}
double TPEFlowSolverSC::CurrentEnergy(SpatialTree *root) {
double energy = 0;
if (root) energy = TPEnergyBH(root);
else energy = TPEnergyDirect();
for (CurvePotential* p : potentials) {
energy += p->CurrentValue(curveNetwork);
}
for (Obstacle* obs : obstacles) {
energy += obs->ComputeEnergy(curveNetwork);
}
return energy;
}
double TPEFlowSolverSC::TPEnergyDirect() {
return TPESC::tpe_total(curveNetwork, alpha, beta);
}
double TPEFlowSolverSC::TPEnergyBH(SpatialTree *root)
{
return SpatialTree::TPEnergyBH(curveNetwork, root, alpha, beta);
}
void TPEFlowSolverSC::FillGradientVectorDirect(Eigen::MatrixXd &gradients) {
TPESC::FillGradientVectorDirect(curveNetwork, gradients, alpha, beta);
}
void TPEFlowSolverSC::FillGradientVectorBH(SpatialTree *root, Eigen::MatrixXd &gradients) {
// Use the spatial tree and Barnes-Hut to evaluate the gradient
SpatialTree::TPEGradientBarnesHut(curveNetwork, root, gradients, alpha, beta);
}
void TPEFlowSolverSC::AddAllGradients(SpatialTree *tree_root, Eigen::MatrixXd &vertGradients) {
// Barnes-Hut for gradient accumulation
if (tree_root) {
FillGradientVectorBH(tree_root, vertGradients);
}
else {
FillGradientVectorDirect(vertGradients);
}
// Add gradient contributions from obstacles
for (Obstacle* obs : obstacles) {
obs->AddGradient(curveNetwork, vertGradients);
}
// Add gradient contributions from potentials
for (CurvePotential* p : potentials) {
p->AddGradient(curveNetwork, vertGradients);
}
}
bool TPEFlowSolverSC::StepNaive(double h) {
// Takes a fixed time step h using the L2 gradient
int nVerts = curveNetwork->NumVertices();
Eigen::MatrixXd gradients(nVerts, 3);
gradients.setZero();
// FillGradientVectorDirect(gradients);
AddAllGradients(0, gradients);
for (int i = 0; i < nVerts; i++) {
CurveVertex* pt = curveNetwork->GetVertex(i);
pt->SetPosition(pt->Position() - h * SelectRow(gradients, i));
}
return true;
}
void TPEFlowSolverSC::SaveCurrentPositions() {
originalPositionMatrix = curveNetwork->positions;
}
void TPEFlowSolverSC::RestoreOriginalPositions() {
curveNetwork->positions = originalPositionMatrix;
}
void TPEFlowSolverSC::SetGradientStep(Eigen::MatrixXd &gradient, double delta) {
curveNetwork->positions = originalPositionMatrix - delta * gradient;
}
double TPEFlowSolverSC::LineSearchStep(Eigen::MatrixXd &gradient, double gradDot, BVHNode3D* root, bool resetStep) {
double gradNorm = gradient.norm();
//std::cout << "Norm of gradient = " << gradNorm << std::endl;
double initGuess = (gradNorm > 1) ? 1.0 / gradNorm : 1.0 / sqrt(gradNorm);
// Use the step size from the previous iteration, if it exists
if (!resetStep && lastStepSize > fmax(ls_step_threshold, 1e-5)) {
initGuess = fmin(lastStepSize * 1.5, initGuess * 4);
}
std::cout << " Starting line search with initial guess " << initGuess << std::endl;
return LineSearchStep(gradient, initGuess, 0, gradDot, root);
}
double TPEFlowSolverSC::LineSearchStep(Eigen::MatrixXd &gradient, double initGuess, int doublingLimit,
double gradDot, BVHNode3D* root) {
double delta = initGuess;
// Save initial positions
SaveCurrentPositions();
double initialEnergy = CurrentEnergy(root);
double gradNorm = gradient.norm();
int numBacktracks = 0, numDoubles = 0;
double sigma = 0.01f;
double newEnergy = initialEnergy;
if (gradNorm < 1e-10) {
std::cout << " Gradient is very close to zero" << std::endl;
return 0;
}
// std::cout << "Initial energy " << initialEnergy << std::endl;
while (delta > ls_step_threshold) {
SetGradientStep(gradient, delta);
if (root) {
// Update the centers of mass to reflect the new positions
root->recomputeCentersOfMass(curveNetwork);
}
newEnergy = CurrentEnergy(root);
double decrease = initialEnergy - newEnergy;
double targetDecrease = sigma * delta * gradNorm * gradDot;
// If the energy hasn't decreased enough to meet the Armijo condition,
// halve the step size.
if (decrease < targetDecrease) {
delta /= 2;
numBacktracks++;
}
else if (decrease >= targetDecrease && numBacktracks == 0 && numDoubles < doublingLimit) {
delta *= 2;
numDoubles++;
}
// Otherwise, accept the current step.
else {
SetGradientStep(gradient, delta);
if (root) {
// Update the centers of mass to reflect the new positions
root->recomputeCentersOfMass(curveNetwork);
}
break;
}
}
if (delta <= ls_step_threshold) {
std::cout << "Failed to find a non-trivial step after " << numBacktracks << " backtracks" << std::endl;
// PlotEnergyInDirection(gradient, sigma * gradDot);
// Restore initial positions if step size goes to 0
RestoreOriginalPositions();
return 0;
}
else {
std::cout << " Energy: " << initialEnergy << " -> " << newEnergy
<< " (step size " << delta << ", " << numBacktracks << " backtracks)" << std::endl;
return delta;
}
}
inline double alpha_of_delta(double delta, double alpha_0, double alpha_1, double R) {
return (1.0 / R) * (alpha_0 * delta + alpha_1 * delta * delta);
}
void TPEFlowSolverSC::SetCircleStep(Eigen::MatrixXd &P_dot, Eigen::MatrixXd &K, double sqrt_G, double R, double alpha_delta) {
curveNetwork->positions = originalPositionMatrix + R * (-P_dot * (sin(alpha_delta) / sqrt_G) + R * K * (1 - cos(alpha_delta)));
}
double TPEFlowSolverSC::CircleSearchStep(Eigen::MatrixXd &P_dot, Eigen::MatrixXd &P_ddot, Eigen::MatrixXd &G, BVHNode3D* root) {
// Save initial positions
SaveCurrentPositions();
int nVerts = curveNetwork->NumVertices();
int nRows = curveNetwork->NumVertices() * 3;
// TODO: use only Gram matrix or full constraint matrix?
Eigen::VectorXd P_dot_vec(nRows);
MatrixIntoVectorX3(P_dot, P_dot_vec);
Eigen::VectorXd P_ddot_vec(nRows);
MatrixIntoVectorX3(P_ddot, P_ddot_vec);
double G_Pd_Pd = P_dot_vec.dot(G.block(0, 0, nRows, nRows) * P_dot_vec);
double G_Pd_Pdd = P_dot_vec.dot(G.block(0, 0, nRows, nRows) * P_ddot_vec);
Eigen::VectorXd K_vec = 1.0 / G_Pd_Pd * (-P_ddot_vec + P_dot_vec * (G_Pd_Pdd / G_Pd_Pd));
double R = 1.0 / sqrt(K_vec.dot(G.block(0, 0, nRows, nRows) * K_vec));
double alpha_0 = sqrt(G_Pd_Pd);
double alpha_1 = 0.5 * G_Pd_Pdd / alpha_0;
Eigen::MatrixXd K(nVerts, 3);
K.setZero();
VectorXdIntoMatrix(K_vec, K);
double delta = -2 * alpha_0 / alpha_1;
std::cout << "Delta estimate = " << delta << std::endl;
delta = fmax(0, delta);
SetCircleStep(P_dot, K, alpha_0, R, alpha_of_delta(delta, alpha_0, alpha_1, R));
return delta;
}
double TPEFlowSolverSC::LSBackproject(Eigen::MatrixXd &gradient, double initGuess,
Eigen::PartialPivLU<Eigen::MatrixXd> &lu, double gradDot, BVHNode3D* root) {
double delta = initGuess;
int attempts = 0;
while ((delta > ls_step_threshold || useEdgeLengthScale) && attempts < 10) {
attempts++;
SetGradientStep(gradient, delta);
if (root) {
// Update the centers of mass to reflect the new positions
root->recomputeCentersOfMass(curveNetwork);
}
for (int i = 0; i < 3; i++) {
double maxValue = BackprojectConstraints(lu);
if (maxValue < backproj_threshold) {
std::cout << "Backprojection successful after " << attempts << " attempts" << std::endl;
std::cout << "Used " << (i + 1) << " Newton steps on successful attempt" << std::endl;
return delta;
}
}
delta /= 2;
}
std::cout << "Couldn't make backprojection succeed after " << attempts << " attempts (initial step " << initGuess << ")" << std::endl;
SetGradientStep(gradient, 0);
BackprojectConstraints(lu);
return delta;
}
bool TPEFlowSolverSC::StepLS(bool useBH) {
int nVerts = curveNetwork->NumVertices();
Eigen::MatrixXd gradients(nVerts, 3);
gradients.setZero();
// FillGradientVectorDirect(gradients);
BVHNode3D *tree_root = 0;
if (useBH) tree_root = CreateBVHFromCurve(curveNetwork);
AddAllGradients(tree_root, gradients);
double gradNorm = gradients.norm();
double step_size = LineSearchStep(gradients, 1, tree_root);
delete tree_root;
soboNormZero = (gradNorm < 1e-4);
lastStepSize = step_size;
return (step_size > ls_step_threshold);
}
bool TPEFlowSolverSC::StepLSConstrained(bool useBH, bool useBackproj) {
std::cout << "=== Iteration " << ++iterNum << " ===" << std::endl;
// Compute gradient
int nVerts = curveNetwork->NumVertices();
Eigen::MatrixXd gradients(nVerts, 3);
gradients.setZero();
BVHNode3D *tree_root = 0;
if (useBH) tree_root = CreateBVHFromCurve(curveNetwork);
AddAllGradients(tree_root, gradients);
// Set up saddle matrix
Eigen::MatrixXd A;
int nRows = constraint.NumConstraintRows() + constraint.NumExpectedCols();
A.setZero(nRows, nRows);
// Assemble constraint saddle matrix with identity in the upper-left
Eigen::MatrixXd mass;
mass.setIdentity(nVerts * 3, nVerts * 3);
for (int i = 0; i < nVerts; i++) {
double m = 1.0 / curveNetwork->GetVertex(i)->DualLength();
mass(3 * i, 3 * i) = m;
mass(3 * i + 1, 3 * i + 1) = m;
mass(3 * i + 2, 3 * i + 2) = m;
}
A.block(0, 0, nVerts * 3, nVerts * 3) = mass;
constraint.FillDenseBlock(A);
// Factorize it
Eigen::PartialPivLU<Eigen::MatrixXd> lu;
lu.compute(A);
// Project gradient onto constraint differential
ProjectSoboSloboGradient(lu, gradients);
double gradNorm = gradients.norm();
std::cout << " Norm gradient = " << gradNorm << std::endl;
double step_size = LineSearchStep(gradients, 1, tree_root);
// Backprojection
if (useBackproj) {
step_size = LSBackproject(gradients, step_size, lu, 1, tree_root);
}
if (tree_root) delete tree_root;
lastStepSize = step_size;
soboNormZero = (gradNorm < 1e-4);
return (step_size > ls_step_threshold);
}
double TPEFlowSolverSC::ProjectSoboSloboGradient(Eigen::PartialPivLU<Eigen::MatrixXd> &lu, Eigen::MatrixXd &gradients) {
// If using per-edge length constraints, then the matrix has all coordinates merged,
// so we only need one solve
int nVerts = curveNetwork->NumVertices();
Eigen::VectorXd b;
b.setZero(constraint.NumConstraintRows() + constraint.NumExpectedCols());
// Fill in RHS with all coordinates
for (int i = 0; i < nVerts; i++) {
b(3 * i) = gradients(i, 0);
b(3 * i + 1) = gradients(i, 1);
b(3 * i + 2) = gradients(i, 2);
}
// Solve for all coordinates
Eigen::VectorXd ss_grad = lu.solve(b);
fullDerivVector = ss_grad;
for (int i = 0; i < nVerts; i++) {
SetRow(gradients, i, Vector3{ss_grad(3 * i), ss_grad(3 * i + 1), ss_grad(3 * i + 2)});
}
return 1;
}
double TPEFlowSolverSC::BackprojectConstraints(Eigen::PartialPivLU<Eigen::MatrixXd> &lu) {
int nVerts = curveNetwork->NumVertices();
Eigen::VectorXd b;
b.setZero(constraint.NumExpectedCols() + constraint.NumConstraintRows());
// If using per-edge length constraints, matrix has all coordinates merged,
// so we only need one solve.
// Fill RHS with negative constraint values
double maxViolation = constraint.FillConstraintValues(b, constraintTargets, 3 * nVerts);
// Solve for correction
Eigen::VectorXd corr = lu.solve(b);
// Apply correction
for (int i = 0; i < nVerts; i++) {
Vector3 correction{corr(3 * i), corr(3 * i + 1), corr(3 * i + 2)};
CurveVertex* pt = curveNetwork->GetVertex(i);
pt->SetPosition(pt->Position() + correction);
}
// Compute constraint violation after correction
maxViolation = constraint.FillConstraintValues(b, constraintTargets, 3 * nVerts);
std::cout << " Constraint value = " << maxViolation << std::endl;
return maxViolation;
}
double TPEFlowSolverSC::ProjectGradient(Eigen::MatrixXd &gradients, Eigen::MatrixXd &A, Eigen::PartialPivLU<Eigen::MatrixXd> &lu) {
size_t nVerts = curveNetwork->NumVertices();
Eigen::MatrixXd l2gradients = gradients;
// Assemble the Sobolev gram matrix with constraints
double ss_start = Utils::currentTimeMilliseconds();
SobolevCurves::Sobolev3XWithConstraints(curveNetwork, constraint, alpha, beta, A);
double ss_end = Utils::currentTimeMilliseconds();
// Factorize and solve
double factor_start = Utils::currentTimeMilliseconds();
lu.compute(A);
ProjectSoboSloboGradient(lu, gradients);
double factor_end = Utils::currentTimeMilliseconds();
double soboDot = 0;
for (int i = 0; i < gradients.rows(); i++) {
soboDot += dot(SelectRow(l2gradients, i), SelectRow(gradients, i));
}
return soboDot;
}
void TPEFlowSolverSC::GetSecondDerivative(SpatialTree* tree_root,
Eigen::MatrixXd &projected1, double epsilon, Eigen::MatrixXd &secondDeriv) {
Eigen::MatrixXd origPos = curveNetwork->positions;
int nVerts = curveNetwork->NumVertices();
// Evaluate second point for circular line search
double eps = 1e-5;
// Evaluate new L2 gradients
curveNetwork->positions -= eps * projected1;
Eigen::MatrixXd projectedEps;
projectedEps.setZero(nVerts, 3);
AddAllGradients(tree_root, projectedEps);
// Project a second time
Eigen::MatrixXd A_eps;
Eigen::PartialPivLU<Eigen::MatrixXd> lu_eps;
ProjectGradient(projectedEps, A_eps, lu_eps);
secondDeriv = (projectedEps - projected1) / eps;
curveNetwork->positions = origPos;
}
bool TPEFlowSolverSC::TargetLengthReached() {
if (useEdgeLengthScale || useTotalLengthScale) {
double currentLength = curveNetwork->TotalLength();
return fabs(currentLength - targetLength) <= lengthScaleStep;
}
return true;
}
void TPEFlowSolverSC::MoveLengthTowardsTarget() {
if (!useTotalLengthScale && !useEdgeLengthScale) {
return;
}
if (TargetLengthReached()) {
std::cout << "Target length reached; turning off length scaling" << std::endl;
useEdgeLengthScale = false;
useTotalLengthScale = false;
return;
}
if (useEdgeLengthScale) {
double currentLength = curveNetwork->TotalLength();
// If we're below the target length, increase edge lengths
if (currentLength < targetLength) {
int cStart = constraint.startIndexOfConstraint(ConstraintType::EdgeLengths);
int nRows = constraint.rowsOfConstraint(ConstraintType::EdgeLengths);
double diff = targetLength - currentLength;
double toAdd = lengthScaleStep;
if (diff < lengthScaleStep * nRows) {
toAdd = diff / nRows;
}
for (int i = cStart; i < cStart + nRows; i++) {
constraintTargets(i) += toAdd;
}
}
else if (currentLength > targetLength) {
int cStart = constraint.startIndexOfConstraint(ConstraintType::EdgeLengths);
int nRows = constraint.rowsOfConstraint(ConstraintType::EdgeLengths);
double diff = currentLength - targetLength;
double toSubt = lengthScaleStep;
if (diff < lengthScaleStep * nRows) {
toSubt = diff / nRows;
}
for (int i = cStart; i < cStart + nRows; i++) {
constraintTargets(i) -= toSubt;
}
}
}
else if (useTotalLengthScale) {
double currentLength = curveNetwork->TotalLength();
if (currentLength < targetLength) {
int cStart = constraint.startIndexOfConstraint(ConstraintType::TotalLength);
constraintTargets(cStart) += lengthScaleStep;
}
else if (currentLength > targetLength) {
int cStart = constraint.startIndexOfConstraint(ConstraintType::TotalLength);
constraintTargets(cStart) -= lengthScaleStep;
}
}
}
bool TPEFlowSolverSC::StepSobolevLS(bool useBH, bool useBackproj) {
long start = Utils::currentTimeMilliseconds();
size_t nVerts = curveNetwork->NumVertices();
Eigen::MatrixXd vertGradients;
vertGradients.setZero(nVerts, 3);
// If applicable, move constraint targets
MoveLengthTowardsTarget();
// Assemble gradient, either exactly or with Barnes-Hut
long bh_start = Utils::currentTimeMilliseconds();
BVHNode3D *tree_root = 0;
if (useBH) tree_root = CreateBVHFromCurve(curveNetwork);
AddAllGradients(tree_root, vertGradients);
Eigen::MatrixXd l2Gradients = vertGradients;
std::cout << "=== Iteration " << ++iterNum << " ===" << std::endl;
double bh_end = Utils::currentTimeMilliseconds();
std::cout << " Assemble gradient " << (useBH ? "(Barnes-Hut)" : "(direct)") << ": " << (bh_end - bh_start) << " ms" << std::endl;
std::cout << " L2 gradient norm = " << l2Gradients.norm() << std::endl;
double length1 = curveNetwork->TotalLength();
Eigen::MatrixXd A;
Eigen::PartialPivLU<Eigen::MatrixXd> lu;
long project_start = Utils::currentTimeMilliseconds();
// Compute the Sobolev gradient
double soboDot = ProjectGradient(vertGradients, A, lu);
long project_end = Utils::currentTimeMilliseconds();
std::cout << " Sobolev gradient norm = " << soboDot << std::endl;
if (isnan(soboDot)) {
std::cout << "Sobolev projection produced NaN; aborting." << std::endl;
return false;
}
double dot_acc = soboDot / (l2Gradients.norm() * vertGradients.norm());
std::cout << " Project gradient: " << (project_end - project_start) << " ms" << std::endl;
// Take a line search step using this gradient
double ls_start = Utils::currentTimeMilliseconds();
double step_size = LineSearchStep(vertGradients, dot_acc, tree_root);
// double step_size = CircleSearchStep(vertGradients, secondDeriv, A, tree_root);
double ls_end = Utils::currentTimeMilliseconds();
std::cout << " Line search: " << (ls_end - ls_start) << " ms" << std::endl;
if (useEdgeLengthScale && step_size < ls_step_threshold) {
vertGradients.setZero();
}
// Correct for drift with backprojection
double bp_start = Utils::currentTimeMilliseconds();
if (useBackproj) {
step_size = LSBackproject(vertGradients, step_size, lu, dot_acc, tree_root);
}
double bp_end = Utils::currentTimeMilliseconds();
std::cout << " Backprojection: " << (bp_end - bp_start) << " ms" << std::endl;
std::cout << " Final step size = " << step_size << std::endl;
if (tree_root) {
delete tree_root;
}
double length2 = curveNetwork->TotalLength();
std::cout << "Length " << length1 << " -> " << length2 << std::endl;
long end = Utils::currentTimeMilliseconds();
std::cout << "Time = " << (end - start) << " ms" << std::endl;
if (perfLogEnabled) {
double bh_time = bh_end - bh_start;
double mg_time = project_end - project_start;
double ls_time = ls_end - ls_start;
double bp_time = bp_end - bp_start;
double all_time = end - start;
perfFile << iterNum << ", " << bh_time << ", " << mg_time << ", " << ls_time << ", " << bp_time << ", " << all_time << std::endl;
}
lastStepSize = step_size;
soboNormZero = (soboDot < 1e-4);
return step_size > ls_step_threshold;
}
bool TPEFlowSolverSC::StepSobolevLSIterative(double epsilon, bool useBackproj) {
std::cout << "=== Iteration " << ++iterNum << " ===" << std::endl;
long all_start = Utils::currentTimeMilliseconds();
size_t nVerts = curveNetwork->NumVertices();
BVHNode3D* tree_root = 0;
Eigen::MatrixXd vertGradients;
vertGradients.setZero(nVerts, 3);
// If applicable, move constraint targets
MoveLengthTowardsTarget();
// Assemble the L2 gradient
long bh_start = Utils::currentTimeMilliseconds();
tree_root = CreateBVHFromCurve(curveNetwork);
AddAllGradients(tree_root, vertGradients);
Eigen::MatrixXd l2gradients = vertGradients;
long bh_end = Utils::currentTimeMilliseconds();
std::cout << " Barnes-Hut: " << (bh_end - bh_start) << " ms" << std::endl;
// Set up multigrid stuff
long mg_setup_start = Utils::currentTimeMilliseconds();
using MultigridDomain = ConstraintProjectorDomain<ConstraintClassType>;
using MultigridSolver = MultigridHierarchy<MultigridDomain>;
double sep = 1.0;
MultigridDomain* domain = new MultigridDomain(curveNetwork, alpha, beta, sep, epsilon);
MultigridSolver* multigrid = new MultigridSolver(domain);
long mg_setup_end = Utils::currentTimeMilliseconds();
std::cout << " Multigrid setup: " << (mg_setup_end - mg_setup_start) << " ms" << std::endl;
// Use multigrid to compute the Sobolev gradient
long mg_start = Utils::currentTimeMilliseconds();
double soboDot = ProjectGradientMultigrid<MultigridDomain, MultigridSolver::EigenCG>(vertGradients, multigrid, vertGradients, mg_tolerance);
double dot_acc = soboDot / (l2gradients.norm() * vertGradients.norm());
long mg_end = Utils::currentTimeMilliseconds();
std::cout << " Multigrid solve: " << (mg_end - mg_start) << " ms" << std::endl;
std::cout << " Sobolev gradient norm = " << soboDot << std::endl;
// Take a line search step using this gradient
long ls_start = Utils::currentTimeMilliseconds();
// double step_size = CircleSearch::CircleSearchStep<MultigridSolver, MultigridSolver::EigenCG>(curveNetwork,
// vertGradients, l2gradients, tree_root, multigrid, initialLengths, dot_acc, alpha, beta, 1e-6);
double step_size = LineSearchStep(vertGradients, dot_acc, tree_root);
long ls_end = Utils::currentTimeMilliseconds();
std::cout << " Line search: " << (ls_end - ls_start) << " ms" << std::endl;
// Correct for drift with backprojection
long bp_start = Utils::currentTimeMilliseconds();
if (useBackproj) {
step_size = LSBackprojectMultigrid<MultigridDomain, MultigridSolver::EigenCG>(vertGradients,
step_size, multigrid, tree_root, mg_tolerance);
}
long bp_end = Utils::currentTimeMilliseconds();
std::cout << " Backprojection: " << (bp_end - bp_start) << " ms" << std::endl;
std::cout << " Final step size = " << step_size << std::endl;
delete multigrid;
if (tree_root) delete tree_root;
long all_end = Utils::currentTimeMilliseconds();
std::cout << " Total time: " << (all_end - all_start) << " ms" << std::endl;
if (perfLogEnabled) {
double bh_time = bh_end - bh_start;
double mg_time = mg_end - mg_setup_start;
double ls_time = ls_end - ls_start;
double bp_time = bp_end - bp_start;
double all_time = all_end - all_start;
perfFile << iterNum << ", " << bh_time << ", " << mg_time << ", " << ls_time << ", " << bp_time << ", " << all_time << std::endl;
}
soboNormZero = (soboDot < 1e-4);
lastStepSize = step_size;
return step_size > ls_step_threshold;
}
}
| 39.484094 | 148 | 0.600869 | duxingyi-charles |
4d09296eadfb85f15d7076cb51c4a1090d1933c6 | 316 | cpp | C++ | C++/house-robber.cpp | black-shadows/LeetCode-Solutions | b1692583f7b710943ffb19b392b8bf64845b5d7a | [
"Fair",
"Unlicense"
] | 1 | 2020-04-16T08:38:14.000Z | 2020-04-16T08:38:14.000Z | house-robber.cpp | Jeevan-kumar-Raj/LeetCode-Solutions-Topicwise | f1111b4edd401a3fc47111993bd7250cf4dc76da | [
"MIT"
] | null | null | null | house-robber.cpp | Jeevan-kumar-Raj/LeetCode-Solutions-Topicwise | f1111b4edd401a3fc47111993bd7250cf4dc76da | [
"MIT"
] | 1 | 2021-12-25T14:48:56.000Z | 2021-12-25T14:48:56.000Z | // Time: O(n)
// Space: O(1)
class Solution {
public:
int rob(vector<int>& nums) {
int last = 0, result = 0;
for (const auto& i : nums) {
auto tmp = result;
result = max(last + i, result);
last = tmp;
}
return result;
}
};
| 19.75 | 44 | 0.427215 | black-shadows |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.