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
f61f053f98ef3234209100fdb0ea8c25f7141a4a
19
cpp
C++
src/Core/x/xDecal.cpp
DarkRTA/bfbbdecomp
e2105e94b8da26f6e6e2dfcf1f004aaaeed9799e
[ "OLDAP-2.7" ]
null
null
null
src/Core/x/xDecal.cpp
DarkRTA/bfbbdecomp
e2105e94b8da26f6e6e2dfcf1f004aaaeed9799e
[ "OLDAP-2.7" ]
6
2022-01-16T05:29:01.000Z
2022-01-18T01:10:29.000Z
src/Core/x/xDecal.cpp
DarkRTA/bfbbdecomp
e2105e94b8da26f6e6e2dfcf1f004aaaeed9799e
[ "OLDAP-2.7" ]
1
2022-01-16T00:04:23.000Z
2022-01-16T00:04:23.000Z
#include "xDecal.h"
19
19
0.736842
DarkRTA
f620716e163bc873971bb4d7ee950bdf35a6a152
449
cpp
C++
cpp/cpp_primer/chapter13/ex_13_58.cpp
KaiserLancelot/Cpp-Primer
a4791a6765f0b6c864e8881e6a5328e2a3d68974
[ "MIT" ]
2
2019-12-21T00:53:47.000Z
2020-01-01T10:36:30.000Z
cpp/cpp_primer/chapter13/ex_13_58.cpp
KaiserLancelot/Cpp-Primer
a4791a6765f0b6c864e8881e6a5328e2a3d68974
[ "MIT" ]
null
null
null
cpp/cpp_primer/chapter13/ex_13_58.cpp
KaiserLancelot/Cpp-Primer
a4791a6765f0b6c864e8881e6a5328e2a3d68974
[ "MIT" ]
null
null
null
// // Created by kaiser on 18-12-25. // #include <algorithm> #include <cstdint> #include <iostream> #include <vector> class Foo { public: Foo sorted() && { std::cout << "&&\n"; std::sort(std::begin(data_), std::end(data_)); return *this; } Foo sorted() const& { std::cout << "&\n"; return Foo{*this}.sorted(); } private: std::vector<std::int32_t> data_; }; int main() { Foo{}.sorted(); Foo f; f.sorted(); }
14.483871
50
0.561247
KaiserLancelot
f620eb398f444a9bfa266ba0b7d30ecd99e5669d
6,499
cpp
C++
third_party/opencore-audio/aac/dec/src/get_sbr_startfreq.cpp
asveikau/audio
4b8978d5a7855a0ee62cd15b1dd76d35fb6c8290
[ "0BSD" ]
null
null
null
third_party/opencore-audio/aac/dec/src/get_sbr_startfreq.cpp
asveikau/audio
4b8978d5a7855a0ee62cd15b1dd76d35fb6c8290
[ "0BSD" ]
null
null
null
third_party/opencore-audio/aac/dec/src/get_sbr_startfreq.cpp
asveikau/audio
4b8978d5a7855a0ee62cd15b1dd76d35fb6c8290
[ "0BSD" ]
null
null
null
/* ------------------------------------------------------------------ * Copyright (C) 2008 PacketVideo * * 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. * ------------------------------------------------------------------- */ /* ------------------------------------------------------------------------------ Filename: get_sbr_startfreq.c Date: 07/17/2003 ------------------------------------------------------------------------------ REVISION HISTORY Description: ------------------------------------------------------------------------------ INPUT AND OUTPUT DEFINITIONS ------------------------------------------------------------------------------ FUNCTION DESCRIPTION ------------------------------------------------------------------------------ REQUIREMENTS ------------------------------------------------------------------------------ REFERENCES SC 29 Software Copyright Licencing Disclaimer: This software module was originally developed by Coding Technologies and edited by - in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards for reference purposes and its performance may not have been optimized. This software module is an implementation of one or more tools as specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards. ISO/IEC gives users free license to this software module or modifications thereof for use in products claiming conformance to audiovisual and image-coding related ITU Recommendations and/or ISO/IEC International Standards. ISO/IEC gives users the same free license to this software module or modifications thereof for research purposes and further ISO/IEC standardisation. Those intending to use this software module in products are advised that its use may infringe existing patents. ISO/IEC have no liability for use of this software module or modifications thereof. Copyright is not released for products that do not conform to audiovisual and image-coding related ITU Recommendations and/or ISO/IEC International Standards. The original developer retains full right to modify and use the code for its own purpose, assign or donate the code to a third party and to inhibit third parties from using the code for products that do not conform to audiovisual and image-coding related ITU Recommendations and/or ISO/IEC International Standards. This copyright notice must be included in all copies or derivative works. Copyright (c) ISO/IEC 2002. ------------------------------------------------------------------------------ PSEUDO-CODE ------------------------------------------------------------------------------ */ /*---------------------------------------------------------------------------- ; INCLUDES ----------------------------------------------------------------------------*/ #include "get_sbr_startfreq.h" /*---------------------------------------------------------------------------- ; MACROS ; Define module specific macros here ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; DEFINES ; Include all pre-processor statements here. Include conditional ; compile variables also. ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; LOCAL FUNCTION DEFINITIONS ; Function Prototype declaration ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; LOCAL STORE/BUFFER/POINTER DEFINITIONS ; Variable declaration - defined here and used outside this module ----------------------------------------------------------------------------*/ const Int v_offset[7][16] = { { -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7}, { -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13}, { -5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16}, { -6, -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16}, { -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20}, { -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24}, { 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24, 28, 33} }; /*---------------------------------------------------------------------------- ; EXTERNAL FUNCTION REFERENCES ; Declare functions defined elsewhere and referenced in this module ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES ; Declare variables used in this module but defined elsewhere ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; FUNCTION CODE ----------------------------------------------------------------------------*/ Int get_sbr_startfreq(const Int32 fs, const Int32 start_freq) { Int k0_min = 0; Int32 index; switch (fs) { case 16000: index = 0; k0_min = 24; break; case 22050: index = 1; k0_min = 17; break; case 24000: index = 2; k0_min = 16; break; case 32000: index = 3; k0_min = 16; break; case 44100: index = 4; k0_min = 12; break; case 48000: index = 4; k0_min = 11; break; case 64000: index = 4; k0_min = 10; break; case 88200: case 96000: index = 5; k0_min = 7; break; default: index = 6; } return (k0_min + v_offset[index][start_freq]); }
34.569149
80
0.440837
asveikau
f625be0cfaba60799d2ab0c5c8128e91c310c451
3,237
cpp
C++
midi_kit/PatchBay/MidiEventMeter.cpp
return/BeOSSampleCode
ca5a319fecf425a69e944f3c928a85011563a932
[ "BSD-3-Clause" ]
5
2018-09-09T21:01:57.000Z
2022-03-27T10:01:27.000Z
midi_kit/PatchBay/MidiEventMeter.cpp
return/BeOSSampleCode
ca5a319fecf425a69e944f3c928a85011563a932
[ "BSD-3-Clause" ]
null
null
null
midi_kit/PatchBay/MidiEventMeter.cpp
return/BeOSSampleCode
ca5a319fecf425a69e944f3c928a85011563a932
[ "BSD-3-Clause" ]
5
2018-04-03T01:45:23.000Z
2021-05-14T08:23:01.000Z
// MidiEventMeter.cpp // ------------------ // Implements the MidiEventMeter class. // // Copyright 1999, Be Incorporated. All Rights Reserved. // This file may be used under the terms of the Be Sample Code License. #include <stdio.h> #include <MidiRoster.h> #include <MidiProducer.h> #include <MidiConsumer.h> #include <View.h> #include "CountEventConsumer.h" #include "MidiEventMeter.h" static const BRect METER_BOUNDS(0,0,7,31); // If we get this number of events per pulse or greater, we will // max out the event meter. // Value was determined empirically based on my banging on a MIDI // keyboard controller with a pulse of 200ms. static const int32 METER_SCALE = 10; MidiEventMeter::MidiEventMeter(int32 producerID) : m_counter(NULL), m_meterLevel(0) { BMidiRoster* roster = BMidiRoster::MidiRoster(); if (roster) { BMidiProducer* producer = roster->FindProducer(producerID); if (producer) { BString name; name << producer->Name() << " Event Meter"; m_counter = new CountEventConsumer(name.String()); producer->Connect(m_counter); producer->Release(); } } } MidiEventMeter::~MidiEventMeter() { if (m_counter) m_counter->Release(); } void MidiEventMeter::Pulse(BView* view) { int32 newLevel = m_meterLevel; if (m_counter) { newLevel = CalcMeterLevel(m_counter->CountEvents()); m_counter->Reset(); } if (newLevel != m_meterLevel) { m_meterLevel = newLevel; view->Invalidate(BRect(METER_BOUNDS).InsetBySelf(1,1)); } } BRect MidiEventMeter::Bounds() const { return METER_BOUNDS; } void MidiEventMeter::Draw(BView* view) { const rgb_color METER_BLACK = { 0, 0, 0, 255 }; const rgb_color METER_GREY = { 180, 180, 180, 255 }; const rgb_color METER_GREEN = { 0, 255, 0, 255 }; view->PushState(); // draw the frame BPoint lt = METER_BOUNDS.LeftTop(); BPoint rb = METER_BOUNDS.RightBottom(); view->BeginLineArray(4); view->AddLine(BPoint(lt.x, lt.y), BPoint(rb.x - 1, lt.y), METER_BLACK); view->AddLine(BPoint(rb.x, lt.y), BPoint(rb.x, rb.y - 1), METER_BLACK); view->AddLine(BPoint(rb.x, rb.y), BPoint(lt.x + 1, rb.y), METER_BLACK); view->AddLine(BPoint(lt.x, rb.y), BPoint(lt.x, lt.y + 1), METER_BLACK); view->EndLineArray(); // draw the cells BRect cell = METER_BOUNDS; cell.InsetBy(1,1); cell.bottom = cell.top + (cell.Height() + 1) / 5; cell.bottom--; const float kTintArray[] = { B_DARKEN_4_TINT, B_DARKEN_3_TINT, B_DARKEN_2_TINT, B_DARKEN_1_TINT, B_NO_TINT }; for (int32 i=4; i>=0; i--) { rgb_color color; if (m_meterLevel > i) { color = tint_color(METER_GREEN, kTintArray[i]); } else { color = METER_GREY; } view->SetHighColor(color); view->FillRect(cell); cell.OffsetBy(0, cell.Height() + 1); } view->PopState(); } int32 MidiEventMeter::CalcMeterLevel(int32 eventCount) const { // we use an approximately logarithmic scale for determing the actual // drawn meter level, so that low-density event streams show up well. if (eventCount == 0) { return 0; } else if (eventCount < (int32)(.5*METER_SCALE)) { return 1; } else if (eventCount < (int32)(.75*METER_SCALE)) { return 2; } else if (eventCount < (int32)(.9*METER_SCALE)) { return 3; } else if (eventCount < METER_SCALE) { return 4; } else { return 5; } }
26.317073
110
0.688292
return
f629075c0ed6e111e6c543fd7bce1fe5fb904781
2,281
cpp
C++
examples/manual/unique.cpp
Hower91/Apache-C-Standard-Library-4.2.x
4d9011d60dbb38b3ff80dcfe54dccd3a4647d9d3
[ "Apache-2.0" ]
null
null
null
examples/manual/unique.cpp
Hower91/Apache-C-Standard-Library-4.2.x
4d9011d60dbb38b3ff80dcfe54dccd3a4647d9d3
[ "Apache-2.0" ]
null
null
null
examples/manual/unique.cpp
Hower91/Apache-C-Standard-Library-4.2.x
4d9011d60dbb38b3ff80dcfe54dccd3a4647d9d3
[ "Apache-2.0" ]
null
null
null
/************************************************************************** * * unique.cpp - Example program of unique algorithm. * * $Id: //stdlib/dev/examples/stdlib/manual/unique.cpp#11 $ * *************************************************************************** * * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave * Software division. 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 <algorithm> // for copy, unique_copy #include <iostream> // for cout, endl #include <iterator> // for insert_iterator, ostream_iterator #include <vector> // for vector int main () { // for convenience typedef std::vector<int, std::allocator<int> > Vector; typedef std::insert_iterator<Vector> Iter; typedef std::ostream_iterator<Vector::value_type, char, std::char_traits<char> > OSIter; // Initialize two vectors. const int a1 [] = { 4, 5, 5, 9, -1, -1, -1, 3, 7, 5, 5, 5, 6, 7, 7, 7, 4, 2, 1, 1 }; Vector v (a1, a1 + sizeof a1 / sizeof *a1); Vector result; // Create an insert_iterator for results. Iter ins (result, result.begin ()); // Demonstrate includes. std::cout << "The vector: " << std::endl << " "; std::copy (v.begin (), v.end (), OSIter (std::cout, " ")); // Find the unique elements. std::unique_copy(v.begin(), v.end(), ins); // Display the results. std::cout << "\n\nHas the following unique elements:\n "; std::copy (result.begin (), result.end (), OSIter (std::cout, " ")); std::cout << std::endl; return 0; }
36.206349
76
0.54669
Hower91
f62918a787edb3412b8926fa3f312a9c97386060
4,447
hpp
C++
include/System/Security/SecurityElement_SecurityAttribute.hpp
RedBrumbler/virtuoso-codegen
e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3
[ "Unlicense" ]
null
null
null
include/System/Security/SecurityElement_SecurityAttribute.hpp
RedBrumbler/virtuoso-codegen
e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3
[ "Unlicense" ]
null
null
null
include/System/Security/SecurityElement_SecurityAttribute.hpp
RedBrumbler/virtuoso-codegen
e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3
[ "Unlicense" ]
null
null
null
// Autogenerated from CppHeaderCreator // Created by Sc2ad // ========================================================================= #pragma once // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" #include "beatsaber-hook/shared/utils/byref.hpp" // Including type: System.Security.SecurityElement #include "System/Security/SecurityElement.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils-properties.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils-fields.hpp" #include "beatsaber-hook/shared/utils/utils.h" #include "beatsaber-hook/shared/utils/typedefs-string.hpp" // Completed includes #include "beatsaber-hook/shared/utils/il2cpp-type-check.hpp" NEED_NO_BOX(::System::Security::SecurityElement::SecurityAttribute); DEFINE_IL2CPP_ARG_TYPE(::System::Security::SecurityElement::SecurityAttribute*, "System.Security", "SecurityElement/SecurityAttribute"); // Type namespace: System.Security namespace System::Security { // Size: 0x20 #pragma pack(push, 1) // Autogenerated type: System.Security.SecurityElement/System.Security.SecurityAttribute // [TokenAttribute] Offset: FFFFFFFF class SecurityElement::SecurityAttribute : public ::Il2CppObject { public: #ifdef USE_CODEGEN_FIELDS public: #else #ifdef CODEGEN_FIELD_ACCESSIBILITY CODEGEN_FIELD_ACCESSIBILITY: #else protected: #endif #endif // private System.String _name // Size: 0x8 // Offset: 0x10 ::StringW name; // Field size check static_assert(sizeof(::StringW) == 0x8); // private System.String _value // Size: 0x8 // Offset: 0x18 ::StringW value; // Field size check static_assert(sizeof(::StringW) == 0x8); public: // Get instance field reference: private System.String _name ::StringW& dyn__name(); // Get instance field reference: private System.String _value ::StringW& dyn__value(); // public System.String get_Name() // Offset: 0x1081B70 ::StringW get_Name(); // public System.String get_Value() // Offset: 0x1081B78 ::StringW get_Value(); // public System.Void .ctor(System.String name, System.String value) // Offset: 0x10819EC template<::il2cpp_utils::CreationType creationType = ::il2cpp_utils::CreationType::Temporary> static SecurityElement::SecurityAttribute* New_ctor(::StringW name, ::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::System::Security::SecurityElement::SecurityAttribute::.ctor"); return THROW_UNLESS((::il2cpp_utils::New<SecurityElement::SecurityAttribute*, creationType>(name, value))); } }; // System.Security.SecurityElement/System.Security.SecurityAttribute #pragma pack(pop) static check_size<sizeof(SecurityElement::SecurityAttribute), 24 + sizeof(::StringW)> __System_Security_SecurityElement_SecurityAttributeSizeCheck; static_assert(sizeof(SecurityElement::SecurityAttribute) == 0x20); } #include "beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp" // Writing MetadataGetter for method: System::Security::SecurityElement::SecurityAttribute::get_Name // Il2CppName: get_Name template<> struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::StringW (System::Security::SecurityElement::SecurityAttribute::*)()>(&System::Security::SecurityElement::SecurityAttribute::get_Name)> { static const MethodInfo* get() { return ::il2cpp_utils::FindMethod(classof(System::Security::SecurityElement::SecurityAttribute*), "get_Name", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{}); } }; // Writing MetadataGetter for method: System::Security::SecurityElement::SecurityAttribute::get_Value // Il2CppName: get_Value template<> struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<::StringW (System::Security::SecurityElement::SecurityAttribute::*)()>(&System::Security::SecurityElement::SecurityAttribute::get_Value)> { static const MethodInfo* get() { return ::il2cpp_utils::FindMethod(classof(System::Security::SecurityElement::SecurityAttribute*), "get_Value", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{}); } }; // Writing MetadataGetter for method: System::Security::SecurityElement::SecurityAttribute::New_ctor // Il2CppName: .ctor // Cannot get method pointer of value based method overload from template for constructor! // Try using FindMethod instead!
48.336957
208
0.7387
RedBrumbler
f6296105d61e043b07ff4c9b12fbe6609838bc1f
10,121
hpp
C++
include/dish2/services/ResourceSendingService.hpp
schregardusc/dishtiny
b0b1841a457a955fa4c22f36a050d91f12484f9e
[ "MIT" ]
1
2021-02-12T23:53:55.000Z
2021-02-12T23:53:55.000Z
include/dish2/services/ResourceSendingService.hpp
schregardusc/dishtiny
b0b1841a457a955fa4c22f36a050d91f12484f9e
[ "MIT" ]
null
null
null
include/dish2/services/ResourceSendingService.hpp
schregardusc/dishtiny
b0b1841a457a955fa4c22f36a050d91f12484f9e
[ "MIT" ]
null
null
null
#pragma once #ifndef DISH2_SERVICES_RESOURCESENDINGSERVICE_HPP_INCLUDE #define DISH2_SERVICES_RESOURCESENDINGSERVICE_HPP_INCLUDE #include <cmath> #include <functional> #include <limits> #include <set> #include <utility> #include "../../../third-party/conduit/include/uitsl/algorithm/for_each.hpp" #include "../../../third-party/conduit/include/uitsl/algorithm/nan_to_zero.hpp" #include "../../../third-party/conduit/include/uitsl/debug/err_audit.hpp" #include "../../../third-party/conduit/include/uitsl/math/shift_mod.hpp" #include "../../../third-party/conduit/include/uitsl/polyfill/isfinite.hpp" #include "../../../third-party/Empirical/include/emp/base/vector.hpp" #include "../cell/cardinal_iterators/NeighborResourceReceiveResistanceWrapper.hpp" #include "../cell/cardinal_iterators/ResourceNodeOutputWrapper.hpp" #include "../cell/cardinal_iterators/ResourceReserveRequestWrapper.hpp" #include "../cell/cardinal_iterators/ResourceSendLimitWrapper.hpp" #include "../cell/cardinal_iterators/ResourceSendRequestWrapper.hpp" #include "../cell/cardinal_iterators/ResourceStockpileWrapper.hpp" #include "../config/cfg.hpp" #include "../debug/LogScope.hpp" namespace dish2 { struct ResourceSendingService { static bool ShouldRun( const size_t update, const bool alive ) { const size_t freq = dish2::cfg.RESOURCE_SENDING_SERVICE_FREQUENCY(); return alive && freq > 0 && uitsl::shift_mod( update, freq ) == 0; } template<typename Cell> static void DoService( Cell& cell ) { const dish2::LogScope guard{ "resource sending service", "TODO", 3 }; using spec_t = typename Cell::spec_t; // check resource stockpile consistency and validity emp_assert(( std::set< typename dish2::ResourceStockpileWrapper<spec_t>::value_type >( cell.template begin<dish2::ResourceStockpileWrapper<spec_t>>(), cell.template end<dish2::ResourceStockpileWrapper<spec_t>>() ).size() == 1 )); emp_assert( std::all_of( cell.template begin<dish2::ResourceStockpileWrapper<spec_t>>(), cell.template end<dish2::ResourceStockpileWrapper<spec_t>>(), [](const auto amt){ return std::isfinite(amt) && ( amt >= 0 ); } ) ); // initialize available amount to entire stockpile thread_local emp::vector<float> send_amounts; send_amounts.clear(); std::copy( cell.template begin<dish2::ResourceStockpileWrapper<spec_t>>(), cell.template end<dish2::ResourceStockpileWrapper<spec_t>>(), std::back_inserter( send_amounts ) ); // subtract out how much each cardinal wants to stockpile std::transform( std::begin( send_amounts ), std::end( send_amounts ), cell.template begin<dish2::ResourceReserveRequestWrapper<spec_t>>(), std::begin( send_amounts ), [](const auto send_amount, const auto reserve_request_raw){ return uitsl::nan_to_zero( std::clamp(send_amount - reserve_request_raw.Get(), 0.0f, send_amount) ); } ); // check that each individual send request is leq total available amount // within float tolerance emp_assert( std::none_of( std::begin(send_amounts), std::end(send_amounts), [](const auto amt){ return std::isnan(amt); } ), "a" ); emp_assert( std::none_of( std::begin(send_amounts), std::end(send_amounts), [](const auto amt){ return std::isinf(amt); } ), "a" ); emp_assert( std::all_of( std::begin(send_amounts), std::end(send_amounts), [&cell](const auto amt){ return amt - *cell.template begin<dish2::ResourceStockpileWrapper<spec_t>>() <= std::numeric_limits<float>::epsilon(); } ), "a" ); // multiply by fraction requested std::transform( std::begin( send_amounts ), std::end( send_amounts ), cell.template begin<dish2::ResourceSendRequestWrapper<spec_t>>(), std::begin( send_amounts ), [](const auto send_amount, const auto send_request_raw){ return uitsl::nan_to_zero( std::clamp( send_amount * send_request_raw.Get(), 0.0f, send_amount ) ); } ); // check that each individual send request is leq total available amount // within float tolerance emp_assert( std::none_of( std::begin(send_amounts), std::end(send_amounts), [](const auto amt){ return std::isnan(amt); } ), "b" ); emp_assert( std::none_of( std::begin(send_amounts), std::end(send_amounts), [](const auto amt){ return std::isinf(amt); } ), "b" ); emp_assert( std::all_of( std::begin(send_amounts), std::end(send_amounts), [&cell](const auto amt){ return amt - *cell.template begin<dish2::ResourceStockpileWrapper<spec_t>>() <= std::numeric_limits<float>::epsilon(); } ), "b" ); // if absolute rate limited, cap by it std::transform( std::begin( send_amounts ), std::end( send_amounts ), cell.template begin<dish2::ResourceSendLimitWrapper<spec_t>>(), std::begin( send_amounts ), [](const auto send_amount, const auto send_limit_raw){ const auto send_limit = uitsl::nan_to_zero( std::max( 0.0f, send_limit_raw.Get() ) ); return send_limit ? std::min( send_amount, send_limit ) : send_amount ; } ); // check that each individual send request is leq total available amount // within float tolerance emp_assert( std::none_of( std::begin(send_amounts), std::end(send_amounts), [](const auto amt){ return std::isnan(amt); } ), "c" ); emp_assert( std::none_of( std::begin(send_amounts), std::end(send_amounts), [](const auto amt){ return std::isinf(amt); } ), "c" ); emp_assert( std::all_of( std::begin(send_amounts), std::end(send_amounts), [&cell](const auto amt){ return amt - *cell.template begin<dish2::ResourceStockpileWrapper<spec_t>>() <= std::numeric_limits<float>::epsilon(); } ), "c" ); // check that all send amounts are non-negative and finite emp_assert( std::all_of( std::begin( send_amounts ), std::end( send_amounts ), [](const auto val){ return std::isfinite(val) && ( val >= 0 ); } ) ); // multiply each send amount by its fraction of sum send amount const auto total_requested = std::accumulate( std::begin( send_amounts ), std::end( send_amounts ), 0.0f ); if (total_requested) std::transform( std::begin( send_amounts ), std::end( send_amounts ), std::begin( send_amounts ), [total_requested](const auto amt){ return amt * (amt / total_requested); } ); // check that each individual send request is leq total available amount // within float tolerance emp_assert( std::none_of( std::begin(send_amounts), std::end(send_amounts), [](const auto amt){ return std::isnan(amt); } ), "d" ); emp_assert( std::none_of( std::begin(send_amounts), std::end(send_amounts), [](const auto amt){ return std::isinf(amt); } ), "d" ); emp_assert( std::all_of( std::begin(send_amounts), std::end(send_amounts), [&cell](const auto amt){ return amt - *cell.template begin<dish2::ResourceStockpileWrapper<spec_t>>() <= std::numeric_limits<float>::epsilon(); } ), "d" ); // check that all send amounts are non-negative and finite emp_assert( std::all_of( std::begin( send_amounts ), std::end( send_amounts ), [](const auto val){ return std::isfinite(val) && ( val >= 0 ); } ) ); // check that sum send amount doesn't exceed stockpiled amount // within float tolerance emp_assert( std::nextafter( std::accumulate( std::begin( send_amounts ), std::end( send_amounts ), 0.0f ), *cell.template begin<dish2::ResourceStockpileWrapper<spec_t>>() ) <= *cell.template begin<dish2::ResourceStockpileWrapper<spec_t>>() ); // zero out requests to send to non-alive neighbors std::transform( std::begin( send_amounts ), std::end( send_amounts ), cell.template begin<dish2::NeighborIsAliveWrapper<spec_t>>(), std::begin( send_amounts ), [](const auto send_amount, const auto is_alive){ return is_alive.Get() ? send_amount : 0.0f; } ); // do the send float stockpile = *cell.template begin<dish2::ResourceStockpileWrapper<spec_t>>(); uitsl::for_each( std::begin( send_amounts ), std::end( send_amounts ), cell.template begin<dish2::ResourceNodeOutputWrapper<spec_t>>(), [&stockpile](const float send_amount, auto& resource_output){ stockpile -= send_amount; uitsl_err_audit(! resource_output.TryPut( send_amount ) ); } ); // patch for precision errors // could also clamp, but this avoids branching stockpile += std::numeric_limits<float>::epsilon(); // check that stockpile wasn't overspent or corrupted emp_assert( std::isfinite(stockpile) && ( stockpile >= 0.0f ), stockpile ); // update stockpile state std::fill( cell.template begin<dish2::ResourceStockpileWrapper<spec_t>>(), cell.template end<dish2::ResourceStockpileWrapper<spec_t>>(), stockpile ); // check resource stockpile consistency and validity emp_assert(( std::set< typename dish2::ResourceStockpileWrapper<spec_t>::value_type >( cell.template begin<dish2::ResourceStockpileWrapper<spec_t>>(), cell.template end<dish2::ResourceStockpileWrapper<spec_t>>() ).size() == 1 )); emp_assert( std::all_of( cell.template begin<dish2::ResourceStockpileWrapper<spec_t>>(), cell.template end<dish2::ResourceStockpileWrapper<spec_t>>(), [](const auto amt){ return std::isfinite(amt) && ( amt >= 0 ); } ) ); } }; } // namespace dish2 #endif // #ifndef DISH2_SERVICES_RESOURCESENDINGSERVICE_HPP_INCLUDE
34.192568
82
0.64134
schregardusc
f62cce28250db29e4821a6691d697d864dc3976a
3,978
hpp
C++
include/bounded/detail/minmax.hpp
davidstone/bounded-integer
d4f9a88a12174ca8382af60b00c5affd19aa8632
[ "BSL-1.0" ]
44
2020-10-03T21:37:52.000Z
2022-03-26T10:08:46.000Z
include/bounded/detail/minmax.hpp
davidstone/bounded-integer
d4f9a88a12174ca8382af60b00c5affd19aa8632
[ "BSL-1.0" ]
1
2021-01-01T23:22:39.000Z
2021-01-01T23:22:39.000Z
include/bounded/detail/minmax.hpp
davidstone/bounded-integer
d4f9a88a12174ca8382af60b00c5affd19aa8632
[ "BSL-1.0" ]
null
null
null
// Copyright David Stone 2017. // 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) #pragma once #include <bounded/detail/class.hpp> #include <bounded/detail/common_type_and_value_category.hpp> #include <bounded/detail/comparison.hpp> #include <bounded/detail/comparison_function_object.hpp> #include <bounded/detail/is_bounded_integer.hpp> #include <bounded/detail/max_builtin.hpp> #include <bounded/normalize.hpp> #include <bounded/detail/overlapping_range.hpp> #include <operators/forward.hpp> #include <bounded/concepts.hpp> #include <numeric_traits/min_max_value.hpp> #include <utility> namespace bounded { // Specialize this class to give the correct type for your own extreme function // if the default does not work. Types that cannot be used to construct this // type are assumed to never be valid results, and are thus implicitly ignored // as possible extreme candidates. template<typename Compare, typename T1, typename T2> struct extreme_type { using type = std::common_type_t<T1, T2>; }; template<typename Compare, typename T1, typename T2> using extreme_t = typename extreme_type<Compare, std::decay_t<T1>, std::decay_t<T2>>::type; // TODO: This should be selected only for less and greater template<typename Compare, bounded_integer LHS, bounded_integer RHS> struct extreme_type<Compare, LHS, RHS> { private: static constexpr auto select = [](auto const lhs, auto const rhs) { if constexpr (Compare{}(lhs, rhs)) { return normalize<lhs>; } else { return normalize<rhs>; } }; static constexpr auto minimum = select(numeric_traits::min_value<LHS>, numeric_traits::min_value<RHS>); static constexpr auto maximum = select(numeric_traits::max_value<LHS>, numeric_traits::max_value<RHS>); public: using type = integer<minimum, maximum>; }; // Unlike the standard versions of min and max, which accept a fixed number of // arguments, these functions accept a variadic pack. Therefore, there is no way // to distinguish whether the user wanted to compare all of the object with // `operator<` or a comparison function. The separately named function `extreme` // serves that purpose. // // Because the variadic pack must be at the end of the parameter list, `extreme` // accepts the comparison function as the first argument constexpr inline struct extreme_function { private: template<typename Compare, typename T1, typename T2> using result_type = detail::add_common_cv_reference_t<extreme_t<Compare, T2, T1>, T1, T2>; template<typename T1, typename T2> static constexpr decltype(auto) extreme_two(auto compare, T1 && t1, T2 && t2) { using result_t = result_type<decltype(compare), T1, T2>; return compare(t2, t1) ? static_cast<result_t>(OPERATORS_FORWARD(t2)) : static_cast<result_t>(OPERATORS_FORWARD(t1)); } public: constexpr decltype(auto) operator()(auto /* compare */, auto && t) const { return OPERATORS_FORWARD(t); } template<typename T1, typename T2> constexpr decltype(auto) operator()(auto compare, T1 && t1, T2 && t2) const { using result_t = result_type<decltype(compare), T1, T2>; if constexpr (not constructible_from<result_t, T2>) { return OPERATORS_FORWARD(t1); } else if constexpr (not constructible_from<result_t, T1>) { return OPERATORS_FORWARD(t2); } else { return extreme_two(std::move(compare), OPERATORS_FORWARD(t1), OPERATORS_FORWARD(t2)); } } constexpr decltype(auto) operator()(auto compare, auto && t1, auto && t2, auto && ... ts) const { return operator()( compare, operator()(compare, OPERATORS_FORWARD(t1), OPERATORS_FORWARD(t2)), OPERATORS_FORWARD(ts)... ); } } extreme; inline constexpr auto min = [](auto && ... ts) -> decltype(auto) { return extreme(less(), OPERATORS_FORWARD(ts)...); }; inline constexpr auto max = [](auto && ... ts) -> decltype(auto) { return extreme(greater(), OPERATORS_FORWARD(ts)...); }; } // namespace bounded
34.591304
104
0.74007
davidstone
f62e1234fa1a148eb52e1ac6a306e54ee5500807
5,204
hpp
C++
include/eve/detail/function/simd/x86/slide_left.hpp
leha-bot/eve
30e7a7f6bcc5cf524a6c2cc624234148eee847be
[ "MIT" ]
null
null
null
include/eve/detail/function/simd/x86/slide_left.hpp
leha-bot/eve
30e7a7f6bcc5cf524a6c2cc624234148eee847be
[ "MIT" ]
null
null
null
include/eve/detail/function/simd/x86/slide_left.hpp
leha-bot/eve
30e7a7f6bcc5cf524a6c2cc624234148eee847be
[ "MIT" ]
null
null
null
//================================================================================================== /* EVE - Expressive Vector Engine Copyright : EVE Contributors & Maintainers SPDX-License-Identifier: MIT */ //================================================================================================== #pragma once #include <eve/detail/implementation.hpp> #include <eve/detail/function/simd/x86/specifics.hpp> #include <eve/conditional.hpp> namespace eve::detail { template<real_scalar_value T, typename N, std::ptrdiff_t Shift> EVE_FORCEINLINE wide<T,N> slide_left_ ( EVE_SUPPORTS(sse2_) , wide<T,N> v, index_t<Shift> ) noexcept requires(Shift <= N::value) && x86_abi<abi_t<T, N>> { if constexpr(Shift == 0) return v; else if constexpr(Shift == N::value) return wide<T,N>{0}; else { if constexpr( std::same_as<abi_t<T, N>,x86_128_>) { constexpr auto shift = Shift*sizeof(T); using i_t = as_integer_t<wide<T,N>, unsigned>; auto const b = bit_cast(v, as<i_t>()); auto result = bit_cast(i_t(_mm_bsrli_si128( b, shift)), as(v)); return result; } else if constexpr( std::same_as<abi_t<T, N>,x86_256_>) { if constexpr( current_api >= avx2) { using i_t = as_integer_t<wide<T,N>>; constexpr auto offset = Shift * sizeof(T); i_t vi = bit_cast(v, as<i_t>{}); i_t bvi = _mm256_permute2x128_si256(vi, vi, 0x83); if constexpr(offset == 16) { return bit_cast(bvi,as(v)); } else if constexpr(offset < 16) { return bit_cast(i_t(_mm256_alignr_epi8 (bvi, vi, offset)) , as(v)); } else { return bit_cast(i_t(_mm256_bsrli_epi128(bvi, offset - 16)), as(v)); } } else { constexpr auto shifted_bytes = sizeof(T)* Shift; using f_t = typename wide<T,N>::template rebind<float>; auto const w = bit_cast(v, as<f_t>{}); auto const s0 = _mm256_permute2f128_ps(w,w,0x81 ); if constexpr(shifted_bytes == 4 * 7) { return bit_cast(f_t(_mm256_permute_ps(_mm256_blend_ps(f_t(0), s0, 0x8), 0x93)), as(v)); } else if constexpr(shifted_bytes == 4 * 6) { return bit_cast(f_t( _mm256_shuffle_ps(s0, f_t(0), 0xe)), as(v)); } else if constexpr(shifted_bytes == 4 * 5) { return bit_cast(f_t(_mm256_permute_ps(_mm256_blend_ps(f_t(0), s0, 0xe), 0x39)),as(v)); } else if constexpr(shifted_bytes == 4 * 4) { return bit_cast(f_t(s0), as(v)); } else if constexpr(shifted_bytes == 4 * 3) { return bit_cast(f_t(_mm256_permute_ps(_mm256_blend_ps(w, s0, 0x77), 0x93)), as(v)); } else if constexpr(shifted_bytes == 4 * 2 ) { return bit_cast(f_t(_mm256_shuffle_ps(w, s0, 0x4e)), as(v)); } else if constexpr(shifted_bytes == 4 ) { return bit_cast(f_t(_mm256_permute_ps(_mm256_blend_ps(w, s0, 0x11), 0x39)), as(v)); } else { if constexpr(shifted_bytes > 16 ) { auto h = _mm256_extractf128_si256(v, 0x1); h = _mm_bsrli_si128(h, shifted_bytes - 16); return _mm256_zextsi128_si256(h); } else { // Small integers can be done with partial slide after slicing auto[l,h] = slice(v); // Slide higher parts as normal auto h0 = slide_left(h, index<Shift>); // Slide lower parts using _mm_alignr_epi8 using byte_t = typename wide<T,N>::template rebind<std::uint8_t,fixed<16>>; byte_t bytes = _mm_alignr_epi8( bit_cast(h,as<byte_t>{}) , bit_cast(l,as<byte_t>{}) , shifted_bytes ); // Shift everything in place return wide<T,N>{bit_cast(bytes, as(h0)),h0}; } } } } else if constexpr( std::same_as<abi_t<T, N>,x86_512_>) { // Generates vperm + pand, good enough for now return basic_swizzle(v, slide_left_pattern<Shift,N::value>); } } } template<simd_value Wide, std::ptrdiff_t Shift> EVE_FORCEINLINE logical<Wide> slide_left_(EVE_SUPPORTS(avx512_), logical<Wide> v, index_t<Shift>) noexcept requires(Shift <= Wide::size() ) { if constexpr(Shift == 0) return v; else if constexpr(Shift == Wide::size()) return logical<Wide>{false}; else { // We use >> for slide_left due to x86 endianness of SIMD register auto mask = v.bitmap(); mask >>= Shift; using s_t = typename logical<Wide>::storage_type; return s_t{static_cast<typename s_t::type>(mask.to_ulong())}; } } }
34.693333
100
0.5098
leha-bot
f62e4ac3e9bffef5000fa3d3acff38c24289ffe1
14,263
cpp
C++
Bank.cpp
LLiu6/Eva-CAM
0ff4f725d12ef17066ee61a6c4b7ce713507a63a
[ "MIT" ]
null
null
null
Bank.cpp
LLiu6/Eva-CAM
0ff4f725d12ef17066ee61a6c4b7ce713507a63a
[ "MIT" ]
null
null
null
Bank.cpp
LLiu6/Eva-CAM
0ff4f725d12ef17066ee61a6c4b7ce713507a63a
[ "MIT" ]
null
null
null
#include "Bank.h" #include "CAM_SubArray.h" #include "Mat.h" #include "formula.h" #include "global.h" #include "macros.h" Bank::Bank() { // TODO Auto-generated constructor stub initialized = false; invalid = false; } Bank::~Bank() { // TODO Auto-generated destructor stub } void Bank::PrintProperty() { cout << "Bank Properties:" << endl; FunctionUnit::PrintProperty(); } void Bank::debug() { cout << & mat << endl; cout << & numActiveSubarrayPerRow << endl; } void Bank::printbreakdown() { double latency = 0; if (inputParameter->NoPrechargeInc) { latency = mat.subarray.bitlineDelay + mat.subarray.ColMux[mat.subarray.indexMatchline].readLatency + mat.subarray.senseAmpLatency + mat.subarray.outputAcc.readLatency; } else { latency = mat.subarray.searchLatency; } double energy = mat.subarray.searchDynamicEnergy; if (inputParameter->IncludeLeakge) { energy += mat.leakage * latency; } if (inputParameter->scaledVoltage > 0) { energy = energy / tech->vdd / tech->vdd * inputParameter->scaledVoltage * inputParameter->scaledVoltage; } // /////////////// AREA ////////////// // cout << endl; cout << "========= Subarray Area Breakdown =========" << endl; cout << " |--- Total Cell Area = " << TO_SQM(mat.subarray.lenRow * mat.subarray.lenCol) << endl; cout << " |--- Input Buffer Area = " << TO_SQM(mat.subarray.inputBuf.area * mat.subarray.numRow) << endl; cout << " |--- Input Encoder Area = " << TO_SQM(mat.subarray.inputEnc.area) << endl; cout << " |--- Row Decoder Area = " << TO_SQM(mat.subarray.RowDecMergeNand.area) << endl; double RowDriverArea = 0; for(int i=0;i<CAM_cell->camNumRow;i++){ RowDriverArea += mat.subarray.RowDriver[i].area; } cout << " |--- Row Driver Area = " << TO_SQM(RowDriverArea) << endl; cout << " |--- Precharger Area = " << TO_SQM(mat.subarray.precharger.area) << endl; if(inputParameter->withWriteDriver == true){ cout << " |--- Write Driver Area = " << TO_SQM(mat.subarray.WriteDriverArea) << endl; } double ColMuxArea = 0; for(int i=0;i<CAM_cell->camNumCol;i++){ ColMuxArea += mat.subarray.ColMux[i].area; } cout << " |--- Column Mux Area = " << TO_SQM(ColMuxArea)<< endl; cout << " |--- Sense Amplifier Area = " << TO_SQM(mat.subarray.senseAmp.area) << endl; cout << " |--- Mux of SA = " << TO_SQM(mat.subarray.senseAmpMuxLev1.area + mat.subarray.senseAmpMuxLev2.area + mat.subarray.senseAmpMuxLev1Nand.area + mat.subarray.senseAmpMuxLev2Nand.area) << endl; cout << " |--- Output Accumulator Area = " << TO_SQM(mat.subarray.outputAcc.area * mat.subarray.numColumn / mat.subarray.muxSenseAmp) << endl; if(inputParameter->withPriorityEnc == true){ cout << " |--- Priority Encoder Area = " << TO_SQM(mat.subarray.priorityEnc.area) << endl; } cout << " |--- Output Buffer Area = " << TO_SQM(mat.subarray.outputBuf.area * mat.subarray.numColumn / mat.subarray.muxSenseAmp) << endl; cout << endl; /////////////// latency ////////////// cout << "========= Search Latency Breakdown =========" << endl; // cout << endl; // cout << " |- Mat Search Latency = " << TO_SECOND(mat.subarray.readLatency) << endl; // cout << " |-- Subarray Search Latency = " << TO_SECOND(mat.subarray.readLatency) << endl; // cout << " |-- Predecoder Search Latency = " << TO_SECOND(mat.rowPredecoderBlock1.readLatency + mat.rowPredecoderBlock2.readLatency + mat.bitlineMuxPredecoderBlock1.readLatency + mat.bitlineMuxPredecoderBlock2.readLatency + // mat.senseAmpMuxLev1PredecoderBlock1.readLatency + mat.senseAmpMuxLev1PredecoderBlock2.readLatency + // mat.senseAmpMuxLev2PredecoderBlock1.readLatency + mat.senseAmpMuxLev2PredecoderBlock2.readLatency) << endl; cout << " |--- Input Encoder Latency = " << TO_SECOND(mat.subarray.inputEnc.readLatency) << endl; cout << " |--- Row Decoder Latency = " << TO_SECOND(mat.subarray.RowDecMergeNand.readLatency +mat.subarray.senseAmpMuxLev1Nand.readLatency +mat.subarray.senseAmpMuxLev2Nand.readLatency) << endl; double RowDriverLatency = 0; for(int i=0;i<CAM_cell->camNumRow;i++){ RowDriverLatency = MAX(mat.subarray.RowDriver[i].readLatency, readLatency); } cout << " |--- Row Driver Latency = " << TO_SECOND(RowDriverLatency) << endl; cout << " |--- Precharger Latency = " << TO_SECOND(mat.subarray.precharger.readLatency) << endl; cout << " |--- Bitline Latency = " << TO_SECOND(mat.subarray.bitlineDelay) << endl; double ColDriverLatency = 0; for(int i=0;i<CAM_cell->camNumCol;i++){ ColDriverLatency = MAX(mat.subarray.ColMux[i].readLatency, readLatency); } cout << " |--- Column Mux Latency = " << TO_SECOND(ColDriverLatency) << endl; cout << " |--- Sense Amplifier Latency = " << TO_SECOND(mat.subarray.senseAmpLatency) << endl; cout << " |--- MUX of SA Latency = " << TO_SECOND(mat.subarray.senseAmpMuxLev1.readLatency + mat.subarray.senseAmpMuxLev2.readLatency) << endl; if(inputParameter->withOutputAcc = true){ cout << " |--- Output Accumulator Latency = " << TO_SECOND(mat.subarray.outputAcc.readLatency) << endl; } if(inputParameter->withPriorityEnc = true){ cout << " |--- Priority Encoder Latency = " << TO_SECOND(mat.subarray.priorityEnc.readLatency) << endl; } cout << endl; /////////////// energy ////////////// cout << "========= Search Dynamic Energy Breakdown =========" << endl; // cout << " |-- Mat Dynamic Search Energy = " << TO_JOULE(mat.readDynamicEnergy) << endl; // cout << " |-- Subarray Search Energy = " << TO_JOULE(mat.subarray.readDynamicEnergy) << endl; //cout << "Search Dynamic Energy" << TO_JOULE(mat.subarray.searchAverage) << endl; // cout << " |-- Predecoder Energy = " << TO_JOULE(mat.rowPredecoderBlock1.readDynamicEnergy + mat.rowPredecoderBlock2.readDynamicEnergy + mat.bitlineMuxPredecoderBlock1.readDynamicEnergy + mat.bitlineMuxPredecoderBlock2.readDynamicEnergy + // mat.senseAmpMuxLev1PredecoderBlock1.readDynamicEnergy + mat.senseAmpMuxLev1PredecoderBlock2.readDynamicEnergy + // mat.senseAmpMuxLev2PredecoderBlock1.readDynamicEnergy + mat.senseAmpMuxLev2PredecoderBlock2.readDynamicEnergy) << endl; cout << " |--- Input Encoder Dynamic Energy = " << TO_JOULE(mat.subarray.inputEnc.readDynamicEnergy) << endl; cout << " |--- Row Decoder Dynamic Energy = " << TO_JOULE(mat.subarray.RowDecMergeNand.readDynamicEnergy) << endl; double RowSearchDynamicEnergy = 0; for(int i=0;i<CAM_cell->camNumRow;i++){ RowSearchDynamicEnergy += mat.subarray.RowDriver[i].readDynamicEnergy; } cout << " |--- RowDriver Dynamic Energy = " << TO_JOULE(RowSearchDynamicEnergy) << endl; //For FeFET *16 cout << " |--- Precharger Dynamic Energy = " << TO_JOULE(mat.subarray.precharger.readDynamicEnergy) << endl; // TODO: not ly the breakdown cout << " |--- Cell Read Energy = " << TO_JOULE(mat.subarray.cellReadEnergy) << endl; double ColMuxreadDynamicEnergy = 0; for(int i=0;i<CAM_cell->camNumCol;i++){ ColMuxreadDynamicEnergy += mat.subarray.ColMux[i].readDynamicEnergy; } cout << " |--- Column Mux Dynamic Energy = " << TO_JOULE(ColMuxreadDynamicEnergy) << endl; cout << " |--- Sense Amplifier Dynamic Energy = " << TO_JOULE(mat.subarray.senseAmp.readDynamicEnergy) << endl; cout << " |--- MUX of SA Dynamic Energy = " << TO_JOULE(mat.subarray.senseAmpMuxLev1.readDynamicEnergy + mat.subarray.senseAmpMuxLev2.readDynamicEnergy) << endl; if(inputParameter->withOutputAcc == true){ cout << " |--- Output Accumulator Dynamic Energy = " << TO_JOULE(mat.subarray.outputAcc.readDynamicEnergy) << endl; } if(inputParameter->withPriorityEnc == true){ cout << " |--- Priority Encoder Dynamic Energy = " << TO_JOULE(mat.subarray.priorityEnc.readDynamicEnergy) << endl; } cout << endl; ///////////////////xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx//////////////////////////// /////////////// energy ////////////// cout << "========= Write Dynamic Energy Breakdown =========" << endl; // cout << " |- Mat Write Search Energy = " << TO_JOULE(mat.writeDynamicEnergy) << endl; // cout << " |-- Subarray Dynamic Energy = " << TO_JOULE(mat.subarray.writeDynamicEnergy) << endl; // cout << " |-- Predecoder Dynamic Energy = " << TO_JOULE(mat.rowPredecoderBlock1.writeDynamicEnergy + mat.rowPredecoderBlock2.writeDynamicEnergy + mat.bitlineMuxPredecoderBlock1.writeDynamicEnergy+ mat.bitlineMuxPredecoderBlock2.writeDynamicEnergy+ // mat.senseAmpMuxLev1PredecoderBlock1.writeDynamicEnergy+ mat.senseAmpMuxLev1PredecoderBlock2.writeDynamicEnergy + // mat.senseAmpMuxLev2PredecoderBlock1.writeDynamicEnergy+ mat.senseAmpMuxLev2PredecoderBlock2.writeDynamicEnergy) << endl; cout << " |--- Cell Reset Energy = " << TO_JOULE(mat.subarray.cellResetEnergy) << endl; cout << " |--- Cell Set Energy = " << TO_JOULE(mat.subarray.cellSetEnergy) << endl; cout << " |--- Input Encoder Dynamic Energy = " << TO_JOULE(mat.subarray.inputEnc.writeDynamicEnergy) << endl; cout << " |--- Row Decoder Dynamic Energy = " << TO_JOULE(mat.subarray.RowDecMergeNand.writeDynamicEnergy) << endl; double RowWriteDynamicEnergy = 0; for(int i=0;i<CAM_cell->camNumRow;i++){ RowWriteDynamicEnergy += mat.subarray.RowDriver[i].writeDynamicEnergy*16; } cout << " |--- RowDriver Dynamic Energy = " << TO_JOULE(RowWriteDynamicEnergy) << endl; cout << " |--- Precharger Dynamic Energy = " << TO_JOULE(mat.subarray.precharger.writeDynamicEnergy) << endl; // TODO: not really the breakdown double ColWriteDynamicEnergy = 0; for(int i=0;i<CAM_cell->camNumCol;i++){ ColWriteDynamicEnergy += mat.subarray.ColMux[i].writeDynamicEnergy; } cout << " |--- Column Mux Dynamic Energy = " << TO_JOULE(ColWriteDynamicEnergy) << endl; cout << " |--- Sense Amplifier Dynamic Energy = " << TO_JOULE(mat.subarray.senseAmp.writeDynamicEnergy) << endl; cout << " |--- MUX of SA Dynamic Energy = " << TO_JOULE(mat.subarray.senseAmpMuxLev1.writeDynamicEnergy + mat.subarray.senseAmpMuxLev2.writeDynamicEnergy) << endl; if(inputParameter->withOutputAcc == true){ cout << " |--- Output Accumulator Dynamic Energy = " << TO_JOULE(mat.subarray.outputAcc.writeDynamicEnergy) << endl; } if(inputParameter->withPriorityEnc == true){ cout << " |--- Priority Encoder Dynamic Energy = " << TO_JOULE(mat.subarray.priorityEnc.writeDynamicEnergy) << endl; } cout << endl; ///////////////////xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx//////////////////////////// /////////////// leakage ////////////// cout << "============ Leakage Breakdown ============" << endl; // cout << " |- Mat Leakage = " << TO_WATT(mat.leakage) << endl; // cout << " |-- Subarray Leakage = " << TO_WATT(mat.subarray.leakage) << endl; // cout << " |-- Predocoder Leakage = " << TO_WATT(mat.rowPredecoderBlock1.leakage + mat.rowPredecoderBlock2.leakage + // mat.bitlineMuxPredecoderBlock1.leakage + mat.bitlineMuxPredecoderBlock2.leakage + // mat.senseAmpMuxLev1PredecoderBlock1.leakage + mat.senseAmpMuxLev1PredecoderBlock2.leakage + // mat.senseAmpMuxLev2PredecoderBlock1.leakage + mat.senseAmpMuxLev2PredecoderBlock2.leakage ) << endl; cout << " |--- Input Encoder Leakage = " << TO_WATT(mat.subarray.inputEnc.leakage) << endl; cout << " |--- Row Decoder Leakage = " << TO_WATT(mat.subarray.RowDecMergeNand.leakage) << endl; double leakage = 0; for(int i=0;i<CAM_cell->camNumRow;i++){ leakage += mat.subarray.RowDriver[i].leakage; } cout << " |--- Row Driver Leakage = " << TO_WATT(leakage) << endl; cout << " |--- Precharger Leakage = " << TO_WATT(mat.subarray.precharger.leakage) << endl; leakage = 0; for(int i=0;i<CAM_cell->camNumCol;i++){ leakage += mat.subarray.ColMux[i].leakage; } cout << " |--- Column Mux Leakage = " << TO_WATT(leakage) << endl; cout << " |--- Sense Amplifier Leakage = " << TO_WATT(mat.subarray.senseAmp.leakage) << endl; cout << " |--- MUX of SA Leakage = " << TO_WATT(mat.subarray.senseAmpMuxLev1.leakage + mat.subarray.senseAmpMuxLev2.leakage) << endl; if(inputParameter->withOutputAcc == true){ cout << " |--- Output Accumulator Leakage = " << TO_WATT(mat.subarray.outputAcc.leakage) << endl; } if(inputParameter->withPriorityEnc == true){ cout << " |--- Priority Encoder Leakage = " << TO_WATT(mat.subarray.priorityEnc.leakage) << endl; } } Bank & Bank::operator=(const Bank &rhs) { height = rhs.height; width = rhs.width; area = rhs.area; readLatency = rhs.readLatency; writeLatency = rhs.writeLatency; readDynamicEnergy = rhs.readDynamicEnergy; writeDynamicEnergy = rhs.writeDynamicEnergy; resetLatency = rhs.resetLatency; setLatency = rhs.setLatency; resetDynamicEnergy = rhs.resetDynamicEnergy; setDynamicEnergy = rhs.setDynamicEnergy; cellReadEnergy = rhs.cellReadEnergy; cellSetEnergy = rhs.cellSetEnergy; cellResetEnergy = rhs.cellResetEnergy; leakage = rhs.leakage; initialized = rhs.initialized; invalid = rhs.invalid; numRowMat = rhs.numRowMat; numColumnMat = rhs.numColumnMat; capacity = rhs.capacity; blockSize = rhs.blockSize; associativity = rhs.associativity; numRowPerSet = rhs.numRowPerSet; numActiveMatPerRow = rhs.numActiveMatPerRow; numActiveMatPerColumn = rhs.numActiveMatPerColumn; muxSenseAmp = rhs.muxSenseAmp; internalSenseAmp = rhs.internalSenseAmp; muxOutputLev1 = rhs.muxOutputLev1; muxOutputLev2 = rhs.muxOutputLev2; areaOptimizationLevel = rhs.areaOptimizationLevel; memoryType = rhs.memoryType; camType = rhs.camType; searchFunction = rhs.searchFunction; numRowSubarray = rhs.numRowSubarray; numColumnSubarray = rhs.numColumnSubarray; numActiveSubarrayPerRow = rhs.numActiveSubarrayPerRow; numActiveSubarrayPerColumn = rhs.numActiveSubarrayPerColumn; mat = rhs.mat; searchLatency = rhs.searchLatency; searchDynamicEnergy = rhs.searchDynamicEnergy; numBitSerial = rhs.numBitSerial; return *this; }
53.620301
262
0.665638
LLiu6
f63b6d50e4b33d161b28afdf225ff44848afd77e
98
cpp
C++
src/data/vector.cpp
jamillosantos/autuofm-walking-gait
d07eb026adf518627fa1cb50234b06d679ec0505
[ "MIT" ]
null
null
null
src/data/vector.cpp
jamillosantos/autuofm-walking-gait
d07eb026adf518627fa1cb50234b06d679ec0505
[ "MIT" ]
null
null
null
src/data/vector.cpp
jamillosantos/autuofm-walking-gait
d07eb026adf518627fa1cb50234b06d679ec0505
[ "MIT" ]
null
null
null
/** * @author J. Santos <jamillo@gmail.com> * @date September 20, 2016 */ #include "vector.h"
14
40
0.622449
jamillosantos
f6416654fdf6c8829cd827464ce6327216dd51fd
1,114
cpp
C++
library/unionfind.cpp
arlechann/atcoder
1af08efa6d3a0e8c75e4eaf13e1eda994820b9e2
[ "CC0-1.0" ]
null
null
null
library/unionfind.cpp
arlechann/atcoder
1af08efa6d3a0e8c75e4eaf13e1eda994820b9e2
[ "CC0-1.0" ]
null
null
null
library/unionfind.cpp
arlechann/atcoder
1af08efa6d3a0e8c75e4eaf13e1eda994820b9e2
[ "CC0-1.0" ]
null
null
null
#include <numeric> #include <vector> // UnionFind(disjoint set) class UnionFind { std::vector<size_t> parents; std::vector<size_t> rank; std::vector<size_t> tree_size; public: UnionFind(size_t size) : parents(size), rank(size, 0), tree_size(size, 1) { std::iota(this->parents.begin(), this->parents.end(), 0); } // 併合 bool merge(size_t a, size_t b) { size_t ar = this->root(a); size_t br = this->root(b); if(ar == br) { return false; } if(this->rank[ar] < this->rank[br]) { std::swap(ar, br); } if(this->rank[ar] == this->rank[br]) { this->rank[ar]++; } this->tree_size[ar] += this->tree_size[br]; return this->parents[br] = ar; } bool unite(size_t a, size_t b) { return this->merge(a, b); } // 同集合か判定 bool is_same(size_t a, size_t b) { return this->root(a) == this->root(b); } bool is_union(size_t a, size_t b) { return this->is_same(a, b); } // 集合の大きさ size_t size(size_t n) { return this->tree_size[this->root(n)]; } private: size_t root(int n) { if(this->parents[n] == n) { return n; } return this->parents[n] = this->root(this->parents[n]); } };
23.208333
76
0.616697
arlechann
f641e997606c545ee6be2721411f22059c1cd889
2,090
hpp
C++
Volt/src/Volt/Graphics/OpenGL/Buffers.hpp
Oxydros/Volt
e87eba5711c78be0ee4e6eb3edc67c1fcdb8e416
[ "Apache-2.0" ]
null
null
null
Volt/src/Volt/Graphics/OpenGL/Buffers.hpp
Oxydros/Volt
e87eba5711c78be0ee4e6eb3edc67c1fcdb8e416
[ "Apache-2.0" ]
null
null
null
Volt/src/Volt/Graphics/OpenGL/Buffers.hpp
Oxydros/Volt
e87eba5711c78be0ee4e6eb3edc67c1fcdb8e416
[ "Apache-2.0" ]
null
null
null
#pragma once #include "Volt/Graphics/Buffers.hpp" namespace Volt::Graphics::OpenGL { //OpenGL implementation of Volt::Graphics::VertexBuffer class VertexBuffer : public Volt::Graphics::VertexBuffer { public: VertexBuffer(float const *vertices, size_t count); virtual ~VertexBuffer(); public: void Bind() override; void Unbind() override; void SetLayout(VertexBufferLayout const &&layout) override { m_layout = layout; } void SetLayout(VertexBufferLayout const &layout) override { m_layout = layout; } VertexBufferLayout const &GetLayout() const override { return m_layout; } private: VertexBufferLayout m_layout; uint32_t m_bufferId; }; //OpenGL implementation of Volt::Graphics::IndexBuffer class IndexBuffer : public Volt::Graphics::IndexBuffer { public: IndexBuffer(int const *indices, size_t count); virtual ~IndexBuffer(); public: void Bind() override; void Unbind() override; size_t GetCount() const override { return m_count; } private: size_t m_count; uint32_t m_bufferId; }; //OpenGL implementation of Volt::Graphics::VertexArray class VertexArray : public Volt::Graphics::VertexArray { public: VertexArray(); virtual ~VertexArray(); void Bind() override; void Unbind() override; void AddVertexBuffer(VertexBuffer::VertexBufferPtr const &vertexBuffer) override; std::vector<VertexBuffer::VertexBufferPtr> GetVertexBuffers() const override { return m_vertexBufferVec; } void SetIndexBuffer(IndexBuffer::IndexBufferPtr const &indexBuffer) override; IndexBuffer::IndexBufferPtr const &GetIndexBuffer() const override { return m_indexBuffer; } private: uint32_t m_arrayObjectId; std::vector<VertexBuffer::VertexBufferPtr> m_vertexBufferVec; IndexBuffer::IndexBufferPtr m_indexBuffer; }; }
32.153846
114
0.647847
Oxydros
f64506193fcdac04e70171309bf651ab21721991
1,475
cpp
C++
Source/RuntimeBpExample/Scripting/GrenadeScriptNodes.cpp
HiIAmMoot/RuntimeBPs
1fe34ae0ea8d9e0ca376c7ec663a0e2cf537c77b
[ "MIT" ]
61
2020-04-30T06:50:47.000Z
2022-03-25T05:41:29.000Z
Source/RuntimeBpExample/Scripting/GrenadeScriptNodes.cpp
monizka/RuntimeBPs
8def2f98bed6d2d5705c12ffe54c3f7123395265
[ "MIT" ]
7
2020-11-09T14:40:07.000Z
2021-02-25T01:22:32.000Z
Source/RuntimeBpExample/Scripting/GrenadeScriptNodes.cpp
monizka/RuntimeBPs
8def2f98bed6d2d5705c12ffe54c3f7123395265
[ "MIT" ]
21
2020-05-23T16:39:29.000Z
2022-03-25T05:41:31.000Z
// Fill out your copyright notice in the Description page of Project Settings. #include "GrenadeScriptNodes.h" #include "RuntimeBlueprints/RuntimeBpMacros.h" #include "RuntimeBlueprints/RuntimeBpConstructor.h" #include "Kismet/KismetStringLibrary.h" /** * Called when an explosion starts */ UGrenadeExplode::UGrenadeExplode() { NodeName = "On Grenade Explosion"; NodeDescription = "Called when this grenade explodes"; NodeCategory = "Events|Grenade"; OutputPins.SetNum(4); OutputPins[0].MakeNodePin("Then"); OutputPins[1].MakeNodePin("Grenade", EVariableTypes::Grenade); OutputPins[2].MakeNodePin("Instigator", EVariableTypes::Actor); OutputPins[3].MakeNodePin("Transform", EVariableTypes::Transform); } void UGrenadeExplode::ConstructNode(URuntimeBpConstructor* ConstructorClass, int ConstructedNodeIndex, const FString& ConstructedNodeName, UPARAM(ref) TArray<FPinStruct>& ConstructedInputPins, UPARAM(ref) TArray<FPinStruct>& ConstructedOutputPins) { // Register this node in the constructor if (ConstructorClass) { Cast<UGrenadeScript>(ConstructorClass)->GrenadeExplosionNode = this; } Super::ConstructNode(ConstructorClass, ConstructedNodeIndex, ConstructedNodeName, ConstructedInputPins, ConstructedOutputPins); } UCastObjectToGrenade::UCastObjectToGrenade() { RUNTIME_BP_CAST_CONSTRUCTOR(UObject, Object, Grenade) } void UCastObjectToGrenade::Execute(int Index, int FromLoopIndex) { RUNTIME_BP_CAST_EXECUTE(Object, ARuntimeBpGrenade, Grenade) }
34.302326
247
0.805424
HiIAmMoot
f64c3ab25d060f6d36011d60882c89920602c9d4
3,391
hpp
C++
src/Domain/BoundaryConditions/Periodic.hpp
nilsvu/spectre
1455b9a8d7e92db8ad600c66f54795c29c3052ee
[ "MIT" ]
117
2017-04-08T22:52:48.000Z
2022-03-25T07:23:36.000Z
src/Domain/BoundaryConditions/Periodic.hpp
GitHimanshuc/spectre
4de4033ba36547113293fe4dbdd77591485a4aee
[ "MIT" ]
3,177
2017-04-07T21:10:18.000Z
2022-03-31T23:55:59.000Z
src/Domain/BoundaryConditions/Periodic.hpp
geoffrey4444/spectre
9350d61830b360e2d5b273fdd176dcc841dbefb0
[ "MIT" ]
85
2017-04-07T19:36:13.000Z
2022-03-01T10:21:00.000Z
// Distributed under the MIT License. // See LICENSE.txt for details. #pragma once #include <memory> #include <pup.h> #include "Domain/BoundaryConditions/BoundaryCondition.hpp" #include "Options/Options.hpp" #include "Parallel/CharmPupable.hpp" #include "Utilities/TMPL.hpp" namespace domain::BoundaryConditions { /// Mark a boundary condition as being periodic. /// /// Periodic boundary conditions shouldn't require any implementation outside of /// a check in the domain creator using the `is_periodic()` function to /// determine what boundaries are periodic. Across each matching pair of /// periodic boundary conditions, the domain creator should specify that the DG /// elements are neighbors of each other. class MarkAsPeriodic { public: MarkAsPeriodic() = default; MarkAsPeriodic(MarkAsPeriodic&&) = default; MarkAsPeriodic& operator=(MarkAsPeriodic&&) = default; MarkAsPeriodic(const MarkAsPeriodic&) = default; MarkAsPeriodic& operator=(const MarkAsPeriodic&) = default; virtual ~MarkAsPeriodic() = 0; }; /*! * \brief Periodic boundary conditions. * * To use with a specific system add: * * \code * domain::BoundaryConditions::Periodic<your::system::BoundaryConditionBase> * \endcode * * to the list of creatable classes. * * \note Not all domain creators will allow you to specify periodic boundary * conditions since they may not make sense. */ template <typename SystemBoundaryConditionBaseClass> struct Periodic final : public SystemBoundaryConditionBaseClass, public MarkAsPeriodic { public: using options = tmpl::list<>; static constexpr Options::String help{ "Periodic boundary conditions.\n\nNote: Not all domain creators will " "allow you to specify periodic boundary conditions since they may not " "make sense."}; static std::string name() { return "Periodic"; } Periodic() = default; Periodic(Periodic&&) = default; Periodic& operator=(Periodic&&) = default; Periodic(const Periodic&) = default; Periodic& operator=(const Periodic&) = default; ~Periodic() override = default; explicit Periodic(CkMigrateMessage* msg); WRAPPED_PUPable_decl_base_template( domain::BoundaryConditions::BoundaryCondition, Periodic); auto get_clone() const -> std::unique_ptr< domain::BoundaryConditions::BoundaryCondition> override; void pup(PUP::er& p) override; }; template <typename SystemBoundaryConditionBaseClass> Periodic<SystemBoundaryConditionBaseClass>::Periodic( CkMigrateMessage* const msg) : SystemBoundaryConditionBaseClass(msg) {} template <typename SystemBoundaryConditionBaseClass> std::unique_ptr<domain::BoundaryConditions::BoundaryCondition> Periodic<SystemBoundaryConditionBaseClass>::get_clone() const { return std::make_unique<Periodic>(*this); } template <typename SystemBoundaryConditionBaseClass> void Periodic<SystemBoundaryConditionBaseClass>::pup(PUP::er& p) { BoundaryCondition::pup(p); } /// \cond template <typename SystemBoundaryConditionBaseClass> // NOLINTNEXTLINE PUP::able::PUP_ID Periodic<SystemBoundaryConditionBaseClass>::my_PUP_ID = 0; /// \endcond /// Check if a boundary condition inherits from `MarkAsPeriodic`, which /// constitutes as it being marked as a periodic boundary condition. bool is_periodic(const std::unique_ptr<BoundaryCondition>& boundary_condition); } // namespace domain::BoundaryConditions
33.574257
80
0.758183
nilsvu
f64cadc899508f6a334d0e9d31d4c01a837823d0
1,840
cpp
C++
src/opbox/ops/OpCount.cpp
faodel/faodel
ef2bd8ff335433e695eb561d7ecd44f233e58bf0
[ "MIT" ]
2
2019-01-25T21:21:07.000Z
2021-04-29T17:24:00.000Z
src/opbox/ops/OpCount.cpp
faodel/faodel
ef2bd8ff335433e695eb561d7ecd44f233e58bf0
[ "MIT" ]
8
2018-10-09T14:35:30.000Z
2020-09-30T20:09:42.000Z
src/opbox/ops/OpCount.cpp
faodel/faodel
ef2bd8ff335433e695eb561d7ecd44f233e58bf0
[ "MIT" ]
2
2019-04-23T19:01:36.000Z
2021-05-11T07:44:55.000Z
// Copyright 2021 National Technology & Engineering Solutions of Sandia, LLC // (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. // Government retains certain rights in this software. #include <iostream> #include <chrono> #include <thread> #include <sstream> #include <map> #include "faodel-common/Debug.hh" #include "opbox/ops/Op.hh" #include "opbox/ops/OpCount.hh" using namespace std; using namespace opbox; const unsigned int OpCount::op_id = const_hash("OpCount"); const std::string OpCount::op_name = "OpCount"; OpCount::OpCount(int num_left) : Op(false), num_left(num_left), state(State::start) { } WaitingType OpCount::Wait() { count_future.get(); return WaitingType::done_and_destroy; } WaitingType OpCount::UpdateOrigin(OpArgs *args) { switch(state){ case State::start: F_ASSERT(args->type == UpdateType::user_trigger, "Was expecting a user trigger?"); if(num_left){ num_left--; } { int t1 = getMSTimeStamp(); int diff = t1 - ts_created; std::cout <<"Opcount at state "<<GetStateName()<<" with steps left="<<dec<<num_left<<" AliveTime(ms): "<<diff<<std::endl; if(!num_left){ std::cout << "OpCount done\n"; state=State::done; return WaitingType::done_and_destroy; } } std::this_thread::sleep_for(std::chrono::seconds(1)); return WaitingType::wait_on_user; case State::done: return WaitingType::done_and_destroy; default: cout <<"Unknown state: "<<GetStateName()<<endl; exit(-1); } //Shouldn't get here return WaitingType::error; } std::string OpCount::GetStateName() const { const static map<State,string> names = { { State::start, "Start" }, { State::done, "Done" } }; //TODO: safe version would assert find isn't end return names.find(state)->second; }
25.205479
127
0.668478
faodel
f65164f11a0a704283692bb0820509cd5e661b66
3,954
hpp
C++
shared_model/interfaces/base/signable.hpp
steephengeorge/iroha
9e0e19035308c6ebaf706f709c5b7b3ac46e708b
[ "Apache-2.0" ]
null
null
null
shared_model/interfaces/base/signable.hpp
steephengeorge/iroha
9e0e19035308c6ebaf706f709c5b7b3ac46e708b
[ "Apache-2.0" ]
null
null
null
shared_model/interfaces/base/signable.hpp
steephengeorge/iroha
9e0e19035308c6ebaf706f709c5b7b3ac46e708b
[ "Apache-2.0" ]
null
null
null
/** * Copyright Soramitsu Co., Ltd. 2017 All Rights Reserved. * http://soramitsu.co.jp * * 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. */ #ifndef IROHA_SIGNABLE_HPP #define IROHA_SIGNABLE_HPP #include <boost/optional.hpp> #include "cryptography/hash_providers/sha3_256.hpp" #include "interfaces/common_objects/signable_hash.hpp" #include "interfaces/common_objects/signature.hpp" #include "interfaces/common_objects/types.hpp" #include "utils/string_builder.hpp" namespace shared_model { namespace crypto { class Signed; class PublicKey; } // namespace crypto namespace interface { #ifdef DISABLE_BACKWARD #define SIGNABLE(Model) Signable<Model> #else #define SIGNABLE(Model) Signable<Model, iroha::model::Model> #endif /** * Interface provides signatures and adds them to model object * @tparam Model - your new style model */ #ifndef DISABLE_BACKWARD template <typename Model, typename OldModel, typename HashProvider = shared_model::crypto::Sha3_256> class Signable : public Primitive<Model, OldModel> { #else template <typename Model, typename HashProvider = shared_model::crypto::Sha3_256> class Signable : public ModelPrimitive<Model> { #endif public: using HashProviderType = HashProvider; /** * @return attached signatures */ virtual const SignatureSetType &signatures() const = 0; /** * Attach signature to object * @param signature - signature object for insertion * @return true, if signature was added */ virtual bool addSignature(const crypto::Signed &signed_blob, const crypto::PublicKey &public_key) = 0; /** * Clear object's signatures * @return true, if signatures were cleared */ virtual bool clearSignatures() = 0; /** * @return time of creation */ virtual types::TimestampType createdTime() const = 0; /** * @return object payload (everything except signatures) */ virtual const types::BlobType &payload() const = 0; /** * @return blob representation of object include signatures */ virtual const types::BlobType &blob() const = 0; /** * Provides comparison based on equality of objects and signatures. * @param rhs - another model object * @return true, if objects totally equal */ bool operator==(const Model &rhs) const override { return this->hash() == rhs.hash() and this->signatures() == rhs.signatures() and this->createdTime() == rhs.createdTime(); } const types::HashType &hash() const { if (hash_ == boost::none) { hash_.emplace(HashProviderType::makeHash(payload())); } return *hash_; } // ------------------------| Primitive override |------------------------- std::string toString() const override { return detail::PrettyStringBuilder() .init("Signable") .append("created_time", std::to_string(createdTime())) .appendAll(signatures(), [](auto &signature) { return signature->toString(); }) .finalize(); } private: mutable boost::optional<types::HashType> hash_; }; } // namespace interface } // namespace shared_model #endif // IROHA_SIGNABLE_HPP
29.954545
80
0.636318
steephengeorge
f651f361d37676da86178c6b382b80ba3b6c8ea7
4,912
cpp
C++
ODFAEG/src/odfaeg/Math/distribution.cpp
Cwc-Test/ODFAEG
5e5bd13e3145764c3d0182225aad591040691481
[ "Zlib" ]
5
2015-06-13T13:11:59.000Z
2020-04-17T23:10:23.000Z
ODFAEG/src/odfaeg/Math/distribution.cpp
Cwc-Test/ODFAEG
5e5bd13e3145764c3d0182225aad591040691481
[ "Zlib" ]
4
2019-01-07T11:46:21.000Z
2020-02-14T15:04:15.000Z
ODFAEG/src/odfaeg/Math/distribution.cpp
Cwc-Test/ODFAEG
5e5bd13e3145764c3d0182225aad591040691481
[ "Zlib" ]
4
2016-01-05T09:54:57.000Z
2021-01-06T18:52:26.000Z
///////////////////////////////////////////////////////////////////////////////// // // Thor C++ Library // Copyright (c) 2011-2014 Jan Haller // // 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. // ///////////////////////////////////////////////////////////////////////////////// #include "../../../include/odfaeg/Math/distributions.h" #include <cassert> namespace odfaeg { namespace math { namespace Distributions { namespace { template <typename T> Distribution<T> uniformT(T min, T max) { assert(min <= max); return [=] () -> T { return Math::random(min, max); }; } } // --------------------------------------------------------------------------------------------------------------------------- Distribution<int> uniformi(int min, int max) { return uniformT(min, max); } Distribution<unsigned int> uniformui(unsigned int min, unsigned int max) { return uniformT(min, max); } Distribution<float> uniform(float min, float max) { return uniformT(min, max); } Distribution<sf::Time> uniform(sf::Time min, sf::Time max) { assert(min <= max); const float floatMin = min.asSeconds(); const float floatMax = max.asSeconds(); return [=] () -> sf::Time { return sf::seconds(Math::random(floatMin, floatMax)); }; } Distribution<sf::Vector3f> rect(sf::Vector3f center, sf::Vector3f halfSize) { assert(halfSize.x >= 0.f && halfSize.y >= 0.f); return [=] () -> sf::Vector3f { return sf::Vector3f( Math::random(center.x - halfSize.x, center.x + halfSize.x), Math::random(center.y - halfSize.y, center.y + halfSize.y), Math::random(center.z - halfSize.z, center.z + halfSize.z)); }; } Distribution<sf::Vector3f> circle(sf::Vector3f center, float radius) { assert(radius >= 0.f); return [=] () -> sf::Vector3f { //sf::Vector3f radiusVector = sf::Vector3f(radius * std::sqrt(Math::random(0.f, 1.f)), Math::random(0.f, 360.f), 0); sf::Vector3f radiusVector = sf::Vector3f(Math::random(0, radius) * Math::cosinus(Math::random(0, Math::toRadians(360))), Math::random(0, radius) * Math::sinus(Math::random(0, Math::toRadians(360))), 0); return center + radiusVector; }; } Distribution<sf::Vector3f> deflect(sf::Vector3f direction, float maxRotation) { return [=] () -> sf::Vector3f { Vec3f v(direction.x, direction.y, direction.z); graphic::TransformMatrix tm; tm.setRotation(Vec3f(0, 0, 1), Math::random(0.f - maxRotation, 0.f + maxRotation)); Vec3f t = tm.transform(v); return sf::Vector3f(t.x, t.y, t.z); }; } Distribution<sf::Color> color(Vec3f color1, Vec3f color2) { return [=] () -> sf::Color { sf::Color color; color.r = Math::clamp(Math::random(color1.x, color2.x), 0, 255); color.g = Math::clamp(Math::random(color1.y, color2.y), 0, 255); color.b = Math::clamp(Math::random(color1.z, color2.z), 0, 255); color.a = Math::clamp(Math::random(color1.w, color2.w), 0, 255); return color; }; } } } // namespace Distributions } // namespace thor
37.212121
222
0.47842
Cwc-Test
f652a71a22dae1054c6f15fb8c7d0c29dfe71f60
291
cpp
C++
software/PC/src/main.cpp
Squantor/oven_controller
6137674dec8b9c74423a35cbdf6b7c5f2976d5ac
[ "MIT" ]
2
2021-04-25T12:13:31.000Z
2021-09-22T23:10:11.000Z
software/PC/src/main.cpp
Squantor/oven_controller
6137674dec8b9c74423a35cbdf6b7c5f2976d5ac
[ "MIT" ]
null
null
null
software/PC/src/main.cpp
Squantor/oven_controller
6137674dec8b9c74423a35cbdf6b7c5f2976d5ac
[ "MIT" ]
1
2021-03-05T07:11:58.000Z
2021-03-05T07:11:58.000Z
/* SPDX-License-Identifier: MIT Copyright (c) 2021 Bart Bilos For conditions of distribution and use, see LICENSE file */ #include <test.h> #include <stdio.h> #include <iostream> int main(int argc, char *argv[]) //int main() { testfunc(); printf("Hello World!\n"); return 0; }
16.166667
56
0.670103
Squantor
f65409c2ff4756bf2fdcbdbb337e351e634c08a4
3,015
cpp
C++
Misli/Source/Common/Logger.cpp
mmatokovi/mmatokovi_engine
951a92868519d7739d3e0320a8b8c1c64c4a318f
[ "MIT" ]
1
2022-02-07T13:06:00.000Z
2022-02-07T13:06:00.000Z
Misli/Source/Common/Logger.cpp
mmatokovi/mmatokovi_engine
951a92868519d7739d3e0320a8b8c1c64c4a318f
[ "MIT" ]
null
null
null
Misli/Source/Common/Logger.cpp
mmatokovi/mmatokovi_engine
951a92868519d7739d3e0320a8b8c1c64c4a318f
[ "MIT" ]
null
null
null
#include "Misli.h" #include <fstream> #include <Shlobj.h> #include <cstdio> #include <tlhelp32.h> Logger* Logger::inst; Logger::Logger() { inst = this; } Logger::~Logger() { } /* Print to our log file with optional arguments */ VOID Logger::PrintLog(const WCHAR* fmt, ...) { WCHAR buf[4096]; va_list args; va_start(args, fmt); vswprintf_s(buf, fmt, args); va_end(args); //MessageBox(0, buf, 0, 0); OutputDebugString(buf); // Example File and Location = %AppData%/BlankProject/Log/BlankProject03052021194056.log std::wfstream outfile; outfile.open(std::wstring(LogDirectory() + L"/" + LogFile()), std::ios_base::app); if (outfile.is_open()) { std::wstring s = buf; outfile << L"[" << Time::GetDateTimeString() << L"] " << s; outfile.close(); OutputDebugString(s.c_str()); } else { MessageBox(NULL, L"Unable to open log file...", L"Log Error", MB_OK); } } /* Get and Create Log Directory in AppData/$ProjectName/Log */ std::wstring Logger::LogDirectory() { WCHAR Path[1024]; WCHAR* AppDataLocal; SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0, nullptr, &AppDataLocal); wcscpy_s(Path, AppDataLocal); wcscat_s(Path, L"\\"); wcscat_s(Path, PerGameSettings::GameName()); CreateDirectory(Path, NULL); wcscat_s(Path, L"\\Log"); CreateDirectory(Path, NULL); return Path; } std::wstring Logger::LogFile() { WCHAR File[1024]; wcscpy_s(File, PerGameSettings::GameName()); wcscat_s(File, PerGameSettings::BootTime()); wcscat_s(File, L".log"); return File; } /* Print a seperator line without time stamp */ VOID Logger::PrintDebugSeperator() { std::wstring s = L"\n------------------------------------------------------------------------------------\n\n"; #ifdef _DEBUG std::wfstream outfile; outfile.open(std::wstring(LogDirectory() + L"/" + LogFile()), std::ios_base::app); if (outfile.is_open()) { outfile << s; outfile.close(); } else { MessageBox(NULL, L"Unable to open log file...", L"Log Error", MB_OK); } #endif } /* Private class to check to see if MTail is already running - So we don't open multiple copies during debug */ BOOL Logger::IsMTailRunning() { bool exists = false; PROCESSENTRY32 entry; entry.dwSize = sizeof(PROCESSENTRY32); HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); if (Process32First(snapshot, &entry)) while (Process32Next(snapshot, &entry)) if (!_wcsicmp(entry.szExeFile, L"mTAIL.exe")) exists = true; CloseHandle(snapshot); return exists; } /* Start MTail from Project or Build Directory - Depends on where ran from */ VOID Logger::StartMTail() { if (IsMTailRunning()) { Logger::PrintLog(L"--MTail failed to start - Already Running\n"); return; } Logger::PrintLog(L"--Starting MTail\n"); WCHAR path[MAX_PATH] = { 0 }; GetCurrentDirectoryW(MAX_PATH, path); std::wstring url = path + std::wstring(L"/mTAIL.exe"); std::wstring params = L" \"" + LogDirectory() + L"/" + LogFile() + L"\" /start"; ShellExecute(0, NULL, url.c_str(), params.c_str(), NULL, SW_SHOWDEFAULT); }
24.12
112
0.667662
mmatokovi
f65438b5c3ce800abbc826c52f1e5db6289073d0
9,490
cpp
C++
partition.cpp
Yichen-Si/vt-topmed
e22e964a68e236b190b3038318ca9799f1922e0e
[ "MIT" ]
null
null
null
partition.cpp
Yichen-Si/vt-topmed
e22e964a68e236b190b3038318ca9799f1922e0e
[ "MIT" ]
1
2019-12-26T09:34:03.000Z
2019-12-26T09:34:03.000Z
partition.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 <atks@umich.edu> 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 "partition.h" namespace { class OverlapStats { public: uint32_t a,ab,b,a_ins,ab_ins,b_ins,a_del,ab_del,b_del; uint32_t a_ts,ab_ts,b_ts,a_tv,ab_tv,b_tv; OverlapStats() { a = 0; ab = 0; b = 0; a_ts = 0; a_tv = 0; ab_ts = 0; ab_tv = 0; b_ts = 0; b_tv = 0; a_ins = 0; a_del = 0; ab_ins = 0; ab_del = 0; b_ins = 0; b_del = 0; }; }; class Igor : Program { public: std::string version; /////////// //options// /////////// std::string filters; std::vector<std::string> input_vcf_files; std::vector<GenomeInterval> intervals; std::string interval_list; bool write_partition; /////// //i/o// /////// BCFSyncedReader *sr; ////////// //filter// ////////// std::string fexp; Filter filter; bool filter_exists; ///////// //stats// ///////// OverlapStats stats; //////////////// //common tools// //////////////// VariantManip *vm; Igor(int argc, char ** argv) { ////////////////////////// //options initialization// ////////////////////////// try { std::string desc = "partition variants from two data sets.\n"; version = "0.5"; TCLAP::CmdLine cmd(desc, ' ', version); VTOutput my; cmd.setOutput(&my); TCLAP::ValueArg<std::string> arg_intervals("i", "i", "intervals []", false, "", "str", cmd); TCLAP::ValueArg<std::string> arg_interval_list("I", "I", "file containing list of intervals []", false, "", "file", cmd); TCLAP::ValueArg<std::string> arg_fexp("f", "f", "filter", false, "", "str", cmd); TCLAP::SwitchArg arg_write_partition("w", "w", "write partitioned variants to file", cmd, false); TCLAP::UnlabeledMultiArg<std::string> arg_input_vcf_files("<in1.vcf><in2.vcf>", "2 input VCF files for comparison", true, "files", cmd); cmd.parse(argc, argv); fexp = arg_fexp.getValue(); parse_intervals(intervals, arg_interval_list.getValue(), arg_intervals.getValue()); write_partition = arg_write_partition.getValue(); input_vcf_files = arg_input_vcf_files.getValue(); if (input_vcf_files.size()!=2) { std::cerr << "error: require 2 VCF files\n"; exit(1); } } catch (TCLAP::ArgException &e) { std::cerr << "error: " << e.error() << " for arg " << e.argId() << "\n"; abort(); } }; void initialize() { ////////////////////// //i/o initialization// ////////////////////// sr = new BCFSyncedReader(input_vcf_files, intervals, SYNC_BY_VAR); /////////////////////// //tool initialization// /////////////////////// vm = new VariantManip(""); ///////////////////////// //filter initialization// ///////////////////////// filter.parse(fexp.c_str()); filter_exists = fexp=="" ? false : true; //////////////////////// //stats initialization// //////////////////////// } void partition() { //for combining the alleles std::vector<bcfptr*> crecs; Variant variant; std::vector<int32_t> presence(2, 0); BCFOrderedWriter *a; BCFOrderedWriter *ab[2]; BCFOrderedWriter *b; if (write_partition) { a = new BCFOrderedWriter("a-b.bcf"); a->link_hdr(sr->hdrs[0]); a->write_hdr(); ab[0] = new BCFOrderedWriter("a&b1.bcf"); ab[0]->link_hdr(sr->hdrs[0]); ab[0]->write_hdr(); ab[1] = new BCFOrderedWriter("a&b2.bcf"); ab[1]->link_hdr(sr->hdrs[1]); ab[1]->write_hdr(); b = new BCFOrderedWriter("b-a.bcf"); b->link_hdr(sr->hdrs[1]); b->write_hdr(); } while(sr->read_next_position(crecs)) { int32_t vtype = vm->classify_variant(crecs[0]->h, crecs[0]->v, variant); //check existence for (int32_t i=0; i<crecs.size(); ++i) { if (filter_exists && !filter.apply(crecs[i]->h,crecs[i]->v,&variant)) { continue; } ++presence[crecs[i]->file_index]; } int32_t ts = 0; int32_t tv = 0; int32_t ins = 0; int32_t del = 0; std::vector<Allele>& alleles = variant.alleles; for (int32_t i=0; i<alleles.size(); ++i) { ts += alleles[i].ts; tv += alleles[i].tv; ins += alleles[i].dlen ? variant.alleles[i].ins : 0; del += alleles[i].dlen ? 1-variant.alleles[i].ins : 0; } update_overlap_stats(presence, ts, tv, ins, del); if (write_partition) { if (presence[0]) { if (presence[1]) { ab[crecs[0]->file_index]->write(crecs[0]->v); ab[crecs[1]->file_index]->write(crecs[1]->v); } else { a->write(crecs[0]->v); } } else if (presence[1]) { b->write(crecs[0]->v); } } presence[0] = 0; presence[1] = 0; } if (write_partition) { a->close(); ab[0]->close(); ab[1]->close(); b->close(); } }; void update_overlap_stats(std::vector<int32_t>& presence, int32_t ts, int32_t tv, int32_t ins, int32_t del) { //update overlap stats if (presence[0] && !presence[1]) { ++stats.a; stats.a_ts += ts; stats.a_tv += tv; stats.a_ins += ins; stats.a_del += del; } else if (presence[0] && presence[1]) { ++stats.ab; stats.ab_ts += ts; stats.ab_tv += tv; stats.ab_ins += ins; stats.ab_del += del; } else if (!presence[0] && presence[1]) { ++stats.b; stats.b_ts += ts; stats.b_tv += tv; stats.b_ins += ins; stats.b_del += del; } } void print_options() { std::clog << "partition v" << version << "\n"; std::clog << "\n"; std::clog << "Options: input VCF file a " << input_vcf_files[0] << "\n"; std::clog << " input VCF file b " << input_vcf_files[1] << "\n"; print_str_op(" [f] filter ", fexp); print_boo_op(" [w] write_partition ", write_partition); print_int_op(" [i] intervals ", intervals); std::clog << "\n"; } void print_stats() { fprintf(stderr, " A: %10d variants\n", stats.a+stats.ab); fprintf(stderr, " B: %10d variants\n", stats.ab+stats.b); fprintf(stderr, "\n"); fprintf(stderr, " ts/tv ins/del\n"); fprintf(stderr, " A-B %10d [%.2f] [%.2f]\n", stats.a, (float)stats.a_ts/(stats.a_tv), (float)stats.a_ins/(stats.a_del)); fprintf(stderr, " A&B %10d [%.2f] [%.2f]\n", stats.ab, (float)stats.ab_ts/stats.ab_tv, (float)stats.ab_ins/(stats.ab_del)); fprintf(stderr, " B-A %10d [%.2f] [%.2f]\n", stats.b, (float)stats.b_ts/(stats.b_tv), (float)stats.b_ins/(stats.b_del)); fprintf(stderr, " of A %4.1f%%\n", 100*(float)stats.ab/(stats.a+stats.ab)); fprintf(stderr, " of B %4.1f%%\n", 100*(float)stats.ab/(stats.b+stats.ab)); fprintf(stderr, "\n"); }; ~Igor() { }; private: }; } void partition(int argc, char ** argv) { Igor igor(argc, argv); igor.print_options(); igor.initialize(); igor.partition(); igor.print_stats(); }
29.563863
148
0.482613
Yichen-Si
f65a0a6db1ac024a425585a333559567f04ec571
5,119
cpp
C++
src/globals.cpp
scottwalmsley/QualMS
7dc54d1b7464e0cf6c78a57544b4ccee8bbb4c68
[ "Apache-2.0" ]
null
null
null
src/globals.cpp
scottwalmsley/QualMS
7dc54d1b7464e0cf6c78a57544b4ccee8bbb4c68
[ "Apache-2.0" ]
null
null
null
src/globals.cpp
scottwalmsley/QualMS
7dc54d1b7464e0cf6c78a57544b4ccee8bbb4c68
[ "Apache-2.0" ]
null
null
null
/* * globals.cpp * Copyright 2012 Scott Walmsley, Hyungwon Choi and Damian Fermin * */ #include <getopt.h> #include <iostream> #include <string> #include <map> #include <deque> #include <cstdlib> #include <fstream> #include "boost/multi_array.hpp" #include "boost/filesystem.hpp" #include "boost/regex.hpp" #include "boost/algorithm/string/regex.hpp" // for split_regex() function using namespace std; using namespace boost; namespace fs = filesystem; // Global variables int g_STATES_K = -1; // For k states in hidden Markov model string g_inputDirPath; int g_BIC_low = 0; // BIC estimates need boundaries int g_BIC_high = 0; bool g_runBIC = false; void print_usage() { cerr << "\nUSAGE: qualMS.exe -k -b -d\n\n" << "Command flags:\n" << " -k Assume 'k' states.\n" << " -d <path> Path to folder containing input matrix files. ** Required input **\n\n" << " -b <#:#> Provide an estimate for best number of 'k' states using BIC\n" << " Example usage: -b 3:10 means consider between 3 and 10 states\n" << " Using the -b flag, qualMS will only report the best value for K and exit" << "\n\n"; } void parse_command_line_args(int argc, char *argv[]) { if(argc < 3) { print_usage(); exit(0); } g_inputDirPath = "empty"; string bic_str; int c; while( (c = getopt(argc, argv, "k:d:b:")) != -1 ) { switch(c) { case 'k': g_STATES_K = atoi(optarg); break; case 'd': g_inputDirPath = optarg; break; case 'b': bic_str = optarg; g_runBIC = true; break; default: print_usage(); exit(0); } } string L = bic_str.substr(0, bic_str.find(":") ); string H = bic_str.substr(bic_str.find(":")+1); g_BIC_low = atoi( L.c_str() ); g_BIC_high = atoi( H.c_str() ); if( g_runBIC && (g_BIC_low < 4) ) { cerr << endl << "WARNING: The lower bound for option -b is too small.\n" << "Adjusting the lowest estimator for k to be 4\n\n"; g_BIC_low = 4; } if( !g_runBIC && g_STATES_K < 4) { cerr << "\nERROR: k = " << g_STATES_K << " is an invalid value.\n" << "You must provided a number >= 4 for -k\n\n"; exit(0); } if( g_runBIC && g_STATES_K > 1 ) { cerr << "\nERROR: You can't use -k and -b options together.\n\n"; exit(0); } if(g_inputDirPath == "empty") { cerr << "\nERROR: -d option must be provided.\n" << "Please indicate the path to the matrix files\n\n"; exit(0); } } // Function reads in each input file and stores it into a multi_array object void parseInputFiles(int &Ncol, int &Nrow, deque<string> &fileNameDeq) { Ncol = 0; Nrow = 0; fs::path p = g_inputDirPath.c_str(); fs::directory_iterator end_iter; if( !fs::exists(p) ) { cerr << "\nERROR: Unable to find source directory " << g_inputDirPath << endl; exit(EXIT_FAILURE); } if( fs::is_regular_file(p) ) { cerr << "\nERROR: " << g_inputDirPath << " is a regular file. I need a folder\n"; exit(EXIT_FAILURE); } // Record the names of the files we are going to read in and store them // into the 'fileNameDeq' for(fs::directory_iterator dir_iter(p); dir_iter != end_iter; ++dir_iter) { if(fs::is_regular_file(dir_iter->status())) { // skip files that don't end in .txt. if(dir_iter->path().extension() != ".txt") continue; string s = dir_iter->path().generic_string(); fileNameDeq.push_back(s); } } // Determine the dimensions of the files we are going to read. // We are assuming that all of the files have the exact same dimensions. ifstream in; in.open(fileNameDeq.at(0).c_str()); if(!in.is_open() ) { cerr << "\nERROR: Unable to open '" << fileNameDeq.at(0) << "'\nExiting now.\n"; exit(EXIT_FAILURE); } vector<string> fields; string line; while( !in.eof() ) { getline(in, line); if(line.length() < 3) continue; Nrow++; if(Ncol == 0) { // get number of columns split_regex(fields, line, regex( "[\\s|\\t]+" ) ); Ncol = (signed) fields.size(); } } in.close(); } // Function returns the maximum value in a double vector along // with the index of that value in the vector void getMaxIndexVec(vector<double> &v, double &maxVal, int &index) { index = 0; maxVal = v.at(0); for(int i = 0; i < (signed) v.size(); i++) { if(v.at(i) > maxVal) { maxVal = v.at(i); index = i; } } } // Function returns the maximum value obtained from the difference of two // equal length vectors double getMaxAbsVectorDiff(vector<double> &A, vector<double> &B) { double ret = 0; double delta; double abs_delta; int N = (signed) A.size(); // A.size() must equal B.size() for(int i = 0; i < N; i++) { delta = A.at(i) - B.at(i); abs_delta = fabs(delta); if(abs_delta > ret) ret = abs_delta; } return ret; } // function to round doubles to N number of decimal places double round_dbl(double r, int places) { double off = pow((double)10, places); return ( round(r * off) / off ); }
24.37619
99
0.603047
scottwalmsley
2ceb82ecbdc9af222dc8e7ab4e5116e82145976d
194
cpp
C++
Code full house/bt buoi 3 - nguyen dinh trung duc/bai21 printf.cpp
ducyb2001/CbyTrungDuc
0e93394dce600876a098b90ae969575bac3788e1
[ "Apache-2.0" ]
null
null
null
Code full house/bt buoi 3 - nguyen dinh trung duc/bai21 printf.cpp
ducyb2001/CbyTrungDuc
0e93394dce600876a098b90ae969575bac3788e1
[ "Apache-2.0" ]
null
null
null
Code full house/bt buoi 3 - nguyen dinh trung duc/bai21 printf.cpp
ducyb2001/CbyTrungDuc
0e93394dce600876a098b90ae969575bac3788e1
[ "Apache-2.0" ]
null
null
null
/* bai 21 */ #include <stdio.h> int main (){ int i,j,n; int num=1; scanf ("%d", &n); for (i=1; i<=n; i++){ for (j=1; j<=i; j++){ printf ("%d",num); num++; } printf ("\n"); } }
12.125
23
0.417526
ducyb2001
2cf5edf57acac3a38cfcd5a190060f2e14bf0c5e
632
cpp
C++
app/main.cpp
BlackPhrase/DLL-Bin-Compat-CPP-Interface
0ea7111afdb618c139f3f12f205cbbccd37f1368
[ "Unlicense" ]
null
null
null
app/main.cpp
BlackPhrase/DLL-Bin-Compat-CPP-Interface
0ea7111afdb618c139f3f12f205cbbccd37f1368
[ "Unlicense" ]
null
null
null
app/main.cpp
BlackPhrase/DLL-Bin-Compat-CPP-Interface
0ea7111afdb618c139f3f12f205cbbccd37f1368
[ "Unlicense" ]
null
null
null
#include <cstdlib> #include <windows.h> #include "IPlugin.hpp" #ifdef USE_NAMESPACES using namespace pluginspace; #endif int main(int argc, char **argv) { auto hPlugin{LoadLibrary("liblib")}; if(!hPlugin) return EXIT_FAILURE; auto fnGetPlugin{(pfnGetPlugin)GetProcAddress(hPlugin, "GetPlugin")}; if(!fnGetPlugin) return EXIT_FAILURE; #ifdef WANNABECOM auto pPlugin{(IPlugin*)fnGetPlugin()}; #else auto pPlugin{fnGetPlugin()}; #endif if(!pPlugin) return EXIT_FAILURE; pPlugin->Init(); pPlugin->Shutdown(); //pPlugin->Release(); system("pause"); FreeLibrary(hPlugin); return EXIT_SUCCESS; };
15.414634
70
0.710443
BlackPhrase
2cf6347851383f05c02465800ad5dc8ee49c2120
2,180
hpp
C++
gecode/third-party/boost/config/compiler/clang.hpp
guidotack/gecode
027c57889d66dd26ad8e1a419c2cda22ab0cf305
[ "MIT-feh" ]
216
2016-07-11T12:44:44.000Z
2022-03-24T01:48:06.000Z
gecode/third-party/boost/config/compiler/clang.hpp
guidotack/gecode
027c57889d66dd26ad8e1a419c2cda22ab0cf305
[ "MIT-feh" ]
105
2018-02-01T15:51:15.000Z
2022-03-05T16:10:36.000Z
gecode/third-party/boost/config/compiler/clang.hpp
guidotack/gecode
027c57889d66dd26ad8e1a419c2cda22ab0cf305
[ "MIT-feh" ]
73
2016-02-15T07:09:36.000Z
2022-03-22T23:10:26.000Z
// (C) Copyright Douglas Gregor 2010 // // Use, modification and distribution are subject to 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://www.boost.org for most recent version. // Clang compiler setup. #if __has_feature(cxx_exceptions) && !defined(GECODE_BOOST_NO_EXCEPTIONS) #else # define GECODE_BOOST_NO_EXCEPTIONS #endif #if !__has_feature(cxx_rtti) # define GECODE_BOOST_NO_RTTI #endif #if defined(__int64) # define GECODE_BOOST_HAS_MS_INT64 #endif #define GECODE_BOOST_HAS_NRVO // Clang supports "long long" in all compilation modes. #define GECODE_BOOST_NO_AUTO_DECLARATIONS #define GECODE_BOOST_NO_AUTO_MULTIDECLARATIONS #define GECODE_BOOST_NO_CHAR16_T #define GECODE_BOOST_NO_CHAR32_T #define GECODE_BOOST_NO_CONSTEXPR #if !__has_feature(cxx_decltype) # define GECODE_BOOST_NO_DECLTYPE #endif #define GECODE_BOOST_NO_DEFAULTED_FUNCTIONS #if !__has_feature(cxx_deleted_functions) # define GECODE_BOOST_NO_DELETED_FUNCTIONS #endif #define GECODE_BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #if !__has_feature(cxx_default_function_template_args) #define GECODE_BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS #endif #define GECODE_BOOST_NO_INITIALIZER_LISTS #define GECODE_BOOST_NO_LAMBDAS #define GECODE_BOOST_NO_NOEXCEPT #define GECODE_BOOST_NO_NULLPTR #define GECODE_BOOST_NO_RAW_LITERALS #define GECODE_BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX #if !__has_feature(cxx_rvalue_references) # define GECODE_BOOST_NO_RVALUE_REFERENCES #endif #if !__has_feature(cxx_strong_enums) # define GECODE_BOOST_NO_SCOPED_ENUMS #endif #if !__has_feature(cxx_static_assert) # define GECODE_BOOST_NO_STATIC_ASSERT #endif #define GECODE_BOOST_NO_TEMPLATE_ALIASES #define GECODE_BOOST_NO_UNICODE_LITERALS #if !__has_feature(cxx_variadic_templates) # define GECODE_BOOST_NO_VARIADIC_TEMPLATES #endif // Clang always supports variadic macros // Clang always supports extern templates #ifndef GECODE_BOOST_COMPILER # define GECODE_BOOST_COMPILER "Clang version " __clang_version__ #endif // Macro used to identify the Clang compiler. #define GECODE_BOOST_CLANG 1
25.348837
73
0.837615
guidotack
2cf738ac27e22932ef159db5f477031cf76b3479
7,671
cpp
C++
tests/parallel/get_var_datatype_gensimcell.cpp
nasailja/gensimcell
65726d0bfffff3f4dfd526a925974c32b37cec5e
[ "BSD-3-Clause" ]
null
null
null
tests/parallel/get_var_datatype_gensimcell.cpp
nasailja/gensimcell
65726d0bfffff3f4dfd526a925974c32b37cec5e
[ "BSD-3-Clause" ]
null
null
null
tests/parallel/get_var_datatype_gensimcell.cpp
nasailja/gensimcell
65726d0bfffff3f4dfd526a925974c32b37cec5e
[ "BSD-3-Clause" ]
null
null
null
/* Tests get_var_mpi_datatype for an array of generic simulation cells. Copyright 2014, 2015, 2016 Ilja Honkonen All rights reserved. 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 copyright holders nor the names of their 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 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. */ #include "array" #include "cstdlib" #include "iostream" #include "tuple" #include "mpi.h" #include "check_true.hpp" #include "gensimcell.hpp" struct test_variable1 { using data_type = int; }; struct test_variable2 { using data_type = float; }; struct test_variable3 { using data_type = char; }; using cell1_t = gensimcell::Cell< gensimcell::Never_Transfer, test_variable1 >; using cell2_t = gensimcell::Cell< gensimcell::Always_Transfer, test_variable1, test_variable2 >; using cell3_t = gensimcell::Cell< gensimcell::Optional_Transfer, test_variable1, test_variable2, test_variable3 >; int main(int argc, char* argv[]) { const test_variable1 v1{}; const test_variable2 v2{}; const test_variable3 v3{}; if (MPI_Init(&argc, &argv) != MPI_SUCCESS) { std::cerr << "Couldn't initialize MPI." << std::endl; abort(); } void* address = nullptr; int count = -1, size_in_bytes = -1; MPI_Datatype datatype = MPI_DATATYPE_NULL; // cell1_t std::array<cell1_t, 0> a1_0; std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a1_0); CHECK_TRUE( address == nullptr and count == 0 and datatype == MPI_BYTE ) std::array<cell1_t, 1> a1_1; std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a1_1); CHECK_TRUE( address == nullptr and count == 0 and datatype == MPI_BYTE ) std::array<cell1_t, 2> a1_2; std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a1_2); CHECK_TRUE( address == nullptr and count == 0 and datatype == MPI_BYTE ) // cell2_t std::array<cell2_t, 0> a2_0; std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a2_0); CHECK_TRUE( address == nullptr and count == 0 and datatype == MPI_BYTE ) std::array<cell2_t, 1> a2_1; std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a2_1); MPI_Type_size(datatype, &size_in_bytes); CHECK_TRUE( address == &(a2_1[0][v1]) and count == 1 and size_in_bytes == sizeof(test_variable1::data_type) + sizeof(test_variable2::data_type) ) std::array<cell2_t, 2> a2_2; std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a2_2); MPI_Type_size(datatype, &size_in_bytes); CHECK_TRUE( address == &(a2_2[0][v1]) and count == 1 and size_in_bytes == 2 * sizeof(test_variable1::data_type) + 2 * sizeof(test_variable2::data_type) ) // cell3_t std::array<cell3_t, 0> a3_0; cell3_t::set_transfer_all(false, v1, v2, v3); std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a3_0); CHECK_TRUE( address == nullptr and count == 0 and datatype == MPI_BYTE ) cell3_t::set_transfer_all(true, v2); std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a3_0); CHECK_TRUE( address == nullptr and count == 0 and datatype == MPI_BYTE ) cell3_t::set_transfer_all(true, v1, v3); std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a3_0); CHECK_TRUE( address == nullptr and count == 0 and datatype == MPI_BYTE ) std::array<cell3_t, 1> a3_1; cell3_t::set_transfer_all(false, v1, v2, v3); std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a3_1); CHECK_TRUE( address == nullptr and count == 0 and datatype == MPI_BYTE ) cell3_t::set_transfer_all(true, v1); std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a3_1); CHECK_TRUE( address == &(a3_1[0][v1]) and count == 1 and datatype == MPI_INT ) cell3_t::set_transfer_all(false, v1); cell3_t::set_transfer_all(true, v2); std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a3_1); CHECK_TRUE( address == &(a3_1[0][v2]) and count == 1 and datatype == MPI_FLOAT ) cell3_t::set_transfer_all(false, v2); cell3_t::set_transfer_all(true, v3); std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a3_1); CHECK_TRUE( address == &(a3_1[0][v3]) and count == 1 and datatype == MPI_CHAR ) std::array<cell3_t, 2> a3_2; cell3_t::set_transfer_all(false, v1, v2, v3); std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a3_2); CHECK_TRUE( address == nullptr and count == 0 and datatype == MPI_BYTE ) cell3_t::set_transfer_all(true, v1); std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a3_2); MPI_Type_size(datatype, &size_in_bytes); CHECK_TRUE( address == &(a3_2[0][v1]) and count == 1 and size_in_bytes == 2 * sizeof(test_variable1::data_type) ) cell3_t::set_transfer_all(false, v1); cell3_t::set_transfer_all(true, v2, v3); std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a3_2); MPI_Type_size(datatype, &size_in_bytes); CHECK_TRUE( address == &(a3_2[0][v2]) and count == 1 and size_in_bytes == 2 * sizeof(test_variable2::data_type) + 2 * sizeof(test_variable3::data_type) ) cell3_t::set_transfer_all(true, v2); cell3_t::set_transfer_all(boost::logic::indeterminate, v1, v3); a3_2[0].set_transfer(true, v3); a3_2[0].set_transfer(false, v1); a3_2[1].set_transfer(true, v1); a3_2[1].set_transfer(false, v3); std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a3_2); MPI_Type_size(datatype, &size_in_bytes); CHECK_TRUE( address == &(a3_2[0][v2]) and count == 1 and size_in_bytes == 2 * sizeof(test_variable2::data_type) + sizeof(test_variable1::data_type) + sizeof(test_variable3::data_type) ) cell3_t::set_transfer_all(boost::logic::indeterminate, v1, v2, v3); a3_2[0].set_transfer(false, v1, v2, v3); a3_2[1].set_transfer(true, v2, v3); a3_2[1].set_transfer(false, v1); std::tie(address, count, datatype) = gensimcell::detail::get_var_mpi_datatype(a3_2); MPI_Type_size(datatype, &size_in_bytes); CHECK_TRUE( address == &(a3_2[1][v2]) and count == 1 and size_in_bytes == sizeof(test_variable2::data_type) + sizeof(test_variable3::data_type) ) MPI_Finalize(); return EXIT_SUCCESS; }
25.15082
80
0.724677
nasailja
2cf77b6c449def2ee1378188dc7bfd382fa0531f
1,207
cpp
C++
sp/src/game/client/grid/c_grid_sun.cpp
GWoody/source-sdk-2013
e362ab3008d8ce68cfca8fcb780451f42c8e6102
[ "Unlicense" ]
null
null
null
sp/src/game/client/grid/c_grid_sun.cpp
GWoody/source-sdk-2013
e362ab3008d8ce68cfca8fcb780451f42c8e6102
[ "Unlicense" ]
null
null
null
sp/src/game/client/grid/c_grid_sun.cpp
GWoody/source-sdk-2013
e362ab3008d8ce68cfca8fcb780451f42c8e6102
[ "Unlicense" ]
null
null
null
/* =============================================================================== c_grid_sun.cpp Extends the base Source Engine sun with real time movement. =============================================================================== */ #include "cbase.h" #include "c_sun.h" //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- class C_GridSun : public C_Sun { public: DECLARE_CLASS( C_GridSun, C_Sun ); DECLARE_CLIENTCLASS(); virtual void OnDataChanged( DataUpdateType_t updateType ); private: bool _farZ; }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- IMPLEMENT_CLIENTCLASS_DT( C_GridSun, DT_GridSun, CGridSun ) RecvPropBool( RECVINFO(_farZ) ), END_RECV_TABLE() //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- void C_GridSun::OnDataChanged( DataUpdateType_t updateType ) { BaseClass::OnDataChanged( updateType ); m_Overlay.SetFarZ( _farZ ); }
28.738095
79
0.352941
GWoody
2cf988ad83b9d2d2cebd2af156a5373d1ca7423d
21,299
cpp
C++
Samples/Win7Samples/dataaccess/OPC/MusicBundle/Util.cpp
windows-development/Windows-classic-samples
96f883e4c900948e39660ec14a200a5164a3c7b7
[ "MIT" ]
8
2017-04-30T17:38:27.000Z
2021-11-29T00:59:03.000Z
Samples/Win7Samples/dataaccess/OPC/MusicBundle/Util.cpp
TomeSq/Windows-classic-samples
96f883e4c900948e39660ec14a200a5164a3c7b7
[ "MIT" ]
null
null
null
Samples/Win7Samples/dataaccess/OPC/MusicBundle/Util.cpp
TomeSq/Windows-classic-samples
96f883e4c900948e39660ec14a200a5164a3c7b7
[ "MIT" ]
2
2020-08-11T13:21:49.000Z
2021-09-01T10:41:51.000Z
//<SnippetMusicBundle_cppUtilWholePage> /***************************************************************************** * * File: Util.cpp * * Description: This file contains definitions for helper classes and functions. * * ------------------------------------ * * This file is part of the Microsoft Windows SDK Code Samples. * * Copyright (C) Microsoft Corporation. All rights reserved. * * This source code is intended only as a supplement to Microsoft * Development Tools and/or on-line documentation. See these other * materials for detailed information regarding Microsoft code samples. * * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A * PARTICULAR PURPOSE. * ****************************************************************************/ #include <stdio.h> #include <windows.h> #include <shlobj.h> #include <msopc.h> // For Packaging APIs #include <strsafe.h> #include "util.h" /////////////////////////////////////////////////////////////////////////////// // Description: // Returns the last error as an HRESULT. /////////////////////////////////////////////////////////////////////////////// HRESULT GetLastErrorAsHResult( VOID ) { DWORD dwError = GetLastError(); return HRESULT_FROM_WIN32(dwError); } /////////////////////////////////////////////////////////////////////////////// // Description: // Gets the target part of a relationship with the 'Internal' target mode. /////////////////////////////////////////////////////////////////////////////// HRESULT GetRelationshipTargetPart( IOpcPartSet *partSet, // Set of the parts in the package. IOpcRelationship *relationship,// Relationship that targets the required part. LPCWSTR expectedContentType, // Content type expected for the target part. IOpcPart **targetPart // Recieves pointer to target part. Method may return a valid // pointer even on failure, and the caller must always release // if a non-NULL value is returned. ) { OPC_URI_TARGET_MODE targetMode; IOpcUri * sourceUri = NULL; IUri * targetUri = NULL; IOpcPartUri * targetPartUri = NULL; BOOL partExists = FALSE; LPWSTR contentType = NULL; HRESULT hr = relationship->GetTargetMode(&targetMode); if (SUCCEEDED(hr) && targetMode != OPC_URI_TARGET_MODE_INTERNAL) { // The relationship's target is not a part. LPWSTR relationshipType = NULL; relationship->GetRelationshipType(&relationshipType); fwprintf( stderr, L"Invalid music bundle package: relationship with type %s must have Internal target mode.\n", (PWSTR)relationshipType ); // Set the return code to an error. hr = E_FAIL; CoTaskMemFree(static_cast<LPVOID>(relationshipType)); } // Relationship's target is a part; the target mode is 'Internal'. if (SUCCEEDED(hr)) { // Get the URI of the relationship source. hr = relationship->GetSourceUri(&sourceUri); } if (SUCCEEDED(hr)) { // Get the URI of the relationship target. hr = relationship->GetTargetUri(&targetUri); } if (SUCCEEDED(hr)) { // Resolve the target URI to the part name of the target part. hr = sourceUri->CombinePartUri(targetUri, &targetPartUri); } if (SUCCEEDED(hr)) { // Check that a part with the resolved part name exists in the // part set. hr = partSet->PartExists(targetPartUri, &partExists); } if (SUCCEEDED(hr) && !partExists) { // The part does not exist in the part set. fwprintf( stderr, L"Invalid music bundle package: the target part of relationship does not exist.\n" ); // Set the return code to an error. hr = E_FAIL; } if (SUCCEEDED(hr)) { // Get the part. hr = partSet->GetPart(targetPartUri, targetPart); } if (SUCCEEDED(hr)) { // Get the content type of the part. hr = (*targetPart)->GetContentType(&contentType); } if (SUCCEEDED(hr)) { if (wcscmp(contentType, expectedContentType) != 0) { // Content type of the part did not match the expected content // type. fwprintf( stderr, L"Invalid music bundle package: the target part does not have correct content type.\n" ); // Set the return code to an error. hr = E_FAIL; } } if (sourceUri) { sourceUri->Release(); sourceUri = NULL; } if (targetUri) { targetUri->Release(); targetUri = NULL; } if (targetPartUri) { targetPartUri->Release(); targetPartUri = NULL; } CoTaskMemFree(static_cast<LPVOID>(contentType)); return hr; } /////////////////////////////////////////////////////////////////////////////// // Description: // Gets the relationship of the specified type from a specified relationship // set. // Note: Method expects exactly one relationship of the specified type. This // limitation is described in the Music Bundle Package specification--and is not // imposed by the Packaging APIs or the OPC. /////////////////////////////////////////////////////////////////////////////// HRESULT GetRelationshipByType( IOpcRelationshipSet *relsSet, // Relationship set that contains the relationship. LPCWSTR relationshipType, // The relationship type of the relationship. IOpcRelationship **targetRelationship // Recieves the relationship. Method may return a valid // pointer even on failure, and the caller must always release // if a non-NULL value is returned. ) { IOpcRelationshipEnumerator * relsEnumerator = NULL; BOOL hasNext; int count = 0; // Get an enumerator of all relationships of the required type. HRESULT hr = relsSet->GetEnumeratorForType(relationshipType, &relsEnumerator); // Enumerate through relationships, ensuring that there is exactly one // relationship that has the specified type. while (SUCCEEDED(hr) && SUCCEEDED(hr = relsEnumerator->MoveNext(&hasNext)) && hasNext) { count++; if (count > 1) { // There is more than one relationship of the specified type. fwprintf( stderr, L"Invalid music bundle package: cannot have more than 1 relationship with type: %s.\n", relationshipType ); // Set the return code to an error. hr = E_FAIL; // An error was encountered; stop enumerating. break; } if (SUCCEEDED(hr)) { // Get the relationship at the current position of the enumerator. hr = relsEnumerator->GetCurrent(targetRelationship); } } if (SUCCEEDED(hr)) { if (count == 0) { // There were no relationships in the set that had the specified // type. fwprintf( stderr, L"Invalid music bundle package: relationship with type %s does not exist.\n", relationshipType ); // Set the return code to an error. hr = E_FAIL; } } if (relsEnumerator) { relsEnumerator->Release(); relsEnumerator = NULL; } return hr; } /////////////////////////////////////////////////////////////////////////////// // Description: // Forms and retrieves a full file name by combining the file name with the // base directory path. Memory for the full file name is allocated by calling // CoTaskMemAlloc, and the caller free the memory by calling CoTaskMemFree. /////////////////////////////////////////////////////////////////////////////// HRESULT GetFullFileName( LPCWSTR filePath, // The base directory path. LPCWSTR fileName, // Name of the file. LPWSTR *fullFileName // The resultant full file name. The caller must free the memory allocated // for this string buffer. ) { HRESULT hr = S_OK; size_t cchFileName = 0; size_t cchLength = 0; WCHAR * szDest = NULL; if (fullFileName == NULL) { // The fullFileName out parameter is required. // Set the return code to an error. hr = E_INVALIDARG; } // Calculate the length of the full file name buffer. if (SUCCEEDED(hr)) { // Get the length of the base directory string buffer. hr = StringCchLength(filePath, STRSAFE_MAX_CCH, &cchLength); } if (SUCCEEDED(hr)) { // Store the length of the base directory string buffer. cchFileName += cchLength; // Get the length of the file name string buffer. hr = StringCchLength(fileName, STRSAFE_MAX_CCH, &cchLength); } if (SUCCEEDED(hr)) { // Calculate the length of the full file name string buffer by adding // the length of the base directory buffer to the length of the file // name buffer, and adding 1 to account for the terminating null // character. cchFileName += cchLength; cchFileName += 1; // Allocate memory for the full file name buffer of the length in // cchFileName. *fullFileName = (LPWSTR)CoTaskMemAlloc(cchFileName*sizeof(WCHAR)); if (*fullFileName == NULL) { // Error encountered during allocation // Set the return code to an error. hr = E_OUTOFMEMORY; } } if (SUCCEEDED(hr)) { // Copy the base directory string to the full file name buffer; // retrieve a pointer to the end of the base directory string in the // full file name buffer; retrieve the number of unused characters in // the full file name buffer; finally, set the flag to fill the // remainder of the buffer with '0's if the copy succeeds, or fill the // entire buffer with '0's if the copy fails. szDest = *fullFileName; hr = StringCchCopyEx(szDest, cchFileName, filePath, &szDest, &cchFileName, 0); } if (SUCCEEDED(hr)) { // Append file name to base path in the full file name string // buffer. hr = StringCchCat(szDest, cchFileName, fileName); } return hr; } /////////////////////////////////////////////////////////////////////////////// // Description: // Creates and retrieves a full file name by combining the part name with the // base directory path. The part name is converted to a file name by replacing // the leading '/' character with '\'. Method creates the directory // structure to the full file name. Memory for the full file name is allocated // by calling CoTaskMemAlloc, and the caller free the memory by calling // CoTaskMemFree. /////////////////////////////////////////////////////////////////////////////// HRESULT CreateDirectoryFromPartName( LPCWSTR filePath, // The base directory path. LPCWSTR partName, // Part name to use to create full file name. LPWSTR *fullFileName // The resultant full file name. The caller must free the memory allocated // for this string buffer. ) { HRESULT hr = S_OK; size_t cchFileName = 0; size_t cchLength = 0; LPWSTR szDest = NULL; if (fullFileName == NULL) { // The fullFileName out parameter is required. // Set the return code to an error. hr = E_INVALIDARG; } // Calculate the length of the full file name buffer. if (SUCCEEDED(hr)) { // Get the length of the base directory string buffer. hr = StringCchLength(filePath, STRSAFE_MAX_CCH, &cchLength); } if (SUCCEEDED(hr)) { // Store the length of the base directory string buffer. cchFileName += cchLength; // Get the length of the part name string buffer. hr = StringCchLength(partName, STRSAFE_MAX_CCH, &cchLength); } if (SUCCEEDED(hr)) { // Calculate the length of the full file name string buffer by adding // the length of the base directory buffer to the length of the part // name buffer, and adding 1 to account for the terminating null // character. cchFileName += cchLength; cchFileName += 1; // Allocate memory for the full file name buffer of the length in // cchFileName. *fullFileName = (LPWSTR)CoTaskMemAlloc(cchFileName*sizeof(WCHAR)); if (!*fullFileName) { // Error encountered during allocation // Set the return code to an error. hr = E_OUTOFMEMORY; } } szDest = *fullFileName; if (SUCCEEDED(hr)) { // Copy the base directory string to the full file name buffer; // retrieve a pointer to the end of the base directory string in the // full file name buffer; retrieve the number of unused characters in // the full file name buffer; finally, set the flag to fill the // remainder of the buffer with '0's if the copy succeeds, or fill the // entire buffer with '0's if the copy fails. hr = StringCchCopyEx(szDest, cchFileName, filePath, &szDest, &cchFileName, 0); } if (SUCCEEDED(hr)) { // Recursively create the directory structure using base file path // and the part name, which is converted to the file name. for (size_t i = 0; i <= cchLength && SUCCEEDED(hr); i++, szDest++, partName++) { if (*partName == '/') { // The character is '/'; therefore, the szDest buffer // contains a directory name. // Temporarily null terminate string and create the directory. *szDest = '\0'; BOOL createDirSucceeded = CreateDirectory(*fullFileName, NULL); if (!createDirSucceeded) { // Creation of the directory failed; get the error returned // by the CreateDirectory function. hr = GetLastErrorAsHResult(); if (hr == HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS)) { // Ignore error if directory already exists. hr = S_OK; } } // Change the null character to a '\'. *szDest = '\\'; } else { // Copy the character at the current part name buffer index // to into the memory of current szDest buffer index. *szDest = *partName; } } } return hr; } /////////////////////////////////////////////////////////////////////////////// // Description: // Opens a stream to the path and file name specified, and deserializes the // file's content as the content of the part. /////////////////////////////////////////////////////////////////////////////// HRESULT WriteFileContentToPart( IOpcFactory *opcFactory, LPCWSTR filePath, // Directory where the file is located. LPCWSTR fileName, // Name of file whose content will be deserialized. IOpcPart *opcPart // Part into which the file content is deserialized. ) { HRESULT hr = S_OK; LPWSTR fullFileName = NULL; IStream * fileStream = NULL; IStream * partStream = NULL; // Get the full file name of the file. hr = GetFullFileName(filePath, fileName, &fullFileName); if (SUCCEEDED(hr)) { // Create a read-only stream over the file. hr = opcFactory->CreateStreamOnFile( fullFileName, OPC_STREAM_IO_READ, NULL, FILE_ATTRIBUTE_NORMAL, &fileStream ); } if (SUCCEEDED(hr)) { // Get the content stream of the part. hr = opcPart->GetContentStream(&partStream); } if (SUCCEEDED(hr)) { // Part content is overwritten; truncate the size of the stream to zero. ULARGE_INTEGER zero = {0}; hr = partStream->SetSize(zero); } if (SUCCEEDED(hr)) { // Copy the content from the file stream to the part content stream. ULARGE_INTEGER ul = {(UINT) -1, (UINT) -1}; hr = fileStream->CopyTo(partStream, ul, NULL, NULL); } CoTaskMemFree(static_cast<LPVOID>(fullFileName)); if (fileStream) { fileStream->Release(); fileStream = NULL; } if (partStream) { partStream->Release(); partStream = NULL; } return hr; } /////////////////////////////////////////////////////////////////////////////// // Description: // Displays stream content in the console. /////////////////////////////////////////////////////////////////////////////// HRESULT DisplayStreamContent( LPCWSTR title, // The title to be displayed above the stream contents. IStream *stream // The stream whose contents are displayed. ) { HRESULT hr = S_OK; byte buffer[MAX_BUFFER_SIZE] = {}; ULONG bytesRead = 1; // Display title. wprintf(L"++++++ %s ++++++\n", title); // Read and display data from screen. while (SUCCEEDED(hr) && bytesRead > 0) { // Pass in 'size - 1' so the buffer is always null-terminated // when passed in to the wprintf method. hr = stream->Read(buffer, sizeof(buffer) - 1, &bytesRead); if (SUCCEEDED(hr) && bytesRead > 0) { // Display data. wprintf(L"%S\n", buffer); } } if (SUCCEEDED(hr)) { // Display end deliminator. wprintf(L"++++++ End %s ++++++\n\n", title); } return hr; } /////////////////////////////////////////////////////////////////////////////// // Description: // Reads and serializes part content to a specified file. Also creates the // required directory structure that contains the file. /////////////////////////////////////////////////////////////////////////////// HRESULT WritePartContentToFile( IOpcFactory *opcFactory, LPCWSTR filePath, // Base directory path where the file is created. IOpcPart *opcPart // Part whose content is serialized. ) { HRESULT hr = S_OK; LPWSTR fullFileName = NULL; IStream * fileStream = NULL; IStream * partStream = NULL; IOpcPartUri * opcPartUri = NULL; BSTR partUriString = NULL; // Get the part name of this part. hr = opcPart->GetName(&opcPartUri); if (SUCCEEDED(hr)) { // Get the part name as string. hr = opcPartUri->GetAbsoluteUri(&partUriString); } if (SUCCEEDED(hr)) { // Create the full file name and the directory structure. hr = CreateDirectoryFromPartName(filePath, partUriString, &fullFileName); } if (SUCCEEDED(hr)) { // Create a write-only stream over the file where part content will be // serialized. hr = opcFactory->CreateStreamOnFile( fullFileName, OPC_STREAM_IO_WRITE, NULL, FILE_ATTRIBUTE_NORMAL, &fileStream ); } if (SUCCEEDED(hr)) { // Get the part content stream. hr = opcPart->GetContentStream(&partStream); } if (SUCCEEDED(hr)) { // Copy the part content stream to the file stream. ULARGE_INTEGER const ul = {(UINT) -1, (UINT) -1}; hr = partStream->CopyTo(fileStream, ul, NULL, NULL); } CoTaskMemFree(static_cast<LPVOID>(fullFileName)); if (fileStream) { fileStream->Release(); fileStream = NULL; } if (partStream) { partStream->Release(); partStream = NULL; } if (opcPartUri) { opcPartUri->Release(); opcPartUri = NULL; } SysFreeString(partUriString); return hr; } //</SnippetMusicBundle_cppUtilWholePage>
31.98048
106
0.533264
windows-development
fa01b63f34eaa1a5a9bb079df72b9e2b1555ebe3
2,278
hpp
C++
RubetekIOS-CPP.framework/Versions/A/Headers/libnet/svl/detail/widgets/push_button_impl.hpp
yklishevich/RubetekIOS-CPP-releases
7dfbbb45b8de7dbb6fa995ff5dcbca4ec06c2bdb
[ "MIT" ]
null
null
null
RubetekIOS-CPP.framework/Versions/A/Headers/libnet/svl/detail/widgets/push_button_impl.hpp
yklishevich/RubetekIOS-CPP-releases
7dfbbb45b8de7dbb6fa995ff5dcbca4ec06c2bdb
[ "MIT" ]
null
null
null
RubetekIOS-CPP.framework/Versions/A/Headers/libnet/svl/detail/widgets/push_button_impl.hpp
yklishevich/RubetekIOS-CPP-releases
7dfbbb45b8de7dbb6fa995ff5dcbca4ec06c2bdb
[ "MIT" ]
null
null
null
namespace svl { push_button::push_button() { w32_create_child_window( WS_CLIPCHILDREN, 0 ); pushed_ = false; mkey_down_ = false; auto_ = true; } push_button::push_button(str_ref caption, bool pushed) { w32_create_child_window( WS_CLIPCHILDREN, 0 ); btn_.set_caption( caption ); pushed_ = pushed; mkey_down_ = false; auto_ = true; } push_button::~push_button() { start_destruction(); w32_destroy_window(); } string push_button::caption() const { return btn_.caption(); } void push_button::set_caption(str_ref str) { btn_.set_caption(str); } void push_button::set_auto_mode(bool value) { auto_ = value; } void push_button::click() // thread(any) { event::click ev; send_event( ev ); } void push_button::push_down() { push(true); } void push_button::push_up() { push(false); } void push_button::push(bool down) { pushed_ = down; update(); } bool push_button::pushed() const { return pushed_; } void push_button::pre_handle_event( event::processor& ep ) { control::pre_handle_event( ep ); ep( &push_button::handle_paint ); ep( &push_button::handle_resize ); ep( &push_button::handle_mouse_key_down ); ep( &push_button::handle_mouse_key_up ); } void push_button::handle_paint( event::paint& ) { graphics::canvas canvas(*this); SVL_MS(SendMessage)(btn_.win32_handle(), BM_SETSTATE, pushed_ ? TRUE : FALSE, 0); SVL_MS(SendMessage)(btn_.win32_handle(), WM_PRINT, reinterpret_cast<WPARAM>(canvas.win32_handle()), PRF_CLIENT | PRF_CHILDREN); } void push_button::handle_resize( event::resize& ) { btn_.resize( this->size() ); update(); } void push_button::handle_mouse_key_down( event::mouse_key_down& e) { if (e.left().just_pressed()) { mkey_down_ = true; ::SetCapture(win32_handle()); } } void push_button::handle_mouse_key_up( event::mouse_key_up& e) { if (mkey_down_) { mkey_down_ = false; ::ReleaseCapture(); if (e.left().just_released()) { svl::rect r(point(0,0), this->size()); if (is_inside(e.cursor(), r)) { if (auto_) { pushed_ = !pushed_; update(); } click(); } } } } event::target::connector<event::click> push_button::on_click() { return connection_info(); } }
17.937008
129
0.658911
yklishevich
fa09c636d242dc96a85d8116d84e46fb73b43d71
2,763
cpp
C++
unittest/test_trie.cpp
JeraKrs/ACM
edcd61ec6764b8cd804bf1538dfde53d0ff572b5
[ "Apache-2.0" ]
null
null
null
unittest/test_trie.cpp
JeraKrs/ACM
edcd61ec6764b8cd804bf1538dfde53d0ff572b5
[ "Apache-2.0" ]
null
null
null
unittest/test_trie.cpp
JeraKrs/ACM
edcd61ec6764b8cd804bf1538dfde53d0ff572b5
[ "Apache-2.0" ]
null
null
null
#include <gtest/gtest.h> #include "tree/trie.h" namespace unittest { TEST(test_trie, search) { ::algo::Trie<uint32_t> trie; const char* key1 = "keyword"; const char* key2 = "key"; uint32_t value = 0; // passed-key don't exist. ASSERT_EQ(trie.search(key1, &value), false); // invalid passed-key. ASSERT_EQ(trie.search("_key", &value), false); // normal search. ASSERT_EQ(trie.insert(key1, 1), true); ASSERT_EQ(trie.insert(key2, 2), true); ASSERT_EQ(trie.search(key1, &value), true); ASSERT_EQ(value, 1); ASSERT_EQ(trie.search(key2, &value), true); ASSERT_EQ(value, 2); ASSERT_EQ(trie.size(), 2); } TEST(test_trie, insert) { ::algo::Trie<uint32_t> trie; const char* key = "keyword"; uint32_t value; // normal insertion. ASSERT_EQ(trie.insert(key, 1), true); ASSERT_EQ(trie.search(key, &value), true); ASSERT_EQ(value, 1); ASSERT_EQ(trie.size(), 1); // duplicated insertion. ASSERT_EQ(trie.insert(key, 1), false); ASSERT_EQ(trie.size(), 1); // invalid passed-key. ASSERT_EQ(trie.insert("_key", 1), false); ASSERT_EQ(trie.size(), 1); } TEST(test_trie, remove) { ::algo::Trie<uint32_t> trie; const char* key = "keyword"; uint32_t value; // passed-key don't exist. ASSERT_EQ(trie.remove(key), false); // invalid passed-key. ASSERT_EQ(trie.remove("_key"), false); // normal remove. ASSERT_EQ(trie.insert(key, 1), true); ASSERT_EQ(trie.search(key, &value), true); ASSERT_EQ(value, 1); ASSERT_EQ(trie.size(), 1); ASSERT_EQ(trie.remove(key), true); ASSERT_EQ(trie.size(), 0); ASSERT_EQ(trie.search(key, &value), false); } TEST(test_trie, clear) { ::algo::Trie<uint32_t> trie; const char* key = "keyword"; uint32_t value; ASSERT_EQ(trie.insert(key, 1), true); ASSERT_EQ(trie.search(key, &value), true); ASSERT_EQ(value, 1); ASSERT_EQ(trie.size(), 1); trie.clear(); ASSERT_EQ(trie.search(key, &value), false); } TEST(tes_trie, initialization) { ::algo::Trie<uint32_t> rhs; const char* key = "keyword"; uint32_t value; ASSERT_EQ(rhs.insert(key, 2), true); ASSERT_EQ(rhs.search(key, &value), true); ASSERT_EQ(value, 2); ::algo::Trie<uint32_t> lhs = rhs; ASSERT_EQ(lhs.search(key, &value), false); ASSERT_EQ(lhs.size(), 0); ASSERT_EQ(rhs.search(key, &value), true); ASSERT_EQ(value, 2); } TEST(test_trie, alphabet) { ::algo::Trie<uint32_t> trie; // normal passed-char. ASSERT_EQ(trie.alphabet('a'), 0); ASSERT_EQ(trie.alphabet('z'), 25); ASSERT_EQ(trie.alphabet('A'), 26); ASSERT_EQ(trie.alphabet('Z'), 51); // invalid passed-char. ASSERT_EQ(trie.alphabet('a' - 1), -1); ASSERT_EQ(trie.alphabet('Z' + 1), -1); ASSERT_EQ(trie.alphabet(0), -1); } } // namespace unittest int main (int argc,char *argv[]) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
21.418605
47
0.671734
JeraKrs
fa0a86c42404a684b840e396734bd1da81174381
3,911
cpp
C++
dali/devel-api/threading/conditional-wait.cpp
vcebollada/dali-core
1f880695d4f6cb871db7f946538721e882ba1633
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
dali/devel-api/threading/conditional-wait.cpp
vcebollada/dali-core
1f880695d4f6cb871db7f946538721e882ba1633
[ "Apache-2.0", "BSD-3-Clause" ]
1
2020-03-22T10:19:17.000Z
2020-03-22T10:19:17.000Z
dali/devel-api/threading/conditional-wait.cpp
fayhot/dali-core
a69ea317f30961164520664a645ac36c387055ef
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
/* * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * 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. * */ // CLASS HEADER #include <dali/devel-api/threading/conditional-wait.h> // EXTERNAL INCLUDES #include <mutex> #include <condition_variable> // INTERNAL INCLUDES #include <dali/integration-api/debug.h> #include <dali/internal/common/mutex-trace.h> namespace Dali { /** * Data members for ConditionalWait */ struct ConditionalWait::ConditionalWaitImpl { std::mutex mutex; std::condition_variable condition; volatile unsigned int count; }; /** * Data members for ConditionalWait::ScopedLock */ struct ConditionalWait::ScopedLock::ScopedLockImpl { ScopedLockImpl( ConditionalWait& wait ) : wait( wait ), lock( wait.mImpl->mutex ) // locks for the lifecycle of this object { } ConditionalWait& wait; std::unique_lock<std::mutex> lock; }; ConditionalWait::ScopedLock::ScopedLock( ConditionalWait& wait ) : mImpl( new ConditionalWait::ScopedLock::ScopedLockImpl( wait ) ) { Internal::MutexTrace::Lock(); // matching sequence in mutex.cpp } ConditionalWait::ScopedLock::~ScopedLock() { Internal::MutexTrace::Unlock(); delete mImpl; } ConditionalWait& ConditionalWait::ScopedLock::GetLockedWait() const { return mImpl->wait; // mImpl can never be NULL } ConditionalWait::ConditionalWait() : mImpl( new ConditionalWaitImpl ) { mImpl->count = 0; } ConditionalWait::~ConditionalWait() { delete mImpl; } void ConditionalWait::Notify() { // conditional wait requires a lock to be held ScopedLock lock( *this ); volatile unsigned int previousCount = mImpl->count; mImpl->count = 0; // change state before broadcast as that may wake clients immediately // notify does nothing if the thread is not waiting but still has a system call overhead // notify all threads to continue if( 0 != previousCount ) { mImpl->condition.notify_all(); // no return value } } void ConditionalWait::Notify( const ScopedLock& scope ) { // Scope must be locked: DALI_ASSERT_DEBUG( &scope.GetLockedWait() == this ); volatile unsigned int previousCount = mImpl->count; mImpl->count = 0; // change state before broadcast as that may wake clients immediately // notify does nothing if the thread is not waiting but still has a system call overhead // notify all threads to continue if( 0 != previousCount ) { mImpl->condition.notify_all(); // no return value } } void ConditionalWait::Wait() { // conditional wait requires a lock to be held ScopedLock scope( *this ); ++(mImpl->count); // conditional wait may wake up without anyone calling Notify do { // wait while condition changes mImpl->condition.wait( scope.mImpl->lock ); // need to pass in the std::unique_lock } while( 0 != mImpl->count ); } void ConditionalWait::Wait( const ScopedLock& scope ) { // Scope must be locked: DALI_ASSERT_DEBUG( &scope.GetLockedWait() == this ); ++(mImpl->count); // conditional wait may wake up without anyone calling Notify do { // wait while condition changes mImpl->condition.wait( scope.mImpl->lock ); // need to pass in the std::unique_lock } while( 0 != mImpl->count ); // We return with our mutex locked safe in the knowledge that the ScopedLock // passed in will unlock it in the caller. } unsigned int ConditionalWait::GetWaitCount() const { return mImpl->count; } } // namespace Dali
26.073333
90
0.716952
vcebollada
fa0dc5ef982c816ec28bbb8f2a26669c8e704f5e
1,039
cpp
C++
COJ.UCI.CU/Cow multiplication (1188).cpp
Trx21-5672/IMEC-8A-5672
ff4f0f4bcd61425a9eccba7be1fb646849360d45
[ "MIT" ]
null
null
null
COJ.UCI.CU/Cow multiplication (1188).cpp
Trx21-5672/IMEC-8A-5672
ff4f0f4bcd61425a9eccba7be1fb646849360d45
[ "MIT" ]
1
2020-04-05T03:13:08.000Z
2020-04-05T03:13:08.000Z
COJ.UCI.CU/Cow multiplication (1188).cpp
Trx21-5672/IMEC-8A-5672
ff4f0f4bcd61425a9eccba7be1fb646849360d45
[ "MIT" ]
null
null
null
#include <iostream> #include <cstring> using namespace std; char cow1[10]; char cow2[10]; long cow3[10]; long cow4[10]; long res=0; void getcow1() { for(int i=0;i<sizeof(cow1);i++) { if ((cow1[i]-48)>0) cow3[i]=(cow1[i]-48); else cow3[i]=0; } } void getcow2() { for(int i=0;i<sizeof(cow2);i++) { if ((cow2[i]-48)>0) cow4[i]=(cow2[i]-48); else cow4[i]=0; } } void getres() { res=0; for(int i=0;i<9;i++) { if (cow3[i]>0) res=res+((cow3[i]*cow4[0])+ (cow3[i]*cow4[1])+ (cow3[i]*cow4[2])+ (cow3[i]*cow4[3])+ (cow3[i]*cow4[4])+ (cow3[i]*cow4[5])+ (cow3[i]*cow4[6])+ (cow3[i]*cow4[7])+ (cow3[i]*cow4[8])+ (cow3[i]*cow4[9])); } } int main() { cin>>cow1; cin>>cow2; getcow1(); getcow2(); getres(); cout<<res<<endl; }
14.842857
39
0.395573
Trx21-5672
fa15d84c1a9d8e17e1123fce058135c987beb917
547
cpp
C++
src/levels/level.cpp
TomSavas/ScrewGeometry
396a6302220de2fcd7f9a947b5c5a508c28ded69
[ "MIT" ]
null
null
null
src/levels/level.cpp
TomSavas/ScrewGeometry
396a6302220de2fcd7f9a947b5c5a508c28ded69
[ "MIT" ]
null
null
null
src/levels/level.cpp
TomSavas/ScrewGeometry
396a6302220de2fcd7f9a947b5c5a508c28ded69
[ "MIT" ]
null
null
null
#include "levels/level.h" Level::~Level() { } void Level::Load() { } std::vector<Portal*> &Level::Portals() { return portals; } const std::unordered_map<std::string, DrawableGameObject*> &Level::Objects() const { return objects; } DrawableGameObject *Level::Object(std::string objectName) { if (objects.find(objectName) == objects.end()) return nullptr; return objects.find(objectName)->second; } /* static */ Level &Level::DefaultEmptyLevel() { static Level defaultEmptyLevel; return defaultEmptyLevel; }
15.628571
82
0.678245
TomSavas
fa16a56aee55082b516f8321ff59768d6622ac02
6,866
cpp
C++
test/test_astrolabe_header_file_parser/src/main.cpp
jose-navarro/ASTROLABE
95482bf4ecd7c22e0bcef18aeae0d8b828b3327c
[ "MIT" ]
null
null
null
test/test_astrolabe_header_file_parser/src/main.cpp
jose-navarro/ASTROLABE
95482bf4ecd7c22e0bcef18aeae0d8b828b3327c
[ "MIT" ]
3
2019-05-28T05:34:50.000Z
2019-12-09T12:58:22.000Z
test/test_astrolabe_header_file_parser/src/main.cpp
jose-navarro/astrolabe
95482bf4ecd7c22e0bcef18aeae0d8b828b3327c
[ "MIT" ]
null
null
null
#include "gp_astrolabe_header_file_data.hpp" #include "gp_astrolabe_header_file_parser.hpp" #include <iostream> using namespace std; int main (int argC, char* argV[]) { { // The parser for astrolabe header files. gp_astrolabe_header_file_parser astrolabe_header_parser; // // The data object that will hold the values parsed from the // input file. // gp_astrolabe_header_file_data astrolabe_header_data; // Input astrolabe header and XML schema file names. string astrolabe_header_file; string xml_schema; // // Auxiliary pointers / objects used to retrieve the metadata // once loaded. // int iaux1; int iaux2; lineage_data* lineage; string saux; string saux2; // Error and warning handling variables. int error_total; int error_index; string error_message; int warning_total; int warning_index; string warning_message; // Auxiliar variables used in loops. int j; int list_dim; // // Test the number of parameters. We must receive an input // astrolabe header file! argV[0] is the name of the program and // argV[1] is the name of the astrolabe header input file. We may // also receive the name of a validating XML schema in argV[2]; // if (argC < 2) { cout << "Usage: test_astrolabe_header_file_parser astrolabe_header_file [schema_file]" << endl; return 1; } // // Depending on the number of parameters, we'll have just an observations file // or, additionally, an schema to validate the syntax of the former. // // Set up the parser depending on that. // astrolabe_header_file = argV[1]; if (argC == 2) { // Developer's setup (NO schema to help validating the input file) astrolabe_header_parser.set_parser_parameters_developer(astrolabe_header_file, &astrolabe_header_data); } else { // Production set up, with a schema included. xml_schema = argV[2]; astrolabe_header_parser.set_parser_parameters(astrolabe_header_file, xml_schema, &astrolabe_header_data); } // Parse the input file. astrolabe_header_parser.parse(); // Check if the parsing process produced warnings or errors. error_total = astrolabe_header_parser.errors_dim(); if (error_total > 0) { cout << "Parsing finished with errors!" << endl << endl; for (error_index = 0; error_index < error_total; error_index++) { error_message = astrolabe_header_parser.errors_get(error_index); cout << error_message << endl; } } else { cout << "Parsing finished with no errors!" << endl; } warning_total = astrolabe_header_parser.warnings_dim(); if (warning_total > 0) { cout << "Parsing finished with warnings!" << endl << endl; for (warning_index = 0; warning_index < warning_total; warning_index++) { warning_message = astrolabe_header_parser.warnings_get(warning_index); cout << warning_message << endl; } } else { cout << "Parsing finished with no warnings!" << endl; } // // If errors have been detected, stop the process here. // // Otherwise, dump the data to screen. This will show how to // access the information stored in the gp_astrolabe_header_file_data // object. // if (error_total > 0) return 0; cout << "astrolabe-header_file" << endl; // Dump the lineage lineage = astrolabe_header_data.get_lineage_ptr(); cout << " lineage" << endl; saux = lineage->id_get(); cout << " id: " << saux << endl; saux = lineage->name_get(); if (!saux.empty()) cout << " name: " << saux << endl; list_dim = lineage->author_item_dim(); if (list_dim > 0) { cout << " author" << endl; for (j = 0; j < list_dim; j++) { saux = lineage->author_item_get(j); cout << " item: " << saux << endl; } } saux = lineage->organization_get(); if (!saux.empty()) cout << " organization: " << saux << endl; saux = lineage->department_get(); if (!saux.empty()) cout << " department: " << saux << endl; saux = lineage->date_time_get(); if (!saux.empty()) cout << " date_time: " << saux << endl; list_dim = lineage->ref_document_item_dim(); if (list_dim > 0) { cout << " ref_document" << endl; for (j = 0; j < list_dim; j++) { saux = lineage->ref_document_item_get(j); cout << " item: " << saux << endl; } } saux = lineage->project_get(); if (!saux.empty()) cout << " project: " << saux << endl; saux = lineage->task_get(); if (!saux.empty()) cout << " task: " << saux << endl; saux = lineage->remarks_get(); if (!saux.empty()) cout << " remarks: " << saux << endl; // // Dump the astrolabe_header_file_data object. // cout << " data" << endl; cout << " device" << endl; // Get the type of data being stored or managed. saux = astrolabe_header_data.get_device_type(); cout << " type: " << saux << endl; // Get the format used to store / handle data (text or binary files, client or server sockets). iaux1 = astrolabe_header_data.get_device_format(); if (iaux1 == gp_astrolabe_header_file_data::GP_ASTROLABE_HEADER_FORMAT_IS_BINARY_FILE) { // We've got a binary file. saux = astrolabe_header_data.get_device_file_name(); cout << " format: binary file" << endl; cout << " file name: " << saux << endl; } else if (iaux1 == gp_astrolabe_header_file_data::GP_ASTROLABE_HEADER_FORMAT_IS_TEXT_FILE) { // Data is stored in a text file. saux = astrolabe_header_data.get_device_file_name(); cout << " format: text file" << endl; cout << " file name: " << saux << endl; } else { // // We've got a socket port here. And we might have a host too. // // iaux2 = astrolabe_header_data.get_device_port(); cout << " format: socket" << endl; cout << " port: " << iaux2 << endl; if (astrolabe_header_data.is_set_device_server()) { saux = astrolabe_header_data.get_device_server(); cout << " host: " << saux << endl; } } cout << "Process finished" << endl; } return 0; }
27.246032
111
0.56991
jose-navarro
fa16f1f7207253d78ec7daf3777889c46a98bc3e
4,677
cpp
C++
src/optimisationProblem/kinematicallyRedundantMachines/parallelKinematicMachine3PRPR.cpp
OpusV/AstroMechanics
3fe7a5462fce575c465be372d1c69bf788784297
[ "MIT" ]
1
2019-11-08T22:06:56.000Z
2019-11-08T22:06:56.000Z
src/optimisationProblem/kinematicallyRedundantMachines/parallelKinematicMachine3PRPR.cpp
OpusV/AstroMechanics
3fe7a5462fce575c465be372d1c69bf788784297
[ "MIT" ]
null
null
null
src/optimisationProblem/kinematicallyRedundantMachines/parallelKinematicMachine3PRPR.cpp
OpusV/AstroMechanics
3fe7a5462fce575c465be372d1c69bf788784297
[ "MIT" ]
null
null
null
#include "mantella_bits/optimisationProblem/kinematicallyRedundantMachines/parallelKinematicMachine3PRPR.hpp" // C++ standard library #include <algorithm> #include <cassert> #include <functional> #include <limits> #include <string> #include <utility> // Mantella #include "mantella_bits/geometry.hpp" // The following robot configurations and calculations are based on the work of our research colleagues from the Institute of Mechatronic Systems, Leibniz Universität Hannover, Germany. // To understand the following equations, we advise to carefully read the following paper: // @see J. Kotlarski et al. (2012). Influence of kinematic redundancy on the singularity-free workspace of parallel kinematic machines. Frontiers of Mechanical Engineering, 7(2), pp. 120-134. namespace mant { namespace krm { ParallelKinematicMachine3PRPR::ParallelKinematicMachine3PRPR() : KinematicallyRedundantMachines(3, 3), redundantJointsPosition_( {{0.6, 0.0, 1.2}, {1.039230484541327, 0.0, 0.0}}), redundantJointsAngles_( {{0.0, -1.0, -1.0}, {1.0, 0.0, 0.0}}), middleJointsMinimalLength_( {0.1, 0.1, 0.1}), middleJointsMaximalLength_( {1.2, 1.2, 1.2}), endEffectorJointsRelativePosition_( {{-0.000066580445834, -0.092751709777083, 0.092818290222917}, {0.106954081945581, -0.053477040972790, -0.053477040972790}}) { setLowerBounds({-0.5, -0.2, -0.2}); setUpperBounds({0.5, 0.8, 0.8}); setObjectiveFunctions( {{[this]( const arma::vec& redundantJointsActuation_) { assert(redundantJointsActuation_.n_elem == numberOfDimensions_); double poseInaccuracy = 0.0; for (arma::uword n = 0; n < endEffectorTrajectory_.n_cols; ++n) { const arma::vec::fixed<3>& endEffectorPose = endEffectorTrajectory_.col(n); const arma::vec::fixed<2>& endEffectorPosition = endEffectorPose.head(2); const double endEffectorAngle = endEffectorPose(2); arma::mat::fixed<2, 3> baseJointsPosition = redundantJointsPosition_; for (arma::uword k = 0; k < redundantJointsActuation_.n_elem; ++k) { baseJointsPosition.col(k) += redundantJointsActuation_(k) * redundantJointsAngles_.col(k); } arma::mat::fixed<2, 3> endEffectorJointsPosition = rotationMatrix2d(endEffectorAngle) * endEffectorJointsRelativePosition_; endEffectorJointsPosition.each_col() += endEffectorPosition; const arma::rowvec::fixed<3>& middleJointsLength = arma::sqrt(arma::sum(arma::square(endEffectorJointsPosition - baseJointsPosition))); if (arma::any(middleJointsMinimalLength_ > middleJointsLength || middleJointsLength > middleJointsMaximalLength_)) { return std::numeric_limits<decltype(poseInaccuracy)>::infinity(); } const arma::mat::fixed<2, 3>& baseToEndEffectorJointsPosition = endEffectorJointsPosition - baseJointsPosition; const arma::mat::fixed<2, 3>& endEffectorJointsRotatedPosition = endEffectorJointsPosition.each_col() - endEffectorPosition; arma::mat::fixed<3, 3> forwardKinematic; forwardKinematic.head_rows(2) = baseToEndEffectorJointsPosition; forwardKinematic.row(2) = -forwardKinematic.row(0) % endEffectorJointsRotatedPosition.row(1) + forwardKinematic.row(1) % endEffectorJointsRotatedPosition.row(0); arma::mat::fixed<3, 6> inverseKinematic(arma::fill::zeros); inverseKinematic.diag() = -arma::sqrt(arma::sum(arma::square(baseToEndEffectorJointsPosition))); for (arma::uword k = 0; k < redundantJointsActuation_.n_elem; ++k) { inverseKinematic(k, 3 + k) = arma::dot(baseToEndEffectorJointsPosition.col(k), redundantJointsAngles_.col(k)); } arma::mat solution; if (!arma::solve(solution, forwardKinematic.t(), inverseKinematic)) { return std::numeric_limits<decltype(poseInaccuracy)>::infinity(); } else { try { poseInaccuracy = std::max(poseInaccuracy, arma::cond(solution)); } catch (...) { return std::numeric_limits<decltype(poseInaccuracy)>::infinity(); } } } return poseInaccuracy; }, "KRM Parallel Kinematic Machine 3PRPR"}}); } } }
50.836957
191
0.629036
OpusV
fa1f8aa4bd0edf939b2b0074a9f287aaf3ab0ce1
11,871
cpp
C++
Plugins/PLRendererOpenGLES2/src/ExtensionsRuntimeLinking.cpp
ktotheoz/pixellight
43a661e762034054b47766d7e38d94baf22d2038
[ "MIT" ]
83
2015-01-08T15:06:14.000Z
2021-07-20T17:07:00.000Z
Plugins/PLRendererOpenGLES2/src/ExtensionsRuntimeLinking.cpp
PixelLightFoundation/pixellight
43a661e762034054b47766d7e38d94baf22d2038
[ "MIT" ]
27
2019-06-18T06:46:07.000Z
2020-02-02T11:11:28.000Z
Plugins/PLRendererOpenGLES2/src/ExtensionsRuntimeLinking.cpp
naetherm/PixelLight
d7666f5b49020334cbb5debbee11030f34cced56
[ "MIT" ]
40
2015-02-25T18:24:34.000Z
2021-03-06T09:01:48.000Z
/*********************************************************\ * File: ExtensionsRuntimeLinking.cpp * * * Copyright (C) 2002-2013 The PixelLight Team (http://www.pixellight.org/) * * This file is part of PixelLight. * * 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. \*********************************************************/ //[-------------------------------------------------------] //[ Includes ] //[-------------------------------------------------------] #include <PLCore/Log/Log.h> #define EXTENSIONS_DEFINERUNTIMELINKING #include "PLRendererOpenGLES2/Context.h" #include "PLRendererOpenGLES2/ExtensionsRuntimeLinking.h" //[-------------------------------------------------------] //[ Namespace ] //[-------------------------------------------------------] using namespace PLCore; namespace PLRendererOpenGLES2 { //[-------------------------------------------------------] //[ Public methods ] //[-------------------------------------------------------] /** * @brief * Constructor */ ExtensionsRuntimeLinking::ExtensionsRuntimeLinking() : // ARB m_bGL_ARB_draw_buffers(false), // EXT m_bGL_EXT_texture_compression_s3tc(false), m_bGL_EXT_texture_compression_dxt1(false), m_bGL_EXT_texture_compression_latc(false), m_bGL_EXT_texture_filter_anisotropic(false), m_bGL_EXT_texture_array(false), m_bGL_EXT_Cg_shader(false), // AMD m_bGL_AMD_compressed_3DC_texture(false), // NV m_bGL_NV_get_tex_image(false), m_bGL_NV_fbo_color_attachments(false), m_bGL_NV_read_buffer(false), // OES m_bGL_OES_mapbuffer(false), m_bGL_OES_element_index_uint(false), m_bGL_OES_texture_3D(false), m_bGL_OES_packed_depth_stencil(false), m_bGL_OES_depth24(false), m_bGL_OES_depth32(false), m_bGL_OES_vertex_half_float(false), // ANGLE m_bGL_ANGLE_framebuffer_blit(false), m_bGL_ANGLE_framebuffer_multisample(false) { } /** * @brief * Destructor */ ExtensionsRuntimeLinking::~ExtensionsRuntimeLinking() { } /** * @brief * Initialize the supported extensions */ void ExtensionsRuntimeLinking::Init() { // Define a helper macro #define IMPORT_FUNC(funcName) \ if (bResult) { \ void *pSymbol = eglGetProcAddress(#funcName); \ if (pSymbol) { \ *(reinterpret_cast<void**>(&(funcName))) = pSymbol; \ } else { \ PL_LOG(Error, String("Failed to find the entry point \"") + #funcName + "\" within the OpenGL ES 2.0 dynamic library") \ bResult = false; \ } \ } // Get the extensions string const String sExtensions = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)); //[-------------------------------------------------------] //[ ARB ] //[-------------------------------------------------------] m_bGL_ARB_draw_buffers = sExtensions.IsSubstring("GL_ARB_draw_buffers"); if (m_bGL_ARB_draw_buffers) { // Load the entry points bool bResult = true; // Success by default IMPORT_FUNC(glDrawBuffersARB) m_bGL_ARB_draw_buffers = bResult; } //[-------------------------------------------------------] //[ EXT ] //[-------------------------------------------------------] m_bGL_EXT_texture_compression_s3tc = sExtensions.IsSubstring("GL_EXT_texture_compression_s3tc"); m_bGL_EXT_texture_compression_dxt1 = sExtensions.IsSubstring("GL_EXT_texture_compression_dxt1"); m_bGL_EXT_texture_compression_latc = sExtensions.IsSubstring("GL_EXT_texture_compression_latc"); m_bGL_EXT_texture_filter_anisotropic = sExtensions.IsSubstring("GL_EXT_texture_filter_anisotropic"); m_bGL_EXT_texture_array = sExtensions.IsSubstring("GL_EXT_texture_array"); if (m_bGL_EXT_texture_array) { // A funny thing: Tegra 2 has support for the extension "GL_EXT_texture_array", but has no support // for the "GL_OES_texture_3D"-extension. At least it's not listed in the extension string. // "GL_EXT_texture_array" is reusing functions defined by "GL_OES_texture_3D"... and therefore we're // now getting the function pointers of "GL_OES_texture_3D" to be able to use "GL_EXT_texture_array". // Works even when "GL_OES_texture_3D" is not listed. Nice. // Load the entry points bool bResult = true; // Success by default IMPORT_FUNC(glTexImage3DOES) IMPORT_FUNC(glTexSubImage3DOES) IMPORT_FUNC(glCopyTexSubImage3DOES) IMPORT_FUNC(glCompressedTexImage3DOES) IMPORT_FUNC(glCompressedTexSubImage3DOES) IMPORT_FUNC(glFramebufferTexture3DOES) m_bGL_EXT_texture_array = bResult; } m_bGL_EXT_Cg_shader = sExtensions.IsSubstring("GL_EXT_Cg_shader"); //[-------------------------------------------------------] //[ AMD ] //[-------------------------------------------------------] m_bGL_AMD_compressed_3DC_texture = sExtensions.IsSubstring("GL_AMD_compressed_3DC_texture"); //[-------------------------------------------------------] //[ NV ] //[-------------------------------------------------------] m_bGL_NV_get_tex_image = sExtensions.IsSubstring("GL_NV_get_tex_image"); if (m_bGL_NV_get_tex_image) { // Load the entry points bool bResult = true; // Success by default IMPORT_FUNC(glGetTexImageNV) IMPORT_FUNC(glGetCompressedTexImageNV) IMPORT_FUNC(glGetTexLevelParameterfvNV) IMPORT_FUNC(glGetTexLevelParameterivNV) m_bGL_NV_get_tex_image = bResult; } m_bGL_NV_fbo_color_attachments = sExtensions.IsSubstring("GL_NV_fbo_color_attachments"); m_bGL_NV_read_buffer = sExtensions.IsSubstring("GL_NV_read_buffer"); if (m_bGL_NV_read_buffer) { // Load the entry points bool bResult = true; // Success by default IMPORT_FUNC(glReadBufferNV) m_bGL_NV_read_buffer = bResult; } //[-------------------------------------------------------] //[ OES ] //[-------------------------------------------------------] m_bGL_OES_mapbuffer = sExtensions.IsSubstring("GL_OES_mapbuffer"); if (m_bGL_OES_mapbuffer) { // Load the entry points bool bResult = true; // Success by default IMPORT_FUNC(glGetBufferPointervOES) IMPORT_FUNC(glMapBufferOES) IMPORT_FUNC(glUnmapBufferOES) m_bGL_OES_mapbuffer = bResult; } m_bGL_OES_element_index_uint = sExtensions.IsSubstring("GL_OES_element_index_uint"); m_bGL_OES_texture_3D = sExtensions.IsSubstring("GL_OES_texture_3D"); if (m_bGL_OES_texture_3D && !m_bGL_EXT_texture_array) { // See "GL_EXT_texture_array"-comment above // Load the entry points bool bResult = true; // Success by default IMPORT_FUNC(glTexImage3DOES) IMPORT_FUNC(glTexSubImage3DOES) IMPORT_FUNC(glCopyTexSubImage3DOES) IMPORT_FUNC(glCompressedTexImage3DOES) IMPORT_FUNC(glCompressedTexSubImage3DOES) IMPORT_FUNC(glFramebufferTexture3DOES) m_bGL_OES_texture_3D = bResult; } m_bGL_OES_packed_depth_stencil = sExtensions.IsSubstring("GL_OES_packed_depth_stencil"); m_bGL_OES_depth24 = sExtensions.IsSubstring("GL_OES_depth24"); m_bGL_OES_depth32 = sExtensions.IsSubstring("GL_OES_depth32"); m_bGL_OES_vertex_half_float = sExtensions.IsSubstring("GL_OES_vertex_half_float"); //[-------------------------------------------------------] //[ ANGLE ] //[-------------------------------------------------------] m_bGL_ANGLE_framebuffer_blit = sExtensions.IsSubstring("GL_ANGLE_framebuffer_blit"); if (m_bGL_ANGLE_framebuffer_blit) { // Load the entry points bool bResult = true; // Success by default IMPORT_FUNC(glBlitFramebufferEXT) m_bGL_ANGLE_framebuffer_blit = bResult; } m_bGL_ANGLE_framebuffer_multisample = sExtensions.IsSubstring("GL_ANGLE_framebuffer_multisample"); if (m_bGL_ANGLE_framebuffer_multisample) { // Load the entry points bool bResult = true; // Success by default IMPORT_FUNC(glRenderbufferStorageMultisampleANGLE) m_bGL_ANGLE_framebuffer_multisample = bResult; } // Undefine the helper macro #undef IMPORT_FUNC } //[-------------------------------------------------------] //[ Public virtual Extensions functions ] //[-------------------------------------------------------] // ARB bool ExtensionsRuntimeLinking::IsGL_ARB_draw_buffers() const { return m_bGL_ARB_draw_buffers; } // EXT bool ExtensionsRuntimeLinking::IsGL_EXT_texture_compression_s3tc() const { return m_bGL_EXT_texture_compression_s3tc; } bool ExtensionsRuntimeLinking::IsGL_EXT_texture_compression_dxt1() const { return m_bGL_EXT_texture_compression_dxt1; } bool ExtensionsRuntimeLinking::IsGL_EXT_texture_compression_latc() const { return m_bGL_EXT_texture_compression_latc; } bool ExtensionsRuntimeLinking::IsGL_EXT_texture_filter_anisotropic() const { return m_bGL_EXT_texture_filter_anisotropic; } bool ExtensionsRuntimeLinking::IsGL_EXT_texture_array() const { return m_bGL_EXT_texture_array; } bool ExtensionsRuntimeLinking::IsGL_EXT_Cg_shader() const { return m_bGL_EXT_Cg_shader; } // AMD bool ExtensionsRuntimeLinking::IsGL_AMD_compressed_3DC_texture() const { return m_bGL_AMD_compressed_3DC_texture; } // NV bool ExtensionsRuntimeLinking::IsGL_NV_get_tex_image() const { return m_bGL_NV_get_tex_image; } bool ExtensionsRuntimeLinking::IsGL_NV_fbo_color_attachments() const { return m_bGL_NV_fbo_color_attachments; } bool ExtensionsRuntimeLinking::IsGL_NV_read_buffer() const { return m_bGL_NV_read_buffer; } // OES bool ExtensionsRuntimeLinking::IsGL_OES_mapbuffer() const { return m_bGL_OES_mapbuffer; } bool ExtensionsRuntimeLinking::IsGL_OES_element_index_uint() const { return m_bGL_OES_element_index_uint; } bool ExtensionsRuntimeLinking::IsGL_OES_texture_3D() const { return m_bGL_OES_texture_3D; } bool ExtensionsRuntimeLinking::IsGL_OES_packed_depth_stencil() const { return m_bGL_OES_packed_depth_stencil; } bool ExtensionsRuntimeLinking::IsGL_OES_depth24() const { return m_bGL_OES_depth24; } bool ExtensionsRuntimeLinking::IsGL_OES_depth32() const { return m_bGL_OES_depth32; } bool ExtensionsRuntimeLinking::IsGL_OES_vertex_half_float() const { return m_bGL_OES_vertex_half_float; } // ANGLE bool ExtensionsRuntimeLinking::IsGL_ANGLE_framebuffer_blit() const { return m_bGL_ANGLE_framebuffer_blit; } bool ExtensionsRuntimeLinking::IsGL_ANGLE_framebuffer_multisample() const { return m_bGL_ANGLE_framebuffer_multisample; } //[-------------------------------------------------------] //[ Namespace ] //[-------------------------------------------------------] } // PLRendererOpenGLES2
35.017699
124
0.64965
ktotheoz
fa246e65a21506ae539569a4b30e13244e7faffa
272,038
hpp
C++
missions/po4.tanoa/MPSF/maps/takistan.hpp
ademirt/Arma3
f75c28f59deb45e56d021d9d1d3458b145432bd8
[ "MIT" ]
null
null
null
missions/po4.tanoa/MPSF/maps/takistan.hpp
ademirt/Arma3
f75c28f59deb45e56d021d9d1d3458b145432bd8
[ "MIT" ]
null
null
null
missions/po4.tanoa/MPSF/maps/takistan.hpp
ademirt/Arma3
f75c28f59deb45e56d021d9d1d3458b145432bd8
[ "MIT" ]
null
null
null
/* CfgMissionData Generator Contributor: Eightysix World: Takistan */ class Takistan { class Sectors { radius = 1000; class sector_05000500 { position[] = {500,500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Air","Hill","Trees"}; areas[] = {"Air_2","Hill_154","Trees_318","Trees_319","Trees_320","Trees_321","Trees_322","Trees_323"}; }; class sector_15000500 { position[] = {1500,500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees","Village"}; areas[] = {"Clearing_24","Trees_529","Trees_530","Trees_531","Trees_532","Village_1020"}; roads[] = {"RoadSegment_0"}; }; class sector_25000500 { position[] = {2500,500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees","Village"}; areas[] = {"Clearing_27","Clearing_28","Clearing_29","Trees_574","Trees_575","Village_983"}; roads[] = {"RoadSegment_1","RoadSegment_2","RoadSegment_3","RoadSegment_4"}; }; class sector_35000500 { position[] = {3500,500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","House","Trees"}; areas[] = {"Clearing_36","Clearing_37","House_211","Trees_618","Trees_619","Trees_620"}; roads[] = {"RoadSegment_5","RoadSegment_6","RoadSegment_7"}; }; class sector_45000500 { position[] = {4500,500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Town","Trees","Village"}; areas[] = {"Clearing_47","Clearing_48","Town_312","Town_314","Trees_661","Trees_662","Trees_663","Village_982"}; roads[] = {"RoadSegment_8","RoadSegment_9","RoadSegment_10","RoadSegment_11","RoadSegment_12"}; }; class sector_55000500 { position[] = {5500,500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","House","Trees"}; areas[] = {"Clearing_52","House_201","Trees_704","Trees_705","Trees_706","Trees_707"}; roads[] = {"RoadSegment_13","RoadSegment_14","RoadSegment_15","RoadSegment_16"}; }; class sector_65000500 { position[] = {6500,500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Air","Trees"}; areas[] = {"Air_3","Trees_744","Trees_745","Trees_746","Trees_747"}; }; class sector_75000500 { position[] = {7500,500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees","Village"}; areas[] = {"Trees_791","Trees_792","Trees_793","Trees_794","Village_940"}; roads[] = {"RoadSegment_17","RoadSegment_18","RoadSegment_19"}; }; class sector_85000500 { position[] = {8500,500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_840","Trees_841","Trees_842","Trees_843"}; }; class sector_95000500 { position[] = {9500,500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_883","Trees_884","Trees_885","Trees_886"}; }; class sector_105000500 { position[] = {10500,500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_12","Clearing_13","Trees_375","Trees_376","Trees_377"}; }; class sector_115000500 { position[] = {11500,500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_425","Trees_426","Trees_427","Trees_428"}; }; class sector_125000500 { position[] = {12500,500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Air","Clearing","Trees"}; areas[] = {"Air_0","Clearing_17","Trees_484","Trees_485","Trees_486","Trees_487"}; }; class sector_05001500 { position[] = {500,1500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_336","Trees_337","Trees_338","Trees_339"}; }; class sector_15001500 { position[] = {1500,1500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Trees"}; areas[] = {"House_241","Trees_540","Trees_541","Trees_542","Trees_543","Trees_544"}; }; class sector_25001500 { position[] = {2500,1500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_34","Trees_581","Trees_582","Trees_583","Trees_584"}; }; class sector_35001500 { position[] = {3500,1500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees","Village"}; areas[] = {"Trees_628","Trees_629","Trees_630","Trees_631","Village_1006"}; roads[] = {"RoadSegment_20","RoadSegment_21"}; }; class sector_45001500 { position[] = {4500,1500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_673","Trees_674","Trees_675","Trees_676"}; roads[] = {"RoadSegment_22","RoadSegment_23","RoadSegment_24"}; }; class sector_55001500 { position[] = {5500,1500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees","Village"}; areas[] = {"Trees_715","Trees_716","Trees_717","Village_933","Village_1055"}; roads[] = {"RoadSegment_25","RoadSegment_26"}; }; class sector_65001500 { position[] = {6500,1500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees","Village"}; areas[] = {"Trees_757","Trees_758","Trees_759","Trees_760","Village_947","Village_1045"}; roads[] = {"RoadSegment_27","RoadSegment_28","RoadSegment_29","RoadSegment_30","RoadSegment_31","RoadSegment_32","RoadSegment_33","RoadSegment_34","RoadSegment_35"}; }; class sector_75001500 { position[] = {7500,1500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Trees","Village"}; areas[] = {"House_174","House_177","House_178","House_184","House_188","House_239","Trees_807","Trees_808","Trees_809","Village_952","Village_1042"}; roads[] = {"RoadSegment_36","RoadSegment_37","RoadSegment_38","RoadSegment_39","RoadSegment_40","RoadSegment_41"}; }; class sector_85001500 { position[] = {8500,1500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Military","Trees","Village"}; areas[] = {"Military_264","Trees_853","Trees_854","Trees_855","Village_950","Village_968","Village_1048"}; roads[] = {"RoadSegment_42","RoadSegment_43","RoadSegment_44","RoadSegment_45","RoadSegment_46","RoadSegment_47"}; }; class sector_95001500 { position[] = {9500,1500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees","Village"}; areas[] = {"Trees_898","Trees_899","Trees_900","Trees_901","Trees_902","Village_931"}; roads[] = {"RoadSegment_48","RoadSegment_49"}; }; class sector_105001500 { position[] = {10500,1500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","House","Trees"}; areas[] = {"Forest_81","Forest_82","House_222","House_238","Trees_388","Trees_389","Trees_390","Trees_391"}; }; class sector_115001500 { position[] = {11500,1500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_443","Trees_444","Trees_445","Trees_446","Trees_447"}; }; class sector_125001500 { position[] = {12500,1500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_496","Trees_497","Trees_498","Trees_499"}; }; class sector_05002500 { position[] = {500,2500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Hill","Industrial","Town","Trees","Village"}; areas[] = {"Hill_153","Industrial_248","Town_311","Trees_340","Trees_341","Trees_342","Trees_343","Trees_344","Village_1035"}; roads[] = {"RoadSegment_50","RoadSegment_51","RoadSegment_52"}; }; class sector_15002500 { position[] = {1500,2500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Hill","Trees"}; areas[] = {"Hill_151","Trees_545","Trees_546","Trees_547","Trees_548"}; }; class sector_25002500 { position[] = {2500,2500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_35","Trees_585","Trees_586","Trees_587","Trees_588"}; }; class sector_35002500 { position[] = {3500,2500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Hill","Trees"}; areas[] = {"Hill_166","Trees_632","Trees_633","Trees_634","Trees_635","Trees_636"}; }; class sector_45002500 { position[] = {4500,2500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Hill","Trees"}; areas[] = {"Forest_123","Hill_155","Trees_677","Trees_678","Trees_679"}; roads[] = {"RoadSegment_53","RoadSegment_54","RoadSegment_55","RoadSegment_56","RoadSegment_57"}; }; class sector_55002500 { position[] = {5500,2500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_133","Trees_718","Trees_719","Trees_720","Trees_721"}; }; class sector_65002500 { position[] = {6500,2500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","House","Trees","Village"}; areas[] = {"Forest_138","House_175","Trees_761","Trees_762","Trees_763","Trees_764","Trees_765","Village_1043"}; roads[] = {"RoadSegment_58"}; }; class sector_75002500 { position[] = {7500,2500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Trees","Village"}; areas[] = {"House_244","Trees_810","Trees_811","Trees_812","Trees_813","Village_979"}; roads[] = {"RoadSegment_59","RoadSegment_60","RoadSegment_61","RoadSegment_62","RoadSegment_63","RoadSegment_64","RoadSegment_65"}; }; class sector_85002500 { position[] = {8500,2500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Industrial","Military","Religious","Town","Trees","Village"}; areas[] = {"House_169","House_181","House_189","Industrial_252","Military_269","Religious_278","Town_296","Town_302","Trees_856","Trees_857","Trees_858","Trees_859","Village_949","Village_956","Village_966","Village_984"}; roads[] = {"RoadSegment_66","RoadSegment_67","RoadSegment_68","RoadSegment_69","RoadSegment_70","RoadSegment_71","RoadSegment_72","RoadSegment_73","RoadSegment_74"}; }; class sector_95002500 { position[] = {9500,2500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_144","Trees_903","Trees_904"}; roads[] = {"RoadSegment_75","RoadSegment_76","RoadSegment_77","RoadSegment_78","RoadSegment_79","RoadSegment_80","RoadSegment_81"}; }; class sector_105002500 { position[] = {10500,2500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Industrial","Religious","Town","Trees","Village"}; areas[] = {"House_231","Industrial_247","Religious_285","Town_315","Trees_392","Trees_393","Trees_394","Trees_395","Village_1049"}; roads[] = {"RoadSegment_82","RoadSegment_83","RoadSegment_84","RoadSegment_85"}; }; class sector_115002500 { position[] = {11500,2500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","House","Trees","Village"}; areas[] = {"Forest_86","House_207","Trees_448","Trees_449","Trees_450","Trees_451","Village_1003","Village_1028"}; roads[] = {"RoadSegment_86","RoadSegment_87","RoadSegment_88","RoadSegment_89"}; }; class sector_125002500 { position[] = {12500,2500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Forest","Trees"}; areas[] = {"Clearing_22","Forest_91","Trees_500","Trees_501"}; }; class sector_05003500 { position[] = {500,3500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Trees","Village"}; areas[] = {"House_220","House_221","Trees_345","Trees_346","Trees_347","Trees_348","Village_1038"}; roads[] = {"RoadSegment_90"}; }; class sector_15003500 { position[] = {1500,3500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Industrial","Religious","Town","Trees","Village"}; areas[] = {"Forest_100","Industrial_256","Religious_273","Religious_279","Town_308","Trees_549","Trees_550","Trees_551","Trees_552","Village_957","Village_981"}; roads[] = {"RoadSegment_91","RoadSegment_92","RoadSegment_93","RoadSegment_94","RoadSegment_95","RoadSegment_96","RoadSegment_97"}; }; class sector_25003500 { position[] = {2500,3500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_113","Trees_589","Trees_590","Trees_591","Trees_592"}; }; class sector_35003500 { position[] = {3500,3500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","House","Trees","Village"}; areas[] = {"Forest_116","House_172","House_179","Trees_637","Trees_638","Trees_639","Village_1044"}; roads[] = {"RoadSegment_98","RoadSegment_99","RoadSegment_100","RoadSegment_101","RoadSegment_102"}; }; class sector_45003500 { position[] = {4500,3500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_680","Trees_681","Trees_682","Trees_683","Trees_684"}; roads[] = {"RoadSegment_103","RoadSegment_104","RoadSegment_105"}; }; class sector_55003500 { position[] = {5500,3500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Hill","Trees"}; areas[] = {"Hill_168","Trees_722","Trees_723","Trees_724","Trees_725"}; roads[] = {"RoadSegment_106","RoadSegment_107","RoadSegment_108"}; }; class sector_65003500 { position[] = {6500,3500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Hill","Trees"}; areas[] = {"Hill_165","Trees_766","Trees_767","Trees_768","Trees_769","Trees_770"}; }; class sector_75003500 { position[] = {7500,3500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees","Village"}; areas[] = {"Trees_814","Trees_815","Trees_816","Trees_817","Village_967","Village_991"}; roads[] = {"RoadSegment_109","RoadSegment_110","RoadSegment_111"}; }; class sector_85003500 { position[] = {8500,3500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Trees","Village"}; areas[] = {"House_180","House_191","Trees_860","Trees_861","Trees_862","Village_938"}; roads[] = {"RoadSegment_112","RoadSegment_113","RoadSegment_114","RoadSegment_115","RoadSegment_116","RoadSegment_117","RoadSegment_118","RoadSegment_119"}; }; class sector_95003500 { position[] = {9500,3500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Hill","Trees"}; areas[] = {"Hill_167","Trees_905","Trees_906","Trees_907","Trees_908","Trees_909"}; roads[] = {"RoadSegment_120","RoadSegment_121","RoadSegment_122"}; }; class sector_105003500 { position[] = {10500,3500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Hill","Trees"}; areas[] = {"Hill_159","Trees_396","Trees_397","Trees_398","Trees_399"}; }; class sector_115003500 { position[] = {11500,3500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_452","Trees_453","Trees_454","Trees_455","Trees_456"}; }; class sector_125003500 { position[] = {12500,3500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_502","Trees_503","Trees_504","Trees_505"}; }; class sector_05004500 { position[] = {500,4500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_349","Trees_350","Trees_351","Trees_352"}; roads[] = {"RoadSegment_123","RoadSegment_124","RoadSegment_125","RoadSegment_126"}; }; class sector_15004500 { position[] = {1500,4500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_101","Trees_553","Trees_554","Trees_555","Trees_556"}; roads[] = {"RoadSegment_127","RoadSegment_128"}; }; class sector_25004500 { position[] = {2500,4500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_593","Trees_594","Trees_595","Trees_596","Trees_597"}; roads[] = {"RoadSegment_129","RoadSegment_130","RoadSegment_131","RoadSegment_132"}; }; class sector_35004500 { position[] = {3500,4500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Hill","Town","Trees","Village"}; areas[] = {"Forest_117","Forest_118","Hill_161","Town_292","Trees_640","Trees_641","Trees_642","Village_1015","Village_1041"}; roads[] = {"RoadSegment_133","RoadSegment_134","RoadSegment_135","RoadSegment_136","RoadSegment_137"}; }; class sector_45004500 { position[] = {4500,4500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_124","Forest_125","Forest_126","Trees_685","Trees_686","Trees_687"}; }; class sector_55004500 { position[] = {5500,4500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees","Village"}; areas[] = {"Forest_134","Forest_135","Trees_726","Trees_727","Village_1036","Village_1037"}; roads[] = {"RoadSegment_138","RoadSegment_139","RoadSegment_140"}; }; class sector_65004500 { position[] = {6500,4500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Trees","Village"}; areas[] = {"House_202","Trees_771","Trees_772","Trees_773","Trees_774","Village_989"}; roads[] = {"RoadSegment_141","RoadSegment_142","RoadSegment_143"}; }; class sector_75004500 { position[] = {7500,4500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_66","Trees_818","Trees_819","Trees_820"}; roads[] = {"RoadSegment_144","RoadSegment_145"}; }; class sector_85004500 { position[] = {8500,4500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_863","Trees_864","Trees_865","Trees_866"}; roads[] = {"RoadSegment_146","RoadSegment_147","RoadSegment_148","RoadSegment_149"}; }; class sector_95004500 { position[] = {9500,4500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Religious","Trees","Village"}; areas[] = {"House_171","House_200","Religious_271","Trees_910","Trees_911","Trees_912","Trees_913","Trees_914","Village_977"}; roads[] = {"RoadSegment_150","RoadSegment_151"}; }; class sector_105004500 { position[] = {10500,4500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_400","Trees_401","Trees_402","Trees_403","Trees_404"}; }; class sector_115004500 { position[] = {11500,4500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_457","Trees_458","Trees_459","Trees_460"}; }; class sector_125004500 { position[] = {12500,4500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Hill","Trees"}; areas[] = {"Hill_152","Trees_506","Trees_507","Trees_508","Trees_509","Trees_510"}; }; class sector_05005500 { position[] = {500,5500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_353","Trees_354","Trees_355","Trees_356"}; roads[] = {"RoadSegment_152","RoadSegment_153","RoadSegment_154","RoadSegment_155","RoadSegment_156"}; }; class sector_15005500 { position[] = {1500,5500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Industrial","Town","Trees"}; areas[] = {"House_243","Industrial_249","Town_300","Town_303","Trees_557","Trees_558","Trees_559","Trees_560"}; roads[] = {"RoadSegment_157","RoadSegment_158","RoadSegment_159","RoadSegment_160","RoadSegment_161","RoadSegment_162","RoadSegment_163"}; }; class sector_25005500 { position[] = {2500,5500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Military","Trees","Village"}; areas[] = {"Military_265","Trees_598","Trees_599","Trees_600","Trees_601","Village_1029"}; roads[] = {"RoadSegment_164","RoadSegment_165","RoadSegment_166","RoadSegment_167","RoadSegment_168"}; }; class sector_35005500 { position[] = {3500,5500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","House","Trees","Village"}; areas[] = {"Forest_119","House_204","Trees_643","Trees_644","Trees_645","Village_974","Village_1004"}; roads[] = {"RoadSegment_169","RoadSegment_170","RoadSegment_171","RoadSegment_172","RoadSegment_173"}; }; class sector_45005500 { position[] = {4500,5500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Hill","House","Trees","Village"}; areas[] = {"Forest_127","Hill_162","House_205","House_234","Trees_688","Trees_689","Trees_690","Trees_691","Village_987"}; roads[] = {"RoadSegment_174","RoadSegment_175","RoadSegment_176","RoadSegment_177","RoadSegment_178"}; }; class sector_55005500 { position[] = {5500,5500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Marina","Town","Trees","Village"}; areas[] = {"Forest_136","Marina_262","Town_290","Town_293","Trees_728","Trees_729","Village_1032"}; roads[] = {"RoadSegment_179","RoadSegment_180","RoadSegment_181","RoadSegment_182","RoadSegment_183","RoadSegment_184"}; }; class sector_65005500 { position[] = {6500,5500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","House","Trees","Village"}; areas[] = {"Forest_139","Forest_140","House_192","Trees_775","Trees_776","Village_955","Village_988","Village_999"}; roads[] = {"RoadSegment_185","RoadSegment_186","RoadSegment_187","RoadSegment_188","RoadSegment_189","RoadSegment_190","RoadSegment_191","RoadSegment_192","RoadSegment_193","RoadSegment_194"}; }; class sector_75005500 { position[] = {7500,5500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Trees"}; areas[] = {"House_224","Trees_821","Trees_822","Trees_823","Trees_824","Trees_825"}; roads[] = {"RoadSegment_195","RoadSegment_196","RoadSegment_197","RoadSegment_198","RoadSegment_199","RoadSegment_200"}; }; class sector_85005500 { position[] = {8500,5500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Town","Trees"}; areas[] = {"Town_288","Town_291","Trees_867","Trees_868","Trees_869"}; roads[] = {"RoadSegment_201","RoadSegment_202","RoadSegment_203","RoadSegment_204","RoadSegment_205","RoadSegment_206","RoadSegment_207","RoadSegment_208"}; }; class sector_95005500 { position[] = {9500,5500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_145","Forest_146","Trees_915","Trees_916","Trees_917"}; roads[] = {"RoadSegment_209"}; }; class sector_105005500 { position[] = {10500,5500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_83","Forest_84","Trees_405","Trees_406","Trees_407"}; }; class sector_115005500 { position[] = {11500,5500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_461","Trees_462","Trees_463","Trees_464","Trees_465"}; }; class sector_125005500 { position[] = {12500,5500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_92","Trees_511","Trees_512","Trees_513","Trees_514"}; }; class sector_05006500 { position[] = {500,6500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Air","Forest","Trees"}; areas[] = {"Air_1","Forest_78","Trees_357","Trees_358","Trees_359","Trees_360"}; }; class sector_15006500 { position[] = {1500,6500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_102","Trees_561","Trees_562","Trees_563","Trees_564"}; roads[] = {"RoadSegment_210","RoadSegment_211","RoadSegment_212","RoadSegment_213"}; }; class sector_25006500 { position[] = {2500,6500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_602","Trees_603","Trees_604","Trees_605"}; }; class sector_35006500 { position[] = {3500,6500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Hill","Trees"}; areas[] = {"Hill_164","Trees_646","Trees_647","Trees_648","Trees_649","Trees_650"}; }; class sector_45006500 { position[] = {4500,6500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","House","Trees"}; areas[] = {"Forest_128","House_203","Trees_692","Trees_693","Trees_694"}; roads[] = {"RoadSegment_214","RoadSegment_215"}; }; class sector_55006500 { position[] = {5500,6500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Military","Religious","Town","Trees","Village"}; areas[] = {"House_187","Military_267","Religious_276","Religious_277","Town_301","Town_317","Trees_730","Trees_731","Trees_732","Village_1023"}; roads[] = {"RoadSegment_216","RoadSegment_217","RoadSegment_218","RoadSegment_219","RoadSegment_220","RoadSegment_221","RoadSegment_222","RoadSegment_223","RoadSegment_224"}; }; class sector_65006500 { position[] = {6500,6500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Industrial","Trees","Village"}; areas[] = {"Industrial_250","Trees_777","Trees_778","Trees_779","Trees_780","Village_941","Village_1010","Village_1024"}; roads[] = {"RoadSegment_225","RoadSegment_226","RoadSegment_227","RoadSegment_228"}; }; class sector_75006500 { position[] = {7500,6500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","House","Trees"}; areas[] = {"Forest_141","House_195","Trees_826","Trees_827","Trees_828","Trees_829"}; }; class sector_85006500 { position[] = {8500,6500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Hill","Trees"}; areas[] = {"Hill_157","Trees_870","Trees_871","Trees_872","Trees_873"}; roads[] = {"RoadSegment_229"}; }; class sector_95006500 { position[] = {9500,6500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Religious","Town","Trees","Village"}; areas[] = {"Forest_147","Religious_282","Town_289","Trees_918","Trees_919","Village_954","Village_998","Village_1050"}; roads[] = {"RoadSegment_230","RoadSegment_231","RoadSegment_232","RoadSegment_233","RoadSegment_234"}; }; class sector_105006500 { position[] = {10500,6500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Military","Religious","Town","Trees","Village"}; areas[] = {"Forest_85","Military_270","Religious_283","Town_306","Town_307","Trees_408","Trees_409","Village_975","Village_1021"}; roads[] = {"RoadSegment_235","RoadSegment_236","RoadSegment_237","RoadSegment_238"}; }; class sector_115006500 { position[] = {11500,6500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_466","Trees_467","Trees_468","Trees_469","Trees_470"}; roads[] = {"RoadSegment_239"}; }; class sector_125006500 { position[] = {12500,6500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Air","House","Trees"}; areas[] = {"Air_6","House_208","Trees_515","Trees_516","Trees_517","Trees_518"}; }; class sector_05007500 { position[] = {500,7500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_79","Forest_80","Trees_361","Trees_362","Trees_363","Trees_364"}; roads[] = {"RoadSegment_240","RoadSegment_241","RoadSegment_242","RoadSegment_243","RoadSegment_244"}; }; class sector_15007500 { position[] = {1500,7500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Town"}; areas[] = {"Forest_103","Forest_104","Forest_105","Forest_106","Town_298","Town_304"}; roads[] = {"RoadSegment_245","RoadSegment_246","RoadSegment_247","RoadSegment_248","RoadSegment_249","RoadSegment_250","RoadSegment_251","RoadSegment_252"}; }; class sector_25007500 { position[] = {2500,7500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees","Village"}; areas[] = {"Forest_114","Trees_606","Trees_607","Trees_608","Trees_609","Village_1007"}; roads[] = {"RoadSegment_253","RoadSegment_254","RoadSegment_255","RoadSegment_256"}; }; class sector_35007500 { position[] = {3500,7500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_120","Forest_121","Trees_651","Trees_652","Trees_653"}; roads[] = {"RoadSegment_257"}; }; class sector_45007500 { position[] = {4500,7500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_129","Forest_130","Trees_695","Trees_696"}; }; class sector_55007500 { position[] = {5500,7500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Industrial","Trees"}; areas[] = {"Industrial_258","Trees_733","Trees_734","Trees_735","Trees_736"}; roads[] = {"RoadSegment_258","RoadSegment_259","RoadSegment_260"}; }; class sector_65007500 { position[] = {6500,7500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Trees","Village"}; areas[] = {"House_197","House_198","House_233","Trees_781","Trees_782","Trees_783","Trees_784","Village_936","Village_963","Village_1051","Village_1053"}; roads[] = {"RoadSegment_261","RoadSegment_262","RoadSegment_263","RoadSegment_264"}; }; class sector_75007500 { position[] = {7500,7500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_142","Trees_830","Trees_831","Trees_832"}; roads[] = {"RoadSegment_265"}; }; class sector_85007500 { position[] = {8500,7500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Trees","Village"}; areas[] = {"House_176","House_228","Trees_874","Trees_875","Trees_876","Trees_877","Village_1031","Village_1034"}; roads[] = {"RoadSegment_266","RoadSegment_267","RoadSegment_268","RoadSegment_269","RoadSegment_270"}; }; class sector_95007500 { position[] = {9500,7500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Hill","Trees"}; areas[] = {"Forest_148","Forest_149","Hill_156","Trees_920","Trees_921","Trees_922"}; }; class sector_105007500 { position[] = {10500,7500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Hill","Trees"}; areas[] = {"Hill_160","Trees_410","Trees_411","Trees_412","Trees_413","Trees_414"}; }; class sector_115007500 { position[] = {11500,7500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","House","Trees"}; areas[] = {"Forest_87","Forest_88","House_225","Trees_471","Trees_472","Trees_473","Trees_474"}; }; class sector_125007500 { position[] = {12500,7500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_519","Trees_520","Trees_521"}; }; class sector_05008500 { position[] = {500,8500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_365","Trees_366","Trees_367","Trees_368"}; }; class sector_15008500 { position[] = {1500,8500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_107","Trees_565","Trees_566","Trees_567","Trees_568","Trees_569"}; }; class sector_25008500 { position[] = {2500,8500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Hill","Trees"}; areas[] = {"Hill_163","Trees_610","Trees_611","Trees_612","Trees_613"}; }; class sector_35008500 { position[] = {3500,8500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Trees","Village"}; areas[] = {"House_230","Trees_654","Trees_655","Trees_656","Village_962","Village_971","Village_985","Village_1046","Village_1047"}; roads[] = {"RoadSegment_271","RoadSegment_272","RoadSegment_273","RoadSegment_274","RoadSegment_275"}; }; class sector_45008500 { position[] = {4500,8500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_131","Trees_697","Trees_698","Trees_699"}; roads[] = {"RoadSegment_276"}; }; class sector_55008500 { position[] = {5500,8500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Religious","Trees","Village"}; areas[] = {"Religious_287","Trees_737","Trees_738","Trees_739","Trees_740","Village_1008","Village_1014"}; roads[] = {"RoadSegment_277","RoadSegment_278","RoadSegment_279","RoadSegment_280","RoadSegment_281"}; }; class sector_65008500 { position[] = {6500,8500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Hill","House","Trees","Village"}; areas[] = {"Hill_158","House_182","House_226","Trees_785","Trees_786","Trees_787","Trees_788","Trees_789","Village_992","Village_1026"}; roads[] = {"RoadSegment_282","RoadSegment_283","RoadSegment_284"}; }; class sector_75008500 { position[] = {7500,8500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees","Village"}; areas[] = {"Trees_833","Trees_834","Trees_835","Trees_836","Village_958"}; roads[] = {"RoadSegment_285","RoadSegment_286","RoadSegment_287","RoadSegment_288"}; }; class sector_85008500 { position[] = {8500,8500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_71","Trees_878","Trees_879","Trees_880"}; roads[] = {"RoadSegment_289","RoadSegment_290","RoadSegment_291","RoadSegment_292","RoadSegment_293"}; }; class sector_95008500 { position[] = {9500,8500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees","Village"}; areas[] = {"Trees_923","Trees_924","Trees_925","Trees_926","Village_964"}; roads[] = {"RoadSegment_294","RoadSegment_295","RoadSegment_296"}; }; class sector_105008500 { position[] = {10500,8500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_415","Trees_416","Trees_417","Trees_418","Trees_419"}; }; class sector_115008500 { position[] = {11500,8500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Religious","Trees","Village"}; areas[] = {"Forest_89","Forest_90","Religious_286","Trees_475","Trees_476","Trees_477","Village_1017","Village_1018"}; roads[] = {"RoadSegment_297","RoadSegment_298","RoadSegment_299"}; }; class sector_125008500 { position[] = {12500,8500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_23","Trees_522","Trees_523","Trees_524"}; }; class sector_05009500 { position[] = {500,9500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_369","Trees_370","Trees_371","Trees_372","Trees_373","Trees_374"}; }; class sector_15009500 { position[] = {1500,9500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_570","Trees_571","Trees_572","Trees_573"}; }; class sector_25009500 { position[] = {2500,9500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_115","Trees_614","Trees_615","Trees_616","Trees_617"}; roads[] = {"RoadSegment_300"}; }; class sector_35009500 { position[] = {3500,9500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Religious","Town","Trees","Village"}; areas[] = {"House_196","Religious_281","Town_294","Town_295","Trees_657","Trees_658","Trees_659","Trees_660","Village_939","Village_1019"}; roads[] = {"RoadSegment_301","RoadSegment_302","RoadSegment_303","RoadSegment_304","RoadSegment_305","RoadSegment_306","RoadSegment_307"}; }; class sector_45009500 { position[] = {4500,9500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Industrial","Trees"}; areas[] = {"House_199","Industrial_255","Trees_700","Trees_701","Trees_702","Trees_703"}; roads[] = {"RoadSegment_308","RoadSegment_309","RoadSegment_310","RoadSegment_311","RoadSegment_312","RoadSegment_313","RoadSegment_314","RoadSegment_315","RoadSegment_316"}; }; class sector_55009500 { position[] = {5500,9500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Religious","Town","Trees","Village"}; areas[] = {"House_229","Religious_284","Town_297","Trees_741","Trees_742","Trees_743","Village_948","Village_972","Village_1009","Village_1052"}; roads[] = {"RoadSegment_317","RoadSegment_318","RoadSegment_319","RoadSegment_320","RoadSegment_321","RoadSegment_322","RoadSegment_323","RoadSegment_324","RoadSegment_325"}; }; class sector_65009500 { position[] = {6500,9500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_62","Clearing_63","Clearing_64","Trees_790"}; roads[] = {"RoadSegment_326","RoadSegment_327"}; }; class sector_75009500 { position[] = {7500,9500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_143","Trees_837","Trees_838","Trees_839"}; roads[] = {"RoadSegment_328","RoadSegment_329","RoadSegment_330","RoadSegment_331","RoadSegment_332","RoadSegment_333"}; }; class sector_85009500 { position[] = {8500,9500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_72","Clearing_73","Trees_881","Trees_882"}; roads[] = {"RoadSegment_334","RoadSegment_335"}; }; class sector_95009500 { position[] = {9500,9500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Trees"}; areas[] = {"House_193","House_194","Trees_927","Trees_928","Trees_929","Trees_930"}; roads[] = {"RoadSegment_336","RoadSegment_337","RoadSegment_338"}; }; class sector_105009500 { position[] = {10500,9500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_420","Trees_421","Trees_422","Trees_423","Trees_424"}; }; class sector_115009500 { position[] = {11500,9500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Trees"}; areas[] = {"House_245","Trees_478","Trees_479","Trees_480","Trees_481","Trees_482","Trees_483"}; roads[] = {"RoadSegment_339","RoadSegment_340","RoadSegment_341"}; }; class sector_125009500 { position[] = {12500,9500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Trees","Village"}; areas[] = {"House_215","Trees_525","Trees_526","Trees_527","Trees_528","Village_937","Village_1000"}; roads[] = {"RoadSegment_342","RoadSegment_343"}; }; class sector_050010500 { position[] = {500,10500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Forest","Hill","Trees","Village"}; areas[] = {"Clearing_9","Forest_76","Forest_77","Hill_150","Trees_324","Trees_325","Trees_326","Village_945"}; roads[] = {"RoadSegment_344"}; }; class sector_150010500 { position[] = {1500,10500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_93","Forest_94","Forest_95","Trees_533","Trees_534","Trees_535"}; roads[] = {"RoadSegment_345","RoadSegment_346","RoadSegment_347","RoadSegment_348","RoadSegment_349","RoadSegment_350"}; }; class sector_250010500 { position[] = {2500,10500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","Trees"}; areas[] = {"Forest_108","Forest_109","Forest_110","Trees_576","Trees_577"}; roads[] = {"RoadSegment_351","RoadSegment_352","RoadSegment_353","RoadSegment_354"}; }; class sector_350010500 { position[] = {3500,10500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Industrial","Trees","Village"}; areas[] = {"Industrial_251","Trees_621","Trees_622","Trees_623","Village_969","Village_1013","Village_1027"}; roads[] = {"RoadSegment_355","RoadSegment_356","RoadSegment_357","RoadSegment_358","RoadSegment_359","RoadSegment_360","RoadSegment_361","RoadSegment_362","RoadSegment_363"}; }; class sector_450010500 { position[] = {4500,10500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Trees","Village"}; areas[] = {"House_183","House_223","Trees_664","Trees_665","Trees_666","Village_1025","Village_1039"}; roads[] = {"RoadSegment_364","RoadSegment_365","RoadSegment_366","RoadSegment_367","RoadSegment_368","RoadSegment_369","RoadSegment_370","RoadSegment_371","RoadSegment_372"}; }; class sector_550010500 { position[] = {5500,10500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","House","Trees","Village"}; areas[] = {"Forest_132","House_235","House_236","House_240","House_242","Trees_708","Trees_709","Trees_710","Village_943","Village_946","Village_993"}; roads[] = {"RoadSegment_373","RoadSegment_374","RoadSegment_375","RoadSegment_376","RoadSegment_377","RoadSegment_378","RoadSegment_379","RoadSegment_380","RoadSegment_381","RoadSegment_382"}; }; class sector_650010500 { position[] = {6500,10500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","House","Industrial","Trees","Village"}; areas[] = {"Forest_137","House_170","House_173","House_185","House_186","Industrial_253","Industrial_257","Trees_748","Trees_749","Trees_750","Village_935","Village_959","Village_976","Village_990","Village_996","Village_1016"}; roads[] = {"RoadSegment_383","RoadSegment_384","RoadSegment_385","RoadSegment_386","RoadSegment_387"}; }; class sector_750010500 { position[] = {7500,10500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_65","Trees_795","Trees_796","Trees_797","Trees_798"}; roads[] = {"RoadSegment_388","RoadSegment_389","RoadSegment_390","RoadSegment_391"}; }; class sector_850010500 { position[] = {8500,10500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_844","Trees_845","Trees_846"}; roads[] = {"RoadSegment_392","RoadSegment_393","RoadSegment_394","RoadSegment_395"}; }; class sector_950010500 { position[] = {9500,10500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_887","Trees_888","Trees_889","Trees_890"}; roads[] = {"RoadSegment_396","RoadSegment_397","RoadSegment_398","RoadSegment_399","RoadSegment_400","RoadSegment_401"}; }; class sector_1050010500 { position[] = {10500,10500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Trees","Village"}; areas[] = {"House_209","House_227","Trees_378","Trees_379","Trees_380","Trees_381","Village_942","Village_944","Village_953","Village_961","Village_973","Village_980","Village_1002","Village_1012"}; roads[] = {"RoadSegment_402","RoadSegment_403"}; }; class sector_1150010500 { position[] = {11500,10500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_429","Trees_430","Trees_431","Trees_432","Trees_433"}; roads[] = {"RoadSegment_404","RoadSegment_405","RoadSegment_406","RoadSegment_407","RoadSegment_408","RoadSegment_409","RoadSegment_410","RoadSegment_411"}; }; class sector_1250010500 { position[] = {12500,10500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Trees","Village"}; areas[] = {"House_212","House_216","House_217","House_237","House_246","Trees_488","Trees_489","Trees_490","Village_934","Village_994","Village_1054"}; roads[] = {"RoadSegment_412","RoadSegment_413","RoadSegment_414","RoadSegment_415","RoadSegment_416"}; }; class sector_050011500 { position[] = {500,11500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_10","Trees_327","Trees_328","Trees_329","Trees_330","Trees_331"}; }; class sector_150011500 { position[] = {1500,11500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Forest","Religious","Town","Village"}; areas[] = {"Clearing_25","Forest_96","Forest_97","Forest_98","Forest_99","Religious_275","Town_305","Town_309","Village_970"}; roads[] = {"RoadSegment_417","RoadSegment_418","RoadSegment_419","RoadSegment_420","RoadSegment_421","RoadSegment_422","RoadSegment_423"}; }; class sector_250011500 { position[] = {2500,11500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Forest","Trees"}; areas[] = {"Clearing_30","Forest_111","Forest_112","Trees_578","Trees_579"}; roads[] = {"RoadSegment_424","RoadSegment_425","RoadSegment_426","RoadSegment_427"}; }; class sector_350011500 { position[] = {3500,11500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_38","Clearing_39","Clearing_40","Trees_624","Trees_625"}; roads[] = {"RoadSegment_428","RoadSegment_429","RoadSegment_430","RoadSegment_431"}; }; class sector_450011500 { position[] = {4500,11500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Forest","House","Trees","Village"}; areas[] = {"Forest_122","House_206","Trees_667","Trees_668","Trees_669","Village_1033","Village_1040"}; roads[] = {"RoadSegment_432","RoadSegment_433","RoadSegment_434","RoadSegment_435","RoadSegment_436","RoadSegment_437","RoadSegment_438","RoadSegment_439","RoadSegment_440","RoadSegment_441"}; }; class sector_550011500 { position[] = {5500,11500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","House","Military","Trees"}; areas[] = {"Clearing_53","Clearing_54","House_190","House_232","Military_266","Trees_711","Trees_712"}; roads[] = {"RoadSegment_442","RoadSegment_443","RoadSegment_444","RoadSegment_445","RoadSegment_446","RoadSegment_447","RoadSegment_448"}; }; class sector_650011500 { position[] = {6500,11500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"City","Clearing","Industrial","Military","Religious","Town","Trees","Village"}; areas[] = {"City_8","Clearing_60","Industrial_254","Military_268","Religious_272","Religious_280","Town_310","Trees_751","Trees_752","Village_986","Village_1022"}; roads[] = {"RoadSegment_449","RoadSegment_450","RoadSegment_451","RoadSegment_452","RoadSegment_453","RoadSegment_454","RoadSegment_455","RoadSegment_456","RoadSegment_457","RoadSegment_458","RoadSegment_459"}; }; class sector_750011500 { position[] = {7500,11500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees","Village"}; areas[] = {"Trees_799","Trees_800","Trees_801","Trees_802","Village_951"}; roads[] = {"RoadSegment_460","RoadSegment_461","RoadSegment_462"}; }; class sector_850011500 { position[] = {8500,11500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_67","Trees_847","Trees_848","Trees_849","Trees_850"}; roads[] = {"RoadSegment_463","RoadSegment_464","RoadSegment_465","RoadSegment_466","RoadSegment_467"}; }; class sector_950011500 { position[] = {9500,11500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Religious","Town","Trees","Village"}; areas[] = {"Religious_274","Town_313","Town_316","Trees_891","Trees_892","Trees_893","Trees_894","Village_965"}; roads[] = {"RoadSegment_468","RoadSegment_469","RoadSegment_470","RoadSegment_471"}; }; class sector_1050011500 { position[] = {10500,11500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"House","Industrial","Trees","Village"}; areas[] = {"House_210","House_214","House_218","House_219","Industrial_259","Trees_382","Trees_383","Trees_384","Trees_385","Village_1001","Village_1005","Village_1011"}; roads[] = {"RoadSegment_472","RoadSegment_473","RoadSegment_474"}; }; class sector_1150011500 { position[] = {11500,11500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees","Village"}; areas[] = {"Trees_434","Trees_435","Trees_436","Trees_437","Trees_438","Village_995"}; roads[] = {"RoadSegment_475","RoadSegment_476","RoadSegment_477"}; }; class sector_1250011500 { position[] = {12500,11500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","House","Industrial","Town","Trees","Village"}; areas[] = {"Clearing_18","House_213","Industrial_260","Town_299","Trees_491","Trees_492","Trees_493","Village_978"}; roads[] = {"RoadSegment_478","RoadSegment_479","RoadSegment_480","RoadSegment_481"}; }; class sector_050012500 { position[] = {500,12500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Air","Clearing","Trees"}; areas[] = {"Air_4","Clearing_11","Trees_332","Trees_333","Trees_334","Trees_335"}; }; class sector_150012500 { position[] = {1500,12500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_26","Trees_536","Trees_537","Trees_538","Trees_539"}; roads[] = {"RoadSegment_482","RoadSegment_483","RoadSegment_484"}; }; class sector_250012500 { position[] = {2500,12500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees","Village"}; areas[] = {"Clearing_31","Clearing_32","Clearing_33","Trees_580","Village_997"}; roads[] = {"RoadSegment_485","RoadSegment_486","RoadSegment_487"}; }; class sector_350012500 { position[] = {3500,12500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_41","Clearing_42","Clearing_43","Clearing_44","Clearing_45","Clearing_46","Trees_626","Trees_627"}; }; class sector_450012500 { position[] = {4500,12500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Marina","Trees","Village"}; areas[] = {"Clearing_49","Clearing_50","Clearing_51","Marina_263","Trees_670","Trees_671","Trees_672","Village_932"}; roads[] = {"RoadSegment_488","RoadSegment_489","RoadSegment_490","RoadSegment_491","RoadSegment_492"}; }; class sector_550012500 { position[] = {5500,12500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_55","Clearing_56","Clearing_57","Clearing_58","Clearing_59","Trees_713","Trees_714"}; }; class sector_650012500 { position[] = {6500,12500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Air","Clearing","Marina","Trees","Village"}; areas[] = {"Air_5","Clearing_61","Marina_261","Trees_753","Trees_754","Trees_755","Trees_756","Village_1030"}; roads[] = {"RoadSegment_493","RoadSegment_494"}; }; class sector_750012500 { position[] = {7500,12500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees"}; areas[] = {"Trees_803","Trees_804","Trees_805","Trees_806"}; roads[] = {"RoadSegment_495","RoadSegment_496"}; }; class sector_850012500 { position[] = {8500,12500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_68","Clearing_69","Clearing_70","Trees_851","Trees_852"}; }; class sector_950012500 { position[] = {9500,12500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_74","Clearing_75","Trees_895","Trees_896","Trees_897"}; roads[] = {"RoadSegment_497","RoadSegment_498","RoadSegment_499"}; }; class sector_1050012500 { position[] = {10500,12500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Clearing","Trees"}; areas[] = {"Clearing_14","Clearing_15","Clearing_16","Trees_386","Trees_387"}; }; class sector_1150012500 { position[] = {11500,12500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Trees","Village"}; areas[] = {"Trees_439","Trees_440","Trees_441","Trees_442","Village_960"}; roads[] = {"RoadSegment_500","RoadSegment_501","RoadSegment_502","RoadSegment_503"}; }; class sector_1250012500 { position[] = {12500,12500,0}; orientation[] = {500,500,0}; isWater = 0; typeFlags[] = {"Air","Clearing","Trees"}; areas[] = {"Air_7","Clearing_19","Clearing_20","Clearing_21","Trees_494","Trees_495"}; }; }; class Areas { class Air_0 { position[] = {12800,0,500}; orientation[] = {1,1}; type = "Air"; sector = "sector_125000500"; }; class Air_1 { position[] = {0,6400,500}; orientation[] = {1,1}; type = "Air"; sector = "sector_05006500"; }; class Air_2 { position[] = {0,0,500}; orientation[] = {1,1}; type = "Air"; sector = "sector_05000500"; }; class Air_3 { position[] = {6400,0,500}; orientation[] = {1,1}; type = "Air"; sector = "sector_65000500"; }; class Air_4 { position[] = {0,12800,500}; orientation[] = {1,1}; type = "Air"; sector = "sector_050012500"; }; class Air_5 { position[] = {6400,12800,500}; orientation[] = {1,1}; type = "Air"; sector = "sector_650012500"; }; class Air_6 { position[] = {12800,6400,500}; orientation[] = {1,1}; type = "Air"; sector = "sector_125006500"; }; class Air_7 { position[] = {12800,12800,500}; orientation[] = {1,1}; type = "Air"; sector = "sector_1250012500"; }; class City_8 { position[] = {6285.94,11176.5}; orientation[] = {376.854,633.007}; type = "City"; sector = "sector_650011500"; buildings = 83; }; class Clearing_9 { position[] = {274.219,10918,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_050010500"; }; class Clearing_10 { position[] = {928.906,11800.8,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_050011500"; }; class Clearing_11 { position[] = {358.594,12766.4,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_050012500"; }; class Clearing_12 { position[] = {10732,771.094,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_105000500"; }; class Clearing_13 { position[] = {10700.8,36.7188,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_105000500"; }; class Clearing_14 { position[] = {10436.7,12738.3,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_1050012500"; }; class Clearing_15 { position[] = {10694.5,12414.8,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_1050012500"; }; class Clearing_16 { position[] = {10172.7,12460.2,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_1050012500"; }; class Clearing_17 { position[] = {12761.7,3.90625,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_125000500"; }; class Clearing_18 { position[] = {12724.2,11952.3,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_1250011500"; }; class Clearing_19 { position[] = {12772.7,12643,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_1250012500"; }; class Clearing_20 { position[] = {12510.2,12466.4,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_1250012500"; }; class Clearing_21 { position[] = {12758.6,12083.6,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_1250012500"; }; class Clearing_22 { position[] = {12411.7,2730.47,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_125002500"; }; class Clearing_23 { position[] = {12786.7,8246.09,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_125008500"; }; class Clearing_24 { position[] = {1838.28,730.469,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_15000500"; }; class Clearing_25 { position[] = {1017.97,11978.9,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_150011500"; }; class Clearing_26 { position[] = {1327.34,12613.3,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_150012500"; }; class Clearing_27 { position[] = {2347.66,63.2813,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_25000500"; }; class Clearing_28 { position[] = {2361.72,814.844,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_25000500"; }; class Clearing_29 { position[] = {2908.59,92.9688,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_25000500"; }; class Clearing_30 { position[] = {2730.47,11871.1,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_250011500"; }; class Clearing_31 { position[] = {2649.22,12357,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_250012500"; }; class Clearing_32 { position[] = {2797.66,12007,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_250012500"; }; class Clearing_33 { position[] = {2060.16,12524.2,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_250012500"; }; class Clearing_34 { position[] = {2519.53,1355.47,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_25001500"; }; class Clearing_35 { position[] = {2549.22,2003.91,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_25002500"; }; class Clearing_36 { position[] = {3274.22,341.406,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_35000500"; }; class Clearing_37 { position[] = {3166.41,666.406,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_35000500"; }; class Clearing_38 { position[] = {3171.09,11803.9,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_350011500"; }; class Clearing_39 { position[] = {3324.22,11502.3,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_350011500"; }; class Clearing_40 { position[] = {3547.66,11747.7,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_350011500"; }; class Clearing_41 { position[] = {3463.28,12725.8,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_350012500"; }; class Clearing_42 { position[] = {3502.34,12069.5,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_350012500"; }; class Clearing_43 { position[] = {3791.41,12627.3,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_350012500"; }; class Clearing_44 { position[] = {3828.91,12038.3,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_350012500"; }; class Clearing_45 { position[] = {3517.97,12411.7,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_350012500"; }; class Clearing_46 { position[] = {3941.41,12366.4,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_350012500"; }; class Clearing_47 { position[] = {4630.47,8.59375,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_45000500"; }; class Clearing_48 { position[] = {4917.97,92.9688,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_45000500"; }; class Clearing_49 { position[] = {4371.09,12514.8,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_450012500"; }; class Clearing_50 { position[] = {4167.97,12761.7,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_450012500"; }; class Clearing_51 { position[] = {4060.16,12403.9,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_450012500"; }; class Clearing_52 { position[] = {5346.09,183.594,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_55000500"; }; class Clearing_53 { position[] = {5592.97,11764.8,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_550011500"; }; class Clearing_54 { position[] = {5010.16,11999.2,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_550011500"; }; class Clearing_55 { position[] = {5422.66,12108.6,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_550012500"; }; class Clearing_56 { position[] = {5296.09,12647.7,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_550012500"; }; class Clearing_57 { position[] = {5644.53,12674.2,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_550012500"; }; class Clearing_58 { position[] = {5024.22,12032,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_550012500"; }; class Clearing_59 { position[] = {5652.34,12374.2,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_550012500"; }; class Clearing_60 { position[] = {6344.53,11961.7,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_650011500"; }; class Clearing_61 { position[] = {6067.97,12450.8,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_650012500"; }; class Clearing_62 { position[] = {6491.41,9521.09,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_65009500"; }; class Clearing_63 { position[] = {6982.03,9544.53,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_65009500"; }; class Clearing_64 { position[] = {6074.22,9361.72,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_65009500"; }; class Clearing_65 { position[] = {7936.72,10871.1,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_750010500"; }; class Clearing_66 { position[] = {7239.84,4477.34,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_75004500"; }; class Clearing_67 { position[] = {8591.41,11836.7,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_850011500"; }; class Clearing_68 { position[] = {8469.53,12225.8,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_850012500"; }; class Clearing_69 { position[] = {8188.28,12424.2,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_850012500"; }; class Clearing_70 { position[] = {8502.34,12627.3,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_850012500"; }; class Clearing_71 { position[] = {8167.97,8428.91,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_85008500"; }; class Clearing_72 { position[] = {8605.47,9066.41,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_85009500"; }; class Clearing_73 { position[] = {8153.91,9442.97,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_85009500"; }; class Clearing_74 { position[] = {9855.47,12372.7,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_950012500"; }; class Clearing_75 { position[] = {9639.84,12635.2,0}; orientation[] = {50,50,0}; type = "Clearing"; sector = "sector_950012500"; }; class Forest_76 { position[] = {525.935,10459.1,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_050010500"; }; class Forest_77 { position[] = {918.723,10562.4,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_050010500"; }; class Forest_78 { position[] = {834.181,6481.12,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_05006500"; }; class Forest_79 { position[] = {849.368,7197.88,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_05007500"; }; class Forest_80 { position[] = {932.581,7725.08,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_05007500"; }; class Forest_81 { position[] = {10191.5,1882.25,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_105001500"; }; class Forest_82 { position[] = {10805.7,1875,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_105001500"; }; class Forest_83 { position[] = {10827.8,5540.25,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_105005500"; }; class Forest_84 { position[] = {10690,5940.18,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_105005500"; }; class Forest_85 { position[] = {10305.7,6546.23,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_105006500"; }; class Forest_86 { position[] = {11407.2,2285.56,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_115002500"; }; class Forest_87 { position[] = {11309.9,7938.3,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_115007500"; }; class Forest_88 { position[] = {11765.5,7830.82,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_115007500"; }; class Forest_89 { position[] = {11199.2,8925,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_115008500"; }; class Forest_90 { position[] = {11275.8,8024.44,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_115008500"; }; class Forest_91 { position[] = {12132.4,2532.03,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_125002500"; }; class Forest_92 { position[] = {12010.9,5333.16,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_125005500"; }; class Forest_93 { position[] = {1213.4,10348.2,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_150010500"; }; class Forest_94 { position[] = {1845.4,10388.1,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_150010500"; }; class Forest_95 { position[] = {1528.17,10631.7,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_150010500"; }; class Forest_96 { position[] = {1398.24,11719.3,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_150011500"; }; class Forest_97 { position[] = {1911.87,11234.2,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_150011500"; }; class Forest_98 { position[] = {1096.86,11417.1,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_150011500"; }; class Forest_99 { position[] = {1485.46,11031.2,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_150011500"; }; class Forest_100 { position[] = {1030.52,3311.12,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_15003500"; }; class Forest_101 { position[] = {1038.87,4016.41,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_15004500"; }; class Forest_102 { position[] = {1478.92,6724.55,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_15006500"; }; class Forest_103 { position[] = {1493.56,7425.68,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_15007500"; }; class Forest_104 { position[] = {1037.5,7430.99,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_15007500"; }; class Forest_105 { position[] = {1231.43,7799.78,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_15007500"; }; class Forest_106 { position[] = {1004.69,7019.62,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_15007500"; }; class Forest_107 { position[] = {1084.27,8492.25,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_15008500"; }; class Forest_108 { position[] = {2306.26,10766.8,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_250010500"; }; class Forest_109 { position[] = {2607.35,10017.7,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_250010500"; }; class Forest_110 { position[] = {2031.68,10435.3,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_250010500"; }; class Forest_111 { position[] = {2066.69,11028.2,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_250011500"; }; class Forest_112 { position[] = {2011.07,11532,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_250011500"; }; class Forest_113 { position[] = {2809.1,3312.81,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_25003500"; }; class Forest_114 { position[] = {2099.66,7419.31,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_25007500"; }; class Forest_115 { position[] = {2637.31,9806.07,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_25009500"; }; class Forest_116 { position[] = {3091.68,3444.01,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_35003500"; }; class Forest_117 { position[] = {3124.6,4025,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_35004500"; }; class Forest_118 { position[] = {3893.97,4512.51,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_35004500"; }; class Forest_119 { position[] = {3075,5028.75,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_35005500"; }; class Forest_120 { position[] = {3370.22,7532.8,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_35007500"; }; class Forest_121 { position[] = {3189.22,7151.3,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_35007500"; }; class Forest_122 { position[] = {4330.42,11013.1,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_450011500"; }; class Forest_123 { position[] = {4270.02,2363.23,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_45002500"; }; class Forest_124 { position[] = {4426.58,4291.94,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_45004500"; }; class Forest_125 { position[] = {4879.45,4430.77,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_45004500"; }; class Forest_126 { position[] = {4030.35,4567.97,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_45004500"; }; class Forest_127 { position[] = {4475,5937,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_45005500"; }; class Forest_128 { position[] = {4388.9,6842.44,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_45006500"; }; class Forest_129 { position[] = {4794.69,7226.34,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_45007500"; }; class Forest_130 { position[] = {4129.55,7438.18,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_45007500"; }; class Forest_131 { position[] = {4275.75,8025,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_45008500"; }; class Forest_132 { position[] = {5887.46,10631.1,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_550010500"; }; class Forest_133 { position[] = {5566.14,2014.79,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_55002500"; }; class Forest_134 { position[] = {5294.65,4248.13,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_55004500"; }; class Forest_135 { position[] = {5133.45,4669.36,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_55004500"; }; class Forest_136 { position[] = {5083.04,5521.95,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_55005500"; }; class Forest_137 { position[] = {6422.7,10930.3,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_650010500"; }; class Forest_138 { position[] = {6416.93,2362.86,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_65002500"; }; class Forest_139 { position[] = {6353.53,5896.11,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_65005500"; }; class Forest_140 { position[] = {6914.51,5112.13,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_65005500"; }; class Forest_141 { position[] = {7343.75,6396.26,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_75006500"; }; class Forest_142 { position[] = {7513.27,7538.81,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_75007500"; }; class Forest_143 { position[] = {7875,9327.83,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_75009500"; }; class Forest_144 { position[] = {9490.03,2581.17,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_95002500"; }; class Forest_145 { position[] = {9890.99,5598.03,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_95005500"; }; class Forest_146 { position[] = {9661.35,5927.31,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_95005500"; }; class Forest_147 { position[] = {9645.42,6610.5,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_95006500"; }; class Forest_148 { position[] = {9157.56,7004.57,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_95007500"; }; class Forest_149 { position[] = {9066.09,7624.64,0}; orientation[] = {20,20,0}; type = "Forest"; sector = "sector_95007500"; }; class Hill_150 { position[] = {632.95,10043.6}; orientation[] = {50,50}; type = "Hill"; sector = "sector_050010500"; buildings = 1; }; class Hill_151 { position[] = {1624.48,2332.08}; orientation[] = {50,50}; type = "Hill"; sector = "sector_15002500"; buildings = 1; }; class Hill_152 { position[] = {12285.2,4801.51}; orientation[] = {50,50}; type = "Hill"; sector = "sector_125004500"; buildings = 1; }; class Hill_153 { position[] = {759.18,2454.09}; orientation[] = {50,50}; type = "Hill"; sector = "sector_05002500"; buildings = 1; }; class Hill_154 { position[] = {292.73,387.34}; orientation[] = {50,50}; type = "Hill"; sector = "sector_05000500"; buildings = 1; }; class Hill_155 { position[] = {4754.07,2459.31}; orientation[] = {50,50}; type = "Hill"; sector = "sector_45002500"; buildings = 1; }; class Hill_156 { position[] = {9833.57,7354.02}; orientation[] = {50,50}; type = "Hill"; sector = "sector_95007500"; buildings = 1; }; class Hill_157 { position[] = {8007.28,6187.26}; orientation[] = {50,50}; type = "Hill"; sector = "sector_85006500"; buildings = 1; }; class Hill_158 { position[] = {6511.31,8118.2}; orientation[] = {50,50}; type = "Hill"; sector = "sector_65008500"; buildings = 1; }; class Hill_159 { position[] = {10946.3,3582.17}; orientation[] = {50,50}; type = "Hill"; sector = "sector_105003500"; buildings = 1; }; class Hill_160 { position[] = {10480.3,7523.87}; orientation[] = {50,50}; type = "Hill"; sector = "sector_105007500"; buildings = 1; }; class Hill_161 { position[] = {3120.67,4571.14}; orientation[] = {50,50}; type = "Hill"; sector = "sector_35004500"; buildings = 1; }; class Hill_162 { position[] = {4396.1,5009.27}; orientation[] = {50,50}; type = "Hill"; sector = "sector_45005500"; buildings = 1; }; class Hill_163 { position[] = {2263.9,8583.47}; orientation[] = {50,50}; type = "Hill"; sector = "sector_25008500"; buildings = 1; }; class Hill_164 { position[] = {3998.35,6919.2}; orientation[] = {50,50}; type = "Hill"; sector = "sector_35006500"; buildings = 1; }; class Hill_165 { position[] = {6916.74,3914.82}; orientation[] = {50,50}; type = "Hill"; sector = "sector_65003500"; buildings = 1; }; class Hill_166 { position[] = {3730.58,2723.58}; orientation[] = {50,50}; type = "Hill"; sector = "sector_35002500"; buildings = 1; }; class Hill_167 { position[] = {9777.7,3649.66}; orientation[] = {50,50}; type = "Hill"; sector = "sector_95003500"; buildings = 1; }; class Hill_168 { position[] = {5721.58,3220.19}; orientation[] = {50,50}; type = "Hill"; sector = "sector_55003500"; buildings = 1; }; class House_169 { position[] = {8028.02,2934.9}; orientation[] = {50,50}; type = "House"; sector = "sector_85002500"; buildings = 1; }; class House_170 { position[] = {6042.69,10575.4}; orientation[] = {50,50}; type = "House"; sector = "sector_650010500"; buildings = 1; }; class House_171 { position[] = {9448.61,4727.6}; orientation[] = {50,50}; type = "House"; sector = "sector_95004500"; buildings = 1; }; class House_172 { position[] = {3145.43,3568.54}; orientation[] = {50,50}; type = "House"; sector = "sector_35003500"; buildings = 1; }; class House_173 { position[] = {6251.56,10708.7}; orientation[] = {50,50}; type = "House"; sector = "sector_650010500"; buildings = 1; }; class House_174 { position[] = {7502.69,1639.99}; orientation[] = {50,50}; type = "House"; sector = "sector_75001500"; buildings = 1; }; class House_175 { position[] = {6559.53,2265.56}; orientation[] = {50,50}; type = "House"; sector = "sector_65002500"; buildings = 1; }; class House_176 { position[] = {8513.4,7461.25}; orientation[] = {50,50}; type = "House"; sector = "sector_85007500"; buildings = 1; }; class House_177 { position[] = {7359.67,1691.79}; orientation[] = {50,50}; type = "House"; sector = "sector_75001500"; buildings = 1; }; class House_178 { position[] = {7373.34,1585.54}; orientation[] = {50,50}; type = "House"; sector = "sector_75001500"; buildings = 1; }; class House_179 { position[] = {3192.12,3536.09}; orientation[] = {50,50}; type = "House"; sector = "sector_35003500"; buildings = 1; }; class House_180 { position[] = {8639.64,3055.88}; orientation[] = {50,50}; type = "House"; sector = "sector_85003500"; buildings = 1; }; class House_181 { position[] = {8012.7,2940.49}; orientation[] = {50,50}; type = "House"; sector = "sector_85002500"; buildings = 1; }; class House_182 { position[] = {6451.8,8942.68}; orientation[] = {50,50}; type = "House"; sector = "sector_65008500"; buildings = 1; }; class House_183 { position[] = {4236.8,10994.1}; orientation[] = {50,50}; type = "House"; sector = "sector_450010500"; buildings = 1; }; class House_184 { position[] = {7237.3,1426.7}; orientation[] = {50,50}; type = "House"; sector = "sector_75001500"; buildings = 1; }; class House_185 { position[] = {6000.02,10444.3}; orientation[] = {50,50}; type = "House"; sector = "sector_650010500"; buildings = 1; }; class House_186 { position[] = {6015.18,10096.6}; orientation[] = {50,50}; type = "House"; sector = "sector_650010500"; buildings = 1; }; class House_187 { position[] = {5036.18,6868.06}; orientation[] = {50,50}; type = "House"; sector = "sector_55006500"; buildings = 1; }; class House_188 { position[] = {7230.81,1411.13}; orientation[] = {50,50}; type = "House"; sector = "sector_75001500"; buildings = 1; }; class House_189 { position[] = {8282.08,2094.06}; orientation[] = {50,50}; type = "House"; sector = "sector_85002500"; buildings = 1; }; class House_190 { position[] = {5879.03,11260}; orientation[] = {50,50}; type = "House"; sector = "sector_550011500"; buildings = 1; }; class House_191 { position[] = {8332.91,3157.05}; orientation[] = {50,50}; type = "House"; sector = "sector_85003500"; buildings = 1; }; class House_192 { position[] = {6939.53,5877.08}; orientation[] = {50,50}; type = "House"; sector = "sector_65005500"; buildings = 1; }; class House_193 { position[] = {9426.79,9997.64}; orientation[] = {50,50}; type = "House"; sector = "sector_95009500"; buildings = 1; }; class House_194 { position[] = {9426.79,9997.64}; orientation[] = {50,50}; type = "House"; sector = "sector_95009500"; buildings = 1; }; class House_195 { position[] = {7271.33,6415.79}; orientation[] = {50,50}; type = "House"; sector = "sector_75006500"; buildings = 1; }; class House_196 { position[] = {3868.9,9339.34}; orientation[] = {50,50}; type = "House"; sector = "sector_35009500"; buildings = 1; }; class House_197 { position[] = {6672.97,7468.63}; orientation[] = {50,50}; type = "House"; sector = "sector_65007500"; buildings = 1; }; class House_198 { position[] = {6017.29,7609.92}; orientation[] = {50,50}; type = "House"; sector = "sector_65007500"; buildings = 1; }; class House_199 { position[] = {4674.37,9473.03}; orientation[] = {50,50}; type = "House"; sector = "sector_45009500"; buildings = 1; }; class House_200 { position[] = {9118.68,4412.25}; orientation[] = {50,50}; type = "House"; sector = "sector_95004500"; buildings = 1; }; class House_201 { position[] = {5833.53,944.045}; orientation[] = {50,50}; type = "House"; sector = "sector_55000500"; buildings = 1; }; class House_202 { position[] = {6990.85,4953.07}; orientation[] = {50,50}; type = "House"; sector = "sector_65004500"; buildings = 1; }; class House_203 { position[] = {4765.34,6776.6}; orientation[] = {50,50}; type = "House"; sector = "sector_45006500"; buildings = 1; }; class House_204 { position[] = {3850.02,5665.05}; orientation[] = {50,50}; type = "House"; sector = "sector_35005500"; buildings = 1; }; class House_205 { position[] = {4315.68,5719.4}; orientation[] = {50,50}; type = "House"; sector = "sector_45005500"; buildings = 1; }; class House_206 { position[] = {4222.1,11079.2}; orientation[] = {50,50}; type = "House"; sector = "sector_450011500"; buildings = 1; }; class House_207 { position[] = {11360.9,2471.95}; orientation[] = {50,50}; type = "House"; sector = "sector_115002500"; buildings = 1; }; class House_208 { position[] = {12116.7,6797.56}; orientation[] = {50,50}; type = "House"; sector = "sector_125006500"; buildings = 1; }; class House_209 { position[] = {10630.7,10706.6}; orientation[] = {50,50}; type = "House"; sector = "sector_1050010500"; buildings = 1; }; class House_210 { position[] = {10265.5,11289.3}; orientation[] = {50,50}; type = "House"; sector = "sector_1050011500"; buildings = 1; }; class House_211 { position[] = {3232.96,906.145}; orientation[] = {50,50}; type = "House"; sector = "sector_35000500"; buildings = 1; }; class House_212 { position[] = {12607.8,10939.5}; orientation[] = {50,50}; type = "House"; sector = "sector_1250010500"; buildings = 1; }; class House_213 { position[] = {12562.8,11062.8}; orientation[] = {50,50}; type = "House"; sector = "sector_1250011500"; buildings = 1; }; class House_214 { position[] = {10621.7,11033}; orientation[] = {50,50}; type = "House"; sector = "sector_1050011500"; buildings = 1; }; class House_215 { position[] = {12521.6,9978.91}; orientation[] = {50,50}; type = "House"; sector = "sector_125009500"; buildings = 1; }; class House_216 { position[] = {12491.1,10878.2}; orientation[] = {50,50}; type = "House"; sector = "sector_1250010500"; buildings = 1; }; class House_217 { position[] = {12472.9,10965.4}; orientation[] = {50,50}; type = "House"; sector = "sector_1250010500"; buildings = 1; }; class House_218 { position[] = {10146.7,11330.4}; orientation[] = {50,50}; type = "House"; sector = "sector_1050011500"; buildings = 1; }; class House_219 { position[] = {10565,11017.8}; orientation[] = {50,50}; type = "House"; sector = "sector_1050011500"; buildings = 1; }; class House_220 { position[] = {814.085,3020.29}; orientation[] = {50,50}; type = "House"; sector = "sector_05003500"; buildings = 1; }; class House_221 { position[] = {964.485,3068.91}; orientation[] = {50,50}; type = "House"; sector = "sector_05003500"; buildings = 1; }; class House_222 { position[] = {10295,1932.53}; orientation[] = {50,66.894}; type = "House"; sector = "sector_105001500"; buildings = 2; }; class House_223 { position[] = {4039.99,10570.5}; orientation[] = {139.879,75.4327}; type = "House"; sector = "sector_450010500"; buildings = 2; }; class House_224 { position[] = {7008.42,5792.66}; orientation[] = {50,50}; type = "House"; sector = "sector_75005500"; buildings = 2; }; class House_225 { position[] = {11952.4,7296.7}; orientation[] = {123.211,258.721}; type = "House"; sector = "sector_115007500"; buildings = 2; }; class House_226 { position[] = {6329.79,8904.01}; orientation[] = {94.9942,50}; type = "House"; sector = "sector_65008500"; buildings = 2; }; class House_227 { position[] = {10411.2,10916.8}; orientation[] = {153.931,58.7651}; type = "House"; sector = "sector_1050010500"; buildings = 2; }; class House_228 { position[] = {8813.57,7147.39}; orientation[] = {50,50}; type = "House"; sector = "sector_85007500"; buildings = 2; }; class House_229 { position[] = {5665.77,9788.29}; orientation[] = {169.783,92.4011}; type = "House"; sector = "sector_55009500"; buildings = 2; }; class House_230 { position[] = {3112.98,8198.88}; orientation[] = {50,50}; type = "House"; sector = "sector_35008500"; buildings = 2; }; class House_231 { position[] = {10258.9,2569.73}; orientation[] = {50,50}; type = "House"; sector = "sector_105002500"; buildings = 2; }; class House_232 { position[] = {5925.93,11858.8}; orientation[] = {50,50}; type = "House"; sector = "sector_550011500"; buildings = 2; }; class House_233 { position[] = {6737.41,7383.13}; orientation[] = {50,50}; type = "House"; sector = "sector_65007500"; buildings = 2; }; class House_234 { position[] = {4211.86,5688.22}; orientation[] = {177.491,54.623}; type = "House"; sector = "sector_45005500"; buildings = 2; }; class House_235 { position[] = {5861.8,10193.2}; orientation[] = {50,50}; type = "House"; sector = "sector_550010500"; buildings = 2; }; class House_236 { position[] = {5969.39,10419}; orientation[] = {50,50}; type = "House"; sector = "sector_550010500"; buildings = 2; }; class House_237 { position[] = {12413.6,10046.6}; orientation[] = {69.1002,50}; type = "House"; sector = "sector_1250010500"; buildings = 2; }; class House_238 { position[] = {10098.6,1987.66}; orientation[] = {247.054,71.7037}; type = "House"; sector = "sector_105001500"; buildings = 2; }; class House_239 { position[] = {7516.5,1657.89}; orientation[] = {50,50}; type = "House"; sector = "sector_75001500"; buildings = 2; }; class House_240 { position[] = {5997.41,10459.3}; orientation[] = {61.8213,50}; type = "House"; sector = "sector_550010500"; buildings = 2; }; class House_241 { position[] = {1227.13,1673.24}; orientation[] = {50,50}; type = "House"; sector = "sector_15001500"; buildings = 2; }; class House_242 { position[] = {5979.77,10494.5}; orientation[] = {50,50}; type = "House"; sector = "sector_550010500"; buildings = 2; }; class House_243 { position[] = {1924.9,5589.05}; orientation[] = {50,50}; type = "House"; sector = "sector_15005500"; buildings = 2; }; class House_244 { position[] = {7312.77,2220.56}; orientation[] = {291.689,100.41}; type = "House"; sector = "sector_75002500"; buildings = 2; }; class House_245 { position[] = {11222,9429.47}; orientation[] = {50,50}; type = "House"; sector = "sector_115009500"; buildings = 2; }; class House_246 { position[] = {12620,10924.9}; orientation[] = {50,50}; type = "House"; sector = "sector_1250010500"; buildings = 2; }; class Industrial_247 { position[] = {10085.2,2262.89}; orientation[] = {155.681,65.8561}; type = "Industrial"; sector = "sector_105002500"; buildings = 5; }; class Industrial_248 { position[] = {122.109,2796.22}; orientation[] = {76.8695,91.0253}; type = "Industrial"; sector = "sector_05002500"; buildings = 5; }; class Industrial_249 { position[] = {1596.55,5684.95}; orientation[] = {117.079,84.3149}; type = "Industrial"; sector = "sector_15005500"; buildings = 5; }; class Industrial_250 { position[] = {6819.82,6515.34}; orientation[] = {68.3004,95.8977}; type = "Industrial"; sector = "sector_65006500"; buildings = 5; }; class Industrial_251 { position[] = {3819.04,10386.6}; orientation[] = {133.059,72.0607}; type = "Industrial"; sector = "sector_350010500"; buildings = 5; }; class Industrial_252 { position[] = {8066.33,2017.49}; orientation[] = {93.3915,30.5466}; type = "Industrial"; sector = "sector_85002500"; buildings = 5; }; class Industrial_253 { position[] = {6024.25,10484.6}; orientation[] = {146.918,77.6263}; type = "Industrial"; sector = "sector_650010500"; buildings = 5; }; class Industrial_254 { position[] = {6379.03,11253.9}; orientation[] = {63.5707,59.747}; type = "Industrial"; sector = "sector_650011500"; buildings = 5; }; class Industrial_255 { position[] = {4624.82,9456.22}; orientation[] = {59.0697,46.8424}; type = "Industrial"; sector = "sector_45009500"; buildings = 6; }; class Industrial_256 { position[] = {1470.12,3536}; orientation[] = {79.9636,136.38}; type = "Industrial"; sector = "sector_15003500"; buildings = 6; }; class Industrial_257 { position[] = {6180.24,10857.2}; orientation[] = {52.1517,174.553}; type = "Industrial"; sector = "sector_650010500"; buildings = 6; }; class Industrial_258 { position[] = {5974.44,7243.7}; orientation[] = {78.7359,191.054}; type = "Industrial"; sector = "sector_55007500"; buildings = 6; }; class Industrial_259 { position[] = {10453.9,11099.7}; orientation[] = {126.626,87.0149}; type = "Industrial"; sector = "sector_1050011500"; buildings = 7; }; class Industrial_260 { position[] = {12238.7,11104.3}; orientation[] = {100.342,80.4515}; type = "Industrial"; sector = "sector_1250011500"; buildings = 8; }; class Marina_261 { position[] = {6794.45,12004.1}; orientation[] = {50,50}; type = "Marina"; sector = "sector_650012500"; buildings = 1; }; class Marina_262 { position[] = {5220.5,5032.64}; orientation[] = {50,50}; type = "Marina"; sector = "sector_55005500"; buildings = 1; }; class Marina_263 { position[] = {4330.52,12036.2}; orientation[] = {50,50}; type = "Marina"; sector = "sector_450012500"; buildings = 1; }; class Military_264 { position[] = {8346.87,1870.63}; orientation[] = {91.7104,59.5045}; type = "Military"; sector = "sector_85001500"; buildings = 3; }; class Military_265 { position[] = {2627.95,5085.86}; orientation[] = {65.2456,30.5266}; type = "Military"; sector = "sector_25005500"; buildings = 4; }; class Military_266 { position[] = {5852.7,11248.3}; orientation[] = {286.325,142.367}; type = "Military"; sector = "sector_550011500"; buildings = 5; }; class Military_267 { position[] = {5113.4,6056.97}; orientation[] = {37.1486,52.1012}; type = "Military"; sector = "sector_55006500"; buildings = 5; }; class Military_268 { position[] = {6103.42,11499.2}; orientation[] = {76.2013,146.742}; type = "Military"; sector = "sector_650011500"; buildings = 9; }; class Military_269 { position[] = {8223.89,2144.68}; orientation[] = {191.887,75.0841}; type = "Military"; sector = "sector_85002500"; buildings = 9; }; class Military_270 { position[] = {10465.2,6438.08}; orientation[] = {165.079,96.271}; type = "Military"; sector = "sector_105006500"; buildings = 9; }; class Religious_271 { position[] = {9894.1,4401.45}; orientation[] = {0,0}; type = "Religious"; sector = "sector_95004500"; buildings = 1; }; class Religious_272 { position[] = {6210.21,11198.7}; orientation[] = {11.8825,10.5188}; type = "Religious"; sector = "sector_650011500"; buildings = 2; }; class Religious_273 { position[] = {1598.66,3531.41}; orientation[] = {15.5419,8.97752}; type = "Religious"; sector = "sector_15003500"; buildings = 2; }; class Religious_274 { position[] = {9821.01,11472.4}; orientation[] = {22.0193,14.9875}; type = "Religious"; sector = "sector_950011500"; buildings = 2; }; class Religious_275 { position[] = {1787.28,11933.9}; orientation[] = {16.8683,34.0216}; type = "Religious"; sector = "sector_150011500"; buildings = 3; }; class Religious_276 { position[] = {5913.3,6337.7}; orientation[] = {31.3618,18.7397}; type = "Religious"; sector = "sector_55006500"; buildings = 3; }; class Religious_277 { position[] = {5386.75,6242.21}; orientation[] = {25.3252,19.8016}; type = "Religious"; sector = "sector_55006500"; buildings = 3; }; class Religious_278 { position[] = {8516.35,2394.24}; orientation[] = {30.7979,16.9904}; type = "Religious"; sector = "sector_85002500"; buildings = 3; }; class Religious_279 { position[] = {1393.74,3544.11}; orientation[] = {23.207,32.8069}; type = "Religious"; sector = "sector_15003500"; buildings = 4; }; class Religious_280 { position[] = {6568.58,11395.6}; orientation[] = {37.472,33.0623}; type = "Religious"; sector = "sector_650011500"; buildings = 4; }; class Religious_281 { position[] = {3133.56,9924.06}; orientation[] = {21.1339,47.4354}; type = "Religious"; sector = "sector_35009500"; buildings = 5; }; class Religious_282 { position[] = {9141.32,6704.62}; orientation[] = {35.591,37.1787}; type = "Religious"; sector = "sector_95006500"; buildings = 6; }; class Religious_283 { position[] = {10819.3,6348.88}; orientation[] = {44.9775,28.7939}; type = "Religious"; sector = "sector_105006500"; buildings = 7; }; class Religious_284 { position[] = {5717.79,9961.22}; orientation[] = {50.5973,49.0929}; type = "Religious"; sector = "sector_55009500"; buildings = 8; }; class Religious_285 { position[] = {10316.1,2345.69}; orientation[] = {44.999,25.7267}; type = "Religious"; sector = "sector_105002500"; buildings = 8; }; class Religious_286 { position[] = {11509.8,8250.94}; orientation[] = {43.4113,63.569}; type = "Religious"; sector = "sector_115008500"; buildings = 13; }; class Religious_287 { position[] = {5654.97,8894.64}; orientation[] = {60.2417,75.3081}; type = "Religious"; sector = "sector_55008500"; buildings = 21; }; class Town_288 { position[] = {8905.46,5263.19}; orientation[] = {378.156,285.491}; type = "Town"; sector = "sector_85005500"; buildings = 35; }; class Town_289 { position[] = {9171.42,6669.72}; orientation[] = {408.682,372.189}; type = "Town"; sector = "sector_95006500"; buildings = 35; }; class Town_290 { position[] = {5975.5,5656.2}; orientation[] = {520.104,328.013}; type = "Town"; sector = "sector_55005500"; buildings = 36; }; class Town_291 { position[] = {8905.46,5154.1}; orientation[] = {378.156,525.506}; type = "Town"; sector = "sector_85005500"; buildings = 36; }; class Town_292 { position[] = {3649.53,4283.06}; orientation[] = {465.545,542.288}; type = "Town"; sector = "sector_35004500"; buildings = 38; }; class Town_293 { position[] = {5964.99,5737.32}; orientation[] = {568.659,465.122}; type = "Town"; sector = "sector_55005500"; buildings = 39; }; class Town_294 { position[] = {3005.96,9891.25}; orientation[] = {405.351,282.955}; type = "Town"; sector = "sector_35009500"; buildings = 42; }; class Town_295 { position[] = {3005.96,9891.25}; orientation[] = {405.351,282.955}; type = "Town"; sector = "sector_35009500"; buildings = 42; }; class Town_296 { position[] = {8525.86,2416.77}; orientation[] = {343.099,339.223}; type = "Town"; sector = "sector_85002500"; buildings = 42; }; class Town_297 { position[] = {5629.28,9111.71}; orientation[] = {230.417,603.432}; type = "Town"; sector = "sector_55009500"; buildings = 43; }; class Town_298 { position[] = {1999.88,7668.99}; orientation[] = {379.41,263.796}; type = "Town"; sector = "sector_15007500"; buildings = 45; }; class Town_299 { position[] = {12217.4,11090.6}; orientation[] = {407.587,295.128}; type = "Town"; sector = "sector_1250011500"; buildings = 45; }; class Town_300 { position[] = {1486.52,5749.03}; orientation[] = {469.25,489.105}; type = "Town"; sector = "sector_15005500"; buildings = 45; }; class Town_301 { position[] = {5134.56,6120.49}; orientation[] = {500.193,350.155}; type = "Town"; sector = "sector_55006500"; buildings = 45; }; class Town_302 { position[] = {8503.88,2415.56}; orientation[] = {391.459,341.881}; type = "Town"; sector = "sector_85002500"; buildings = 45; }; class Town_303 { position[] = {1596.97,5749.03}; orientation[] = {399.338,489.105}; type = "Town"; sector = "sector_15005500"; buildings = 45; }; class Town_304 { position[] = {1999.88,7668.99}; orientation[] = {379.41,263.796}; type = "Town"; sector = "sector_15007500"; buildings = 45; }; class Town_305 { position[] = {1866.71,11833.7}; orientation[] = {563.184,394.481}; type = "Town"; sector = "sector_150011500"; buildings = 47; }; class Town_306 { position[] = {10620.8,6363.67}; orientation[] = {554.544,288.334}; type = "Town"; sector = "sector_105006500"; buildings = 50; }; class Town_307 { position[] = {10624.1,6363.67}; orientation[] = {561.668,288.334}; type = "Town"; sector = "sector_105006500"; buildings = 52; }; class Town_308 { position[] = {1509.83,3613.12}; orientation[] = {469.875,343.055}; type = "Town"; sector = "sector_15003500"; buildings = 56; }; class Town_309 { position[] = {1824.81,11790.2}; orientation[] = {570.197,490.169}; type = "Town"; sector = "sector_150011500"; buildings = 57; }; class Town_310 { position[] = {6231.39,11044.7}; orientation[] = {256.855,536.401}; type = "Town"; sector = "sector_650011500"; buildings = 58; }; class Town_311 { position[] = {560.427,2834.61}; orientation[] = {519.858,434.261}; type = "Town"; sector = "sector_05002500"; buildings = 59; }; class Town_312 { position[] = {4431.24,677.992}; orientation[] = {515.749,372.517}; type = "Town"; sector = "sector_45000500"; buildings = 59; }; class Town_313 { position[] = {9848.67,11474.3}; orientation[] = {281.701,263.058}; type = "Town"; sector = "sector_950011500"; buildings = 59; }; class Town_314 { position[] = {4439.3,677.992}; orientation[] = {533.475,372.517}; type = "Town"; sector = "sector_45000500"; buildings = 61; }; class Town_315 { position[] = {10128.9,2394.16}; orientation[] = {575.301,353.197}; type = "Town"; sector = "sector_105002500"; buildings = 69; }; class Town_316 { position[] = {9870.09,11437.3}; orientation[] = {328.816,344.366}; type = "Town"; sector = "sector_950011500"; buildings = 73; }; class Town_317 { position[] = {5368.44,6112.05}; orientation[] = {387.928,436.32}; type = "Town"; sector = "sector_55006500"; buildings = 74; }; class Trees_318 { position[] = {898.654,924.821,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05000500"; }; class Trees_319 { position[] = {209.641,946.189,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05000500"; }; class Trees_320 { position[] = {622.217,474.782,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05000500"; }; class Trees_321 { position[] = {32.8428,476.393,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05000500"; }; class Trees_322 { position[] = {298.274,41.7459,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05000500"; }; class Trees_323 { position[] = {837.613,15.1645,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05000500"; }; class Trees_324 { position[] = {8.09086,10547.2,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_050010500"; }; class Trees_325 { position[] = {321.63,10038.8,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_050010500"; }; class Trees_326 { position[] = {824.197,10128,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_050010500"; }; class Trees_327 { position[] = {96.7702,11933.9,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_050011500"; }; class Trees_328 { position[] = {48.553,11389.9,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_050011500"; }; class Trees_329 { position[] = {412.412,11030.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_050011500"; }; class Trees_330 { position[] = {906.209,11049.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_050011500"; }; class Trees_331 { position[] = {612.889,11489.4,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_050011500"; }; class Trees_332 { position[] = {112.441,12002.7,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_050012500"; }; class Trees_333 { position[] = {59.9278,12511.8,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_050012500"; }; class Trees_334 { position[] = {716.377,12038,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_050012500"; }; class Trees_335 { position[] = {804.641,12549.2,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_050012500"; }; class Trees_336 { position[] = {607.378,1594.32,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05001500"; }; class Trees_337 { position[] = {22.7599,1498.96,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05001500"; }; class Trees_338 { position[] = {161.345,1012.53,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05001500"; }; class Trees_339 { position[] = {668.177,1091.05,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05001500"; }; class Trees_340 { position[] = {198.755,2016.82,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05002500"; }; class Trees_341 { position[] = {824.073,2714.43,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05002500"; }; class Trees_342 { position[] = {91.1274,2514.37,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05002500"; }; class Trees_343 { position[] = {371.599,2934.35,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05002500"; }; class Trees_344 { position[] = {773.773,2080.45,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05002500"; }; class Trees_345 { position[] = {190.846,3029.06,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05003500"; }; class Trees_346 { position[] = {699.025,3145.2,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05003500"; }; class Trees_347 { position[] = {143.206,3524.03,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05003500"; }; class Trees_348 { position[] = {898.305,3629.58,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05003500"; }; class Trees_349 { position[] = {857.456,4093.28,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05004500"; }; class Trees_350 { position[] = {130.521,4034.14,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05004500"; }; class Trees_351 { position[] = {199.503,4538.18,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05004500"; }; class Trees_352 { position[] = {738.634,4595.26,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05004500"; }; class Trees_353 { position[] = {402.904,5002.21,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05005500"; }; class Trees_354 { position[] = {838.779,5295.71,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05005500"; }; class Trees_355 { position[] = {88.6897,5422.33,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05005500"; }; class Trees_356 { position[] = {430.765,5823.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05005500"; }; class Trees_357 { position[] = {901.132,6068.33,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05006500"; }; class Trees_358 { position[] = {360.719,6019.96,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05006500"; }; class Trees_359 { position[] = {383.538,6731.65,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05006500"; }; class Trees_360 { position[] = {13.9824,6394.85,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05006500"; }; class Trees_361 { position[] = {12.6851,7320.34,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05007500"; }; class Trees_362 { position[] = {78.7075,7916.79,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05007500"; }; class Trees_363 { position[] = {469.018,7526.45,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05007500"; }; class Trees_364 { position[] = {430.232,7037.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05007500"; }; class Trees_365 { position[] = {688.183,8611.29,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05008500"; }; class Trees_366 { position[] = {595.918,8128,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05008500"; }; class Trees_367 { position[] = {142.576,8489.27,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05008500"; }; class Trees_368 { position[] = {44.7061,8000.33,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05008500"; }; class Trees_369 { position[] = {7.60252,9280.41,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05009500"; }; class Trees_370 { position[] = {2.75607,9788.72,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05009500"; }; class Trees_371 { position[] = {926.983,9211.09,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05009500"; }; class Trees_372 { position[] = {505.72,9544.42,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05009500"; }; class Trees_373 { position[] = {430.597,9009,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05009500"; }; class Trees_374 { position[] = {797.668,9922.57,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_05009500"; }; class Trees_375 { position[] = {10141.8,525.331,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105000500"; }; class Trees_376 { position[] = {10929.6,494.391,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105000500"; }; class Trees_377 { position[] = {10077.4,23.3776,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105000500"; }; class Trees_378 { position[] = {10378.5,10041.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1050010500"; }; class Trees_379 { position[] = {10005.5,10546.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1050010500"; }; class Trees_380 { position[] = {10914.4,10213.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1050010500"; }; class Trees_381 { position[] = {10572.6,10598.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1050010500"; }; class Trees_382 { position[] = {10130.3,11011,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1050011500"; }; class Trees_383 { position[] = {10914.5,11596.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1050011500"; }; class Trees_384 { position[] = {10309.1,11523.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1050011500"; }; class Trees_385 { position[] = {10725.5,11107.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1050011500"; }; class Trees_386 { position[] = {10037.6,12009.7,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1050012500"; }; class Trees_387 { position[] = {10815.1,12012.2,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1050012500"; }; class Trees_388 { position[] = {10323,1498.55,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105001500"; }; class Trees_389 { position[] = {10576.1,1019.01,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105001500"; }; class Trees_390 { position[] = {10914.8,1447.37,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105001500"; }; class Trees_391 { position[] = {10077.3,1040.92,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105001500"; }; class Trees_392 { position[] = {10441.6,2015.05,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105002500"; }; class Trees_393 { position[] = {10899.9,2280.43,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105002500"; }; class Trees_394 { position[] = {10621.4,2729.82,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105002500"; }; class Trees_395 { position[] = {10019.6,2579.47,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105002500"; }; class Trees_396 { position[] = {10588.5,3522.55,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105003500"; }; class Trees_397 { position[] = {10657,3008,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105003500"; }; class Trees_398 { position[] = {10108.5,3123.11,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105003500"; }; class Trees_399 { position[] = {10037.2,3693.75,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105003500"; }; class Trees_400 { position[] = {10503.9,4420.75,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105004500"; }; class Trees_401 { position[] = {10227.8,4016.39,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105004500"; }; class Trees_402 { position[] = {10006.9,4616.31,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105004500"; }; class Trees_403 { position[] = {10844,4819.87,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105004500"; }; class Trees_404 { position[] = {10868,4006.98,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105004500"; }; class Trees_405 { position[] = {10266.8,5527.88,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105005500"; }; class Trees_406 { position[] = {10605.2,5077.42,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105005500"; }; class Trees_407 { position[] = {10007.5,5026.83,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105005500"; }; class Trees_408 { position[] = {10807.8,6691.54,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105006500"; }; class Trees_409 { position[] = {10335.3,6032.37,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105006500"; }; class Trees_410 { position[] = {10717.7,7002.39,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105007500"; }; class Trees_411 { position[] = {10397.4,7465.99,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105007500"; }; class Trees_412 { position[] = {10019.8,7040.49,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105007500"; }; class Trees_413 { position[] = {10919.2,7483.37,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105007500"; }; class Trees_414 { position[] = {10029.7,7811.4,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105007500"; }; class Trees_415 { position[] = {10403.1,8821.47,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105008500"; }; class Trees_416 { position[] = {10076.8,8384.18,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105008500"; }; class Trees_417 { position[] = {10906.9,8945.89,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105008500"; }; class Trees_418 { position[] = {10466.3,8004.74,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105008500"; }; class Trees_419 { position[] = {10725.5,8416.15,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105008500"; }; class Trees_420 { position[] = {10817.9,9636.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105009500"; }; class Trees_421 { position[] = {10430,9308.61,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105009500"; }; class Trees_422 { position[] = {10018.8,9007.52,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105009500"; }; class Trees_423 { position[] = {10108.6,9761.21,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105009500"; }; class Trees_424 { position[] = {10934.3,9031.61,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_105009500"; }; class Trees_425 { position[] = {11313.6,533.787,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115000500"; }; class Trees_426 { position[] = {11804.8,27.5816,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115000500"; }; class Trees_427 { position[] = {11004.6,31.4451,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115000500"; }; class Trees_428 { position[] = {11936.3,521.028,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115000500"; }; class Trees_429 { position[] = {11511.9,10020.2,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1150010500"; }; class Trees_430 { position[] = {11003.1,10128.2,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1150010500"; }; class Trees_431 { position[] = {11220.6,10631.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1150010500"; }; class Trees_432 { position[] = {11918.8,10321,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1150010500"; }; class Trees_433 { position[] = {11877,10885.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1150010500"; }; class Trees_434 { position[] = {11362.8,11507,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1150011500"; }; class Trees_435 { position[] = {11890.5,11637.9,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1150011500"; }; class Trees_436 { position[] = {11016.4,11883.8,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1150011500"; }; class Trees_437 { position[] = {11037.1,11094.9,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1150011500"; }; class Trees_438 { position[] = {11875.6,11095.8,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1150011500"; }; class Trees_439 { position[] = {11865,12766.4,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1150012500"; }; class Trees_440 { position[] = {11212.7,12040.2,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1150012500"; }; class Trees_441 { position[] = {11719.6,12007.7,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1150012500"; }; class Trees_442 { position[] = {11389.4,12523.2,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1150012500"; }; class Trees_443 { position[] = {11026.1,1038.02,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115001500"; }; class Trees_444 { position[] = {11871.1,1707.56,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115001500"; }; class Trees_445 { position[] = {11812.8,1047.8,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115001500"; }; class Trees_446 { position[] = {11435.8,1393.72,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115001500"; }; class Trees_447 { position[] = {11093.3,1854.79,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115001500"; }; class Trees_448 { position[] = {11722.6,2035.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115002500"; }; class Trees_449 { position[] = {11063.7,2700.65,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115002500"; }; class Trees_450 { position[] = {11568.2,2819.36,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115002500"; }; class Trees_451 { position[] = {11071.6,2027.35,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115002500"; }; class Trees_452 { position[] = {11888.6,3836.19,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115003500"; }; class Trees_453 { position[] = {11797.8,3007.63,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115003500"; }; class Trees_454 { position[] = {11000.3,3520.01,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115003500"; }; class Trees_455 { position[] = {11534.5,3495.73,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115003500"; }; class Trees_456 { position[] = {11139.1,3001.61,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115003500"; }; class Trees_457 { position[] = {11869.6,4562.46,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115004500"; }; class Trees_458 { position[] = {11319.6,4524.55,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115004500"; }; class Trees_459 { position[] = {11185.9,4032.41,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115004500"; }; class Trees_460 { position[] = {11908.1,4015.83,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115004500"; }; class Trees_461 { position[] = {11830.7,5493.17,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115005500"; }; class Trees_462 { position[] = {11196.4,5045.83,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115005500"; }; class Trees_463 { position[] = {11086.1,5529.51,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115005500"; }; class Trees_464 { position[] = {11582.4,5933.58,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115005500"; }; class Trees_465 { position[] = {11698.3,5052.52,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115005500"; }; class Trees_466 { position[] = {11904.2,6131.88,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115006500"; }; class Trees_467 { position[] = {11492.2,6428.16,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115006500"; }; class Trees_468 { position[] = {11053.6,6795.51,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115006500"; }; class Trees_469 { position[] = {11895.1,6793.2,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115006500"; }; class Trees_470 { position[] = {11179.1,6022.82,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115006500"; }; class Trees_471 { position[] = {11813.4,7016.94,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115007500"; }; class Trees_472 { position[] = {11119.7,7022.51,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115007500"; }; class Trees_473 { position[] = {11029.3,7509.12,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115007500"; }; class Trees_474 { position[] = {11566.2,7482.39,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115007500"; }; class Trees_475 { position[] = {11082.7,8512.46,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115008500"; }; class Trees_476 { position[] = {11825.7,8130.28,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115008500"; }; class Trees_477 { position[] = {11888.5,8645.07,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115008500"; }; class Trees_478 { position[] = {11877.2,9517.26,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115009500"; }; class Trees_479 { position[] = {11385.5,9382.92,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115009500"; }; class Trees_480 { position[] = {11790.8,9020.83,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115009500"; }; class Trees_481 { position[] = {11013.3,9728.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115009500"; }; class Trees_482 { position[] = {11525.7,9894.12,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115009500"; }; class Trees_483 { position[] = {11068.5,9000.72,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_115009500"; }; class Trees_484 { position[] = {12017.6,42.6189,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125000500"; }; class Trees_485 { position[] = {12327.2,490.025,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125000500"; }; class Trees_486 { position[] = {12720.2,819.655,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125000500"; }; class Trees_487 { position[] = {12040.4,915.964,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125000500"; }; class Trees_488 { position[] = {12706.6,10148.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1250010500"; }; class Trees_489 { position[] = {12503.6,10736.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1250010500"; }; class Trees_490 { position[] = {12025.7,10117.7,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1250010500"; }; class Trees_491 { position[] = {12567.5,11203.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1250011500"; }; class Trees_492 { position[] = {12492.2,11745.4,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1250011500"; }; class Trees_493 { position[] = {12005,11530,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1250011500"; }; class Trees_494 { position[] = {12298.6,12022.4,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1250012500"; }; class Trees_495 { position[] = {12125.4,12537,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_1250012500"; }; class Trees_496 { position[] = {12692.7,1833.77,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125001500"; }; class Trees_497 { position[] = {12007.8,1006.74,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125001500"; }; class Trees_498 { position[] = {12527.3,1037.73,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125001500"; }; class Trees_499 { position[] = {12222.7,1521.19,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125001500"; }; class Trees_500 { position[] = {12138.3,2030.71,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125002500"; }; class Trees_501 { position[] = {12672,2070.43,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125002500"; }; class Trees_502 { position[] = {12172.5,3028.91,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125003500"; }; class Trees_503 { position[] = {12438.4,3514.84,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125003500"; }; class Trees_504 { position[] = {12746.1,3095.02,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125003500"; }; class Trees_505 { position[] = {12706.7,3910.72,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125003500"; }; class Trees_506 { position[] = {12428.2,4485.86,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125004500"; }; class Trees_507 { position[] = {12013,4945.22,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125004500"; }; class Trees_508 { position[] = {12663.2,4020.68,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125004500"; }; class Trees_509 { position[] = {12019.8,4122.4,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125004500"; }; class Trees_510 { position[] = {12764.9,4885.34,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125004500"; }; class Trees_511 { position[] = {12076.3,5914.31,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125005500"; }; class Trees_512 { position[] = {12195.9,5010.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125005500"; }; class Trees_513 { position[] = {12579,5522.39,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125005500"; }; class Trees_514 { position[] = {12701.3,5009.94,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125005500"; }; class Trees_515 { position[] = {12007.9,6436.74,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125006500"; }; class Trees_516 { position[] = {12680.2,6080.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125006500"; }; class Trees_517 { position[] = {12179.3,6015.73,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125006500"; }; class Trees_518 { position[] = {12622.3,6644.34,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125006500"; }; class Trees_519 { position[] = {12502.5,7028.94,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125007500"; }; class Trees_520 { position[] = {12675,7542.58,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125007500"; }; class Trees_521 { position[] = {12013.3,7504.63,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125007500"; }; class Trees_522 { position[] = {12000,8491.01,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125008500"; }; class Trees_523 { position[] = {12504.2,8707.98,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125008500"; }; class Trees_524 { position[] = {12280.5,8037.17,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125008500"; }; class Trees_525 { position[] = {12624.4,9012.37,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125009500"; }; class Trees_526 { position[] = {12306.9,9441.59,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125009500"; }; class Trees_527 { position[] = {12782.2,9603.14,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125009500"; }; class Trees_528 { position[] = {12001.8,9047.05,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_125009500"; }; class Trees_529 { position[] = {1075.26,490.485,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15000500"; }; class Trees_530 { position[] = {1589.65,543.597,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15000500"; }; class Trees_531 { position[] = {1707.98,27.8437,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15000500"; }; class Trees_532 { position[] = {1189.43,14.7653,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15000500"; }; class Trees_533 { position[] = {1062.99,10925.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_150010500"; }; class Trees_534 { position[] = {1701.96,10019.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_150010500"; }; class Trees_535 { position[] = {1015.35,10012.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_150010500"; }; class Trees_536 { position[] = {1809.81,12165.8,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_150012500"; }; class Trees_537 { position[] = {1006.07,12547.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_150012500"; }; class Trees_538 { position[] = {1814.08,12728.4,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_150012500"; }; class Trees_539 { position[] = {1288.07,12041.7,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_150012500"; }; class Trees_540 { position[] = {1013.88,1015.26,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15001500"; }; class Trees_541 { position[] = {1774.18,1520.53,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15001500"; }; class Trees_542 { position[] = {1460.8,1921.48,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15001500"; }; class Trees_543 { position[] = {1126.24,1540.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15001500"; }; class Trees_544 { position[] = {1704.27,1006.47,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15001500"; }; class Trees_545 { position[] = {1025.82,2491.81,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15002500"; }; class Trees_546 { position[] = {1718.11,2101.2,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15002500"; }; class Trees_547 { position[] = {1201.54,2001.23,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15002500"; }; class Trees_548 { position[] = {1698.63,2605.24,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15002500"; }; class Trees_549 { position[] = {1081.87,3820.46,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15003500"; }; class Trees_550 { position[] = {1889.81,3045.55,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15003500"; }; class Trees_551 { position[] = {1311.51,3008.18,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15003500"; }; class Trees_552 { position[] = {1901.26,3631.58,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15003500"; }; class Trees_553 { position[] = {1078.19,4540.82,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15004500"; }; class Trees_554 { position[] = {1491.67,4864.07,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15004500"; }; class Trees_555 { position[] = {1571.1,4069.88,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15004500"; }; class Trees_556 { position[] = {1833.38,4510.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15004500"; }; class Trees_557 { position[] = {1840.86,5006.48,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15005500"; }; class Trees_558 { position[] = {1392.05,5539.03,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15005500"; }; class Trees_559 { position[] = {1161.72,5001.66,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15005500"; }; class Trees_560 { position[] = {1890.99,5899.86,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15005500"; }; class Trees_561 { position[] = {1011.08,6585.71,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15006500"; }; class Trees_562 { position[] = {1029.37,6023.21,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15006500"; }; class Trees_563 { position[] = {1909.49,6541.71,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15006500"; }; class Trees_564 { position[] = {1728.51,6010.34,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15006500"; }; class Trees_565 { position[] = {1791.71,8787.64,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15008500"; }; class Trees_566 { position[] = {1109.54,8001.67,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15008500"; }; class Trees_567 { position[] = {1288.83,8942.35,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15008500"; }; class Trees_568 { position[] = {1474.55,8427.09,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15008500"; }; class Trees_569 { position[] = {1831.14,8024.89,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15008500"; }; class Trees_570 { position[] = {1609.74,9033.21,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15009500"; }; class Trees_571 { position[] = {1688.09,9533.49,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15009500"; }; class Trees_572 { position[] = {1007.97,9816.69,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15009500"; }; class Trees_573 { position[] = {1019.96,9236.51,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_15009500"; }; class Trees_574 { position[] = {2662.18,575.651,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25000500"; }; class Trees_575 { position[] = {2103.94,565.209,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25000500"; }; class Trees_576 { position[] = {2799.5,10641.9,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_250010500"; }; class Trees_577 { position[] = {2051.17,10001.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_250010500"; }; class Trees_578 { position[] = {2577.81,11536.9,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_250011500"; }; class Trees_579 { position[] = {2773.22,11022.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_250011500"; }; class Trees_580 { position[] = {2410.61,12031.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_250012500"; }; class Trees_581 { position[] = {2825.22,1093.97,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25001500"; }; class Trees_582 { position[] = {2090.39,1031.82,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25001500"; }; class Trees_583 { position[] = {2892.24,1702.42,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25001500"; }; class Trees_584 { position[] = {2042.75,1700.21,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25001500"; }; class Trees_585 { position[] = {2097.13,2020.87,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25002500"; }; class Trees_586 { position[] = {2615.6,2939.53,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25002500"; }; class Trees_587 { position[] = {2826.52,2430.23,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25002500"; }; class Trees_588 { position[] = {2248.3,2494.45,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25002500"; }; class Trees_589 { position[] = {2889.53,3891.31,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25003500"; }; class Trees_590 { position[] = {2098.03,3332.52,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25003500"; }; class Trees_591 { position[] = {2287.12,3809.79,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25003500"; }; class Trees_592 { position[] = {2494.71,3030.41,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25003500"; }; class Trees_593 { position[] = {2061.01,4027.04,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25004500"; }; class Trees_594 { position[] = {2399.53,4544.33,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25004500"; }; class Trees_595 { position[] = {2606.17,4054.43,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25004500"; }; class Trees_596 { position[] = {2894.31,4705.31,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25004500"; }; class Trees_597 { position[] = {2027.01,4922.79,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25004500"; }; class Trees_598 { position[] = {2025.78,5186.32,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25005500"; }; class Trees_599 { position[] = {2421.9,5542.57,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25005500"; }; class Trees_600 { position[] = {2876.76,5161.81,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25005500"; }; class Trees_601 { position[] = {2044.92,5883.59,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25005500"; }; class Trees_602 { position[] = {2072.27,6089.96,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25006500"; }; class Trees_603 { position[] = {2001.71,6598.07,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25006500"; }; class Trees_604 { position[] = {2583.54,6117.66,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25006500"; }; class Trees_605 { position[] = {2593.43,6622.95,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25006500"; }; class Trees_606 { position[] = {2925.64,7582.78,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25007500"; }; class Trees_607 { position[] = {2174.83,7023.58,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25007500"; }; class Trees_608 { position[] = {2726.46,7110.99,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25007500"; }; class Trees_609 { position[] = {2245.14,7897.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25007500"; }; class Trees_610 { position[] = {2782.99,8136.84,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25008500"; }; class Trees_611 { position[] = {2321.91,8474.8,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25008500"; }; class Trees_612 { position[] = {2829.31,8718.78,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25008500"; }; class Trees_613 { position[] = {2155.98,8009.48,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25008500"; }; class Trees_614 { position[] = {2078.4,9116.11,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25009500"; }; class Trees_615 { position[] = {2922.85,9421.32,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25009500"; }; class Trees_616 { position[] = {2268.6,9626.9,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25009500"; }; class Trees_617 { position[] = {2571.87,9031.22,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_25009500"; }; class Trees_618 { position[] = {3295.23,5.1527,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35000500"; }; class Trees_619 { position[] = {3922.68,9.74127,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35000500"; }; class Trees_620 { position[] = {3815.26,613.243,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35000500"; }; class Trees_621 { position[] = {3620.63,10540.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_350010500"; }; class Trees_622 { position[] = {3134.08,10680,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_350010500"; }; class Trees_623 { position[] = {3120.27,10167.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_350010500"; }; class Trees_624 { position[] = {3057.42,11076.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_350011500"; }; class Trees_625 { position[] = {3738.6,11304.8,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_350011500"; }; class Trees_626 { position[] = {3019.36,12507.4,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_350012500"; }; class Trees_627 { position[] = {3083.73,12002.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_350012500"; }; class Trees_628 { position[] = {3077.07,1036.18,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35001500"; }; class Trees_629 { position[] = {3320.05,1514.44,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35001500"; }; class Trees_630 { position[] = {3926.83,1638.19,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35001500"; }; class Trees_631 { position[] = {3768.23,1083.91,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35001500"; }; class Trees_632 { position[] = {3794.84,2048.69,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35002500"; }; class Trees_633 { position[] = {3257.88,2005.04,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35002500"; }; class Trees_634 { position[] = {3080.75,2744,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35002500"; }; class Trees_635 { position[] = {3507.14,2433.47,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35002500"; }; class Trees_636 { position[] = {3811.65,2830.11,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35002500"; }; class Trees_637 { position[] = {3753.58,3106.23,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35003500"; }; class Trees_638 { position[] = {3738.34,3619.14,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35003500"; }; class Trees_639 { position[] = {3275.3,3007.03,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35003500"; }; class Trees_640 { position[] = {3719.07,4017.46,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35004500"; }; class Trees_641 { position[] = {3339.56,4491.47,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35004500"; }; class Trees_642 { position[] = {3012.58,4930.56,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35004500"; }; class Trees_643 { position[] = {3681.05,5029.64,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35005500"; }; class Trees_644 { position[] = {3002.4,5647.71,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35005500"; }; class Trees_645 { position[] = {3485.97,5794.74,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35005500"; }; class Trees_646 { position[] = {3003.65,6604.58,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35006500"; }; class Trees_647 { position[] = {3069.14,6114.73,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35006500"; }; class Trees_648 { position[] = {3489,6508.4,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35006500"; }; class Trees_649 { position[] = {3718.97,6003.55,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35006500"; }; class Trees_650 { position[] = {3795.63,6882.07,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35006500"; }; class Trees_651 { position[] = {3720.8,7892.45,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35007500"; }; class Trees_652 { position[] = {3530.39,7007.16,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35007500"; }; class Trees_653 { position[] = {3896.4,7374.36,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35007500"; }; class Trees_654 { position[] = {3742.62,8096.87,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35008500"; }; class Trees_655 { position[] = {3013.29,8341.27,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35008500"; }; class Trees_656 { position[] = {3423.49,8715.33,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35008500"; }; class Trees_657 { position[] = {3010.16,9614.63,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35009500"; }; class Trees_658 { position[] = {3587.45,9078.91,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35009500"; }; class Trees_659 { position[] = {3664.2,9579.94,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35009500"; }; class Trees_660 { position[] = {3005.45,9012.67,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_35009500"; }; class Trees_661 { position[] = {4041.77,700.585,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45000500"; }; class Trees_662 { position[] = {4117.5,12.453,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45000500"; }; class Trees_663 { position[] = {4940.19,603.359,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45000500"; }; class Trees_664 { position[] = {4442.76,10691.2,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_450010500"; }; class Trees_665 { position[] = {4103.11,10042.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_450010500"; }; class Trees_666 { position[] = {4676.12,10169.8,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_450010500"; }; class Trees_667 { position[] = {4506.56,11528.7,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_450011500"; }; class Trees_668 { position[] = {4890.45,11136.7,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_450011500"; }; class Trees_669 { position[] = {4900.53,11853.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_450011500"; }; class Trees_670 { position[] = {4001.03,12087.2,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_450012500"; }; class Trees_671 { position[] = {4937.68,12671.9,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_450012500"; }; class Trees_672 { position[] = {4803.14,12104.2,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_450012500"; }; class Trees_673 { position[] = {4461.19,1497.93,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45001500"; }; class Trees_674 { position[] = {4687.45,1012.81,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45001500"; }; class Trees_675 { position[] = {4019.21,1177.61,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45001500"; }; class Trees_676 { position[] = {4871.19,1830.44,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45001500"; }; class Trees_677 { position[] = {4585.22,2028.59,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45002500"; }; class Trees_678 { position[] = {4817.31,2525.36,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45002500"; }; class Trees_679 { position[] = {4073.46,2001.45,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45002500"; }; class Trees_680 { position[] = {4495.22,3434.35,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45003500"; }; class Trees_681 { position[] = {4014.01,3742.84,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45003500"; }; class Trees_682 { position[] = {4870.33,3028.43,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45003500"; }; class Trees_683 { position[] = {4181.65,3020.22,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45003500"; }; class Trees_684 { position[] = {4905.86,3842.22,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45003500"; }; class Trees_685 { position[] = {4134.57,4010.94,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45004500"; }; class Trees_686 { position[] = {4491.5,4938.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45004500"; }; class Trees_687 { position[] = {4827.19,4011.24,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45004500"; }; class Trees_688 { position[] = {4411.52,5403.39,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45005500"; }; class Trees_689 { position[] = {4834.7,5018.25,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45005500"; }; class Trees_690 { position[] = {4007.34,5000.52,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45005500"; }; class Trees_691 { position[] = {4888.79,5714.16,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45005500"; }; class Trees_692 { position[] = {4326.7,6026.24,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45006500"; }; class Trees_693 { position[] = {4070.52,6481.75,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45006500"; }; class Trees_694 { position[] = {4862.9,6421.56,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45006500"; }; class Trees_695 { position[] = {4342.84,7009.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45007500"; }; class Trees_696 { position[] = {4625.26,7715.21,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45007500"; }; class Trees_697 { position[] = {4772.64,8110.07,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45008500"; }; class Trees_698 { position[] = {4080.88,8531.83,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45008500"; }; class Trees_699 { position[] = {4715.09,8606.55,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45008500"; }; class Trees_700 { position[] = {4118.35,9042.16,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45009500"; }; class Trees_701 { position[] = {4651.28,9796.86,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45009500"; }; class Trees_702 { position[] = {4031.23,9624.54,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45009500"; }; class Trees_703 { position[] = {4870.57,9301.42,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_45009500"; }; class Trees_704 { position[] = {5028.29,8.93998,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55000500"; }; class Trees_705 { position[] = {5139.81,673.242,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55000500"; }; class Trees_706 { position[] = {5740.02,511.573,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55000500"; }; class Trees_707 { position[] = {5612.16,20.6361,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55000500"; }; class Trees_708 { position[] = {5620.53,10187.8,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_550010500"; }; class Trees_709 { position[] = {5206.82,10741.8,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_550010500"; }; class Trees_710 { position[] = {5020.09,10093.8,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_550010500"; }; class Trees_711 { position[] = {5026.01,11025.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_550011500"; }; class Trees_712 { position[] = {5281.51,11457.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_550011500"; }; class Trees_713 { position[] = {5011.38,12544,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_550012500"; }; class Trees_714 { position[] = {5767.28,12000.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_550012500"; }; class Trees_715 { position[] = {5337.26,1032.02,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55001500"; }; class Trees_716 { position[] = {5084.89,1587.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55001500"; }; class Trees_717 { position[] = {5585.54,1612.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55001500"; }; class Trees_718 { position[] = {5094.45,2218.57,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55002500"; }; class Trees_719 { position[] = {5178.65,2693.8,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55002500"; }; class Trees_720 { position[] = {5706.7,2912.08,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55002500"; }; class Trees_721 { position[] = {5912.78,2435.61,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55002500"; }; class Trees_722 { position[] = {5731.13,3022.69,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55003500"; }; class Trees_723 { position[] = {5155.8,3009.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55003500"; }; class Trees_724 { position[] = {5729.74,3623.06,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55003500"; }; class Trees_725 { position[] = {5069.94,3499.96,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55003500"; }; class Trees_726 { position[] = {5696.64,4003.72,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55004500"; }; class Trees_727 { position[] = {5690.02,4600.32,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55004500"; }; class Trees_728 { position[] = {5569.38,5692.69,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55005500"; }; class Trees_729 { position[] = {5703.67,5027.91,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55005500"; }; class Trees_730 { position[] = {5366.15,6702.41,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55006500"; }; class Trees_731 { position[] = {5518.23,6019.83,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55006500"; }; class Trees_732 { position[] = {5006.25,6309.94,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55006500"; }; class Trees_733 { position[] = {5307.53,7545.74,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55007500"; }; class Trees_734 { position[] = {5675.56,7131.64,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55007500"; }; class Trees_735 { position[] = {5031.44,7099.02,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55007500"; }; class Trees_736 { position[] = {5873.02,7638.7,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55007500"; }; class Trees_737 { position[] = {5209.88,8491.93,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55008500"; }; class Trees_738 { position[] = {5935.56,8483.05,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55008500"; }; class Trees_739 { position[] = {5563.41,8014.4,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55008500"; }; class Trees_740 { position[] = {5025.37,8028.86,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55008500"; }; class Trees_741 { position[] = {5039.62,9087.74,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55009500"; }; class Trees_742 { position[] = {5311.96,9607.26,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55009500"; }; class Trees_743 { position[] = {5794.85,9220.66,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_55009500"; }; class Trees_744 { position[] = {6610.97,502.212,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65000500"; }; class Trees_745 { position[] = {6005,577.202,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65000500"; }; class Trees_746 { position[] = {6528.05,9.3818,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65000500"; }; class Trees_747 { position[] = {6019.17,59.8718,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65000500"; }; class Trees_748 { position[] = {6587.01,10537.9,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_650010500"; }; class Trees_749 { position[] = {6876.59,10002.7,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_650010500"; }; class Trees_750 { position[] = {6330.67,10009.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_650010500"; }; class Trees_751 { position[] = {6481.72,11027.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_650011500"; }; class Trees_752 { position[] = {6540,11581.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_650011500"; }; class Trees_753 { position[] = {6497.33,12256,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_650012500"; }; class Trees_754 { position[] = {6898.74,12615.8,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_650012500"; }; class Trees_755 { position[] = {6044.86,12010.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_650012500"; }; class Trees_756 { position[] = {6948.2,12008.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_650012500"; }; class Trees_757 { position[] = {6024.26,1364.91,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65001500"; }; class Trees_758 { position[] = {6480.17,1731.45,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65001500"; }; class Trees_759 { position[] = {6874.07,1263.63,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65001500"; }; class Trees_760 { position[] = {6396.83,1002.94,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65001500"; }; class Trees_761 { position[] = {6502.78,2874.15,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65002500"; }; class Trees_762 { position[] = {6004.38,2675.51,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65002500"; }; class Trees_763 { position[] = {6113.02,2100.58,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65002500"; }; class Trees_764 { position[] = {6832.24,2021.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65002500"; }; class Trees_765 { position[] = {6934.75,2519.48,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65002500"; }; class Trees_766 { position[] = {6125.13,3727.08,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65003500"; }; class Trees_767 { position[] = {6930.3,3699.76,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65003500"; }; class Trees_768 { position[] = {6529.12,3333.54,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65003500"; }; class Trees_769 { position[] = {6900.5,3004.4,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65003500"; }; class Trees_770 { position[] = {6037.01,3098.58,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65003500"; }; class Trees_771 { position[] = {6829.95,4399,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65004500"; }; class Trees_772 { position[] = {6073.9,4437.32,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65004500"; }; class Trees_773 { position[] = {6512.34,4837.91,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65004500"; }; class Trees_774 { position[] = {6485.28,4017.76,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65004500"; }; class Trees_775 { position[] = {6920.73,5631.39,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65005500"; }; class Trees_776 { position[] = {6298.75,5371.41,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65005500"; }; class Trees_777 { position[] = {6529.65,6412.06,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65006500"; }; class Trees_778 { position[] = {6536.43,6922.03,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65006500"; }; class Trees_779 { position[] = {6122.51,6029.95,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65006500"; }; class Trees_780 { position[] = {6000.67,6648.15,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65006500"; }; class Trees_781 { position[] = {6107.41,7619.79,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65007500"; }; class Trees_782 { position[] = {6625.19,7601.35,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65007500"; }; class Trees_783 { position[] = {6312.65,7037.24,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65007500"; }; class Trees_784 { position[] = {6914,7038.64,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65007500"; }; class Trees_785 { position[] = {6930.06,8096.63,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65008500"; }; class Trees_786 { position[] = {6314.16,8725.24,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65008500"; }; class Trees_787 { position[] = {6423.54,8011.76,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65008500"; }; class Trees_788 { position[] = {6002.75,8315.56,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65008500"; }; class Trees_789 { position[] = {6882.2,8643.8,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65008500"; }; class Trees_790 { position[] = {6721.96,9031.92,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_65009500"; }; class Trees_791 { position[] = {7025.27,121.732,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75000500"; }; class Trees_792 { position[] = {7460.36,690.154,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75000500"; }; class Trees_793 { position[] = {7533.02,8.99648,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75000500"; }; class Trees_794 { position[] = {7860.24,380.78,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75000500"; }; class Trees_795 { position[] = {7598.99,10660.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_750010500"; }; class Trees_796 { position[] = {7300.56,10002.9,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_750010500"; }; class Trees_797 { position[] = {7836.68,10178.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_750010500"; }; class Trees_798 { position[] = {7103.19,10544.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_750010500"; }; class Trees_799 { position[] = {7615.12,11401.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_750011500"; }; class Trees_800 { position[] = {7302.11,11021,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_750011500"; }; class Trees_801 { position[] = {7141.32,11708.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_750011500"; }; class Trees_802 { position[] = {7713.03,11942.2,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_750011500"; }; class Trees_803 { position[] = {7825.03,12105.9,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_750012500"; }; class Trees_804 { position[] = {7696.14,12651.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_750012500"; }; class Trees_805 { position[] = {7190.87,12522.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_750012500"; }; class Trees_806 { position[] = {7162.93,12023.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_750012500"; }; class Trees_807 { position[] = {7898.28,1514.45,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75001500"; }; class Trees_808 { position[] = {7511.07,1106.93,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75001500"; }; class Trees_809 { position[] = {7089.11,1477.53,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75001500"; }; class Trees_810 { position[] = {7909.34,2248.36,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75002500"; }; class Trees_811 { position[] = {7112,2596.98,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75002500"; }; class Trees_812 { position[] = {7659.23,2705.96,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75002500"; }; class Trees_813 { position[] = {7299.18,2074.87,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75002500"; }; class Trees_814 { position[] = {7004.04,3656.43,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75003500"; }; class Trees_815 { position[] = {7118.25,3129.86,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75003500"; }; class Trees_816 { position[] = {7528.79,3810.66,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75003500"; }; class Trees_817 { position[] = {7604.33,3300.48,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75003500"; }; class Trees_818 { position[] = {7710.1,4147.05,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75004500"; }; class Trees_819 { position[] = {7883.03,4637.29,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75004500"; }; class Trees_820 { position[] = {7163.84,4011.84,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75004500"; }; class Trees_821 { position[] = {7905.2,5738.09,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75005500"; }; class Trees_822 { position[] = {7012.8,5619.62,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75005500"; }; class Trees_823 { position[] = {7712.85,5234.36,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75005500"; }; class Trees_824 { position[] = {7199.66,5055.97,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75005500"; }; class Trees_825 { position[] = {7426.68,5911.89,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75005500"; }; class Trees_826 { position[] = {7754.21,6707.25,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75006500"; }; class Trees_827 { position[] = {7839.76,6120.68,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75006500"; }; class Trees_828 { position[] = {7221.52,6012.24,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75006500"; }; class Trees_829 { position[] = {7015.44,6893.41,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75006500"; }; class Trees_830 { position[] = {7901.24,7292.69,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75007500"; }; class Trees_831 { position[] = {7092.87,7520.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75007500"; }; class Trees_832 { position[] = {7415.72,7032.34,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75007500"; }; class Trees_833 { position[] = {7105.85,8037.27,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75008500"; }; class Trees_834 { position[] = {7326.92,8734.21,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75008500"; }; class Trees_835 { position[] = {7885.11,8729.75,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75008500"; }; class Trees_836 { position[] = {7728.14,8216.72,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75008500"; }; class Trees_837 { position[] = {7545.36,9002.16,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75009500"; }; class Trees_838 { position[] = {7021.82,9589.55,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75009500"; }; class Trees_839 { position[] = {7495.67,9783.36,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_75009500"; }; class Trees_840 { position[] = {8002.31,813.153,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85000500"; }; class Trees_841 { position[] = {8527.3,502.733,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85000500"; }; class Trees_842 { position[] = {8166.09,35.2871,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85000500"; }; class Trees_843 { position[] = {8882.24,45.802,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85000500"; }; class Trees_844 { position[] = {8904.5,10484.8,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_850010500"; }; class Trees_845 { position[] = {8343.08,10024,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_850010500"; }; class Trees_846 { position[] = {8060.3,10518.7,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_850010500"; }; class Trees_847 { position[] = {8086.77,11888,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_850011500"; }; class Trees_848 { position[] = {8263.04,11371.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_850011500"; }; class Trees_849 { position[] = {8841.97,11595.2,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_850011500"; }; class Trees_850 { position[] = {8789.83,11037.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_850011500"; }; class Trees_851 { position[] = {8233.98,12029.7,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_850012500"; }; class Trees_852 { position[] = {8771.51,12120.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_850012500"; }; class Trees_853 { position[] = {8330.24,1497.28,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85001500"; }; class Trees_854 { position[] = {8709.35,1043.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85001500"; }; class Trees_855 { position[] = {8016,1101.41,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85001500"; }; class Trees_856 { position[] = {8557.59,2791.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85002500"; }; class Trees_857 { position[] = {8094.73,2589.26,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85002500"; }; class Trees_858 { position[] = {8920.2,2422.69,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85002500"; }; class Trees_859 { position[] = {8486.39,2139.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85002500"; }; class Trees_860 { position[] = {8322.38,3004.98,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85003500"; }; class Trees_861 { position[] = {8082.41,3445.52,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85003500"; }; class Trees_862 { position[] = {8807.15,3301.82,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85003500"; }; class Trees_863 { position[] = {8666.66,4217.87,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85004500"; }; class Trees_864 { position[] = {8908.73,4737.09,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85004500"; }; class Trees_865 { position[] = {8098.54,4641.17,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85004500"; }; class Trees_866 { position[] = {8127.3,4113.59,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85004500"; }; class Trees_867 { position[] = {8099.72,5642.05,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85005500"; }; class Trees_868 { position[] = {8791.67,5495.25,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85005500"; }; class Trees_869 { position[] = {8339.26,5015.32,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85005500"; }; class Trees_870 { position[] = {8637.34,6600.19,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85006500"; }; class Trees_871 { position[] = {8801.1,6018.49,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85006500"; }; class Trees_872 { position[] = {8111.63,6511.35,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85006500"; }; class Trees_873 { position[] = {8082.27,6014.53,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85006500"; }; class Trees_874 { position[] = {8599.51,7785.29,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85007500"; }; class Trees_875 { position[] = {8113.09,7464.52,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85007500"; }; class Trees_876 { position[] = {8934.06,7309.67,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85007500"; }; class Trees_877 { position[] = {8366.29,7016.94,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85007500"; }; class Trees_878 { position[] = {8613.67,8113.01,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85008500"; }; class Trees_879 { position[] = {8029.56,8033.5,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85008500"; }; class Trees_880 { position[] = {8597.55,8717.04,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85008500"; }; class Trees_881 { position[] = {8189.54,9002.31,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85009500"; }; class Trees_882 { position[] = {8824.14,9537.22,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_85009500"; }; class Trees_883 { position[] = {9319.41,1.93962,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95000500"; }; class Trees_884 { position[] = {9084.68,504.843,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95000500"; }; class Trees_885 { position[] = {9603.34,628.406,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95000500"; }; class Trees_886 { position[] = {9901.55,127.186,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95000500"; }; class Trees_887 { position[] = {9894.29,10522.1,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_950010500"; }; class Trees_888 { position[] = {9684.91,10028.9,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_950010500"; }; class Trees_889 { position[] = {9185.29,10257.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_950010500"; }; class Trees_890 { position[] = {9081.64,10763,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_950010500"; }; class Trees_891 { position[] = {9103.85,11512.9,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_950011500"; }; class Trees_892 { position[] = {9232,11017.2,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_950011500"; }; class Trees_893 { position[] = {9906.87,11715.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_950011500"; }; class Trees_894 { position[] = {9910.03,11174.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_950011500"; }; class Trees_895 { position[] = {9013.01,12147.4,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_950012500"; }; class Trees_896 { position[] = {9595.76,12099.6,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_950012500"; }; class Trees_897 { position[] = {9091.86,12694.9,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_950012500"; }; class Trees_898 { position[] = {9529.51,1718.4,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95001500"; }; class Trees_899 { position[] = {9020.02,1017.86,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95001500"; }; class Trees_900 { position[] = {9940.5,1304.25,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95001500"; }; class Trees_901 { position[] = {9516.75,1042.67,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95001500"; }; class Trees_902 { position[] = {9037.42,1513.26,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95001500"; }; class Trees_903 { position[] = {9568.66,2030.3,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95002500"; }; class Trees_904 { position[] = {9056.13,2422.89,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95002500"; }; class Trees_905 { position[] = {9898.07,3793.99,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95003500"; }; class Trees_906 { position[] = {9264.64,3007.57,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95003500"; }; class Trees_907 { position[] = {9086.33,3789.42,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95003500"; }; class Trees_908 { position[] = {9527.22,3427.03,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95003500"; }; class Trees_909 { position[] = {9866.23,3023.78,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95003500"; }; class Trees_910 { position[] = {9021.24,4028.12,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95004500"; }; class Trees_911 { position[] = {9432.13,4516.49,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95004500"; }; class Trees_912 { position[] = {9692.96,4079.81,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95004500"; }; class Trees_913 { position[] = {9007.18,4885.7,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95004500"; }; class Trees_914 { position[] = {9891.31,4818.34,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95004500"; }; class Trees_915 { position[] = {9307.62,5041.73,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95005500"; }; class Trees_916 { position[] = {9476.65,5539.09,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95005500"; }; class Trees_917 { position[] = {9911.41,5144.53,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95005500"; }; class Trees_918 { position[] = {9926.34,6119.72,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95006500"; }; class Trees_919 { position[] = {9428.71,6039.96,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95006500"; }; class Trees_920 { position[] = {9927.34,7007.78,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95007500"; }; class Trees_921 { position[] = {9786.44,7916.08,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95007500"; }; class Trees_922 { position[] = {9637.96,7416.98,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95007500"; }; class Trees_923 { position[] = {9041.62,8008.79,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95008500"; }; class Trees_924 { position[] = {9619.36,8076.69,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95008500"; }; class Trees_925 { position[] = {9364.56,8609.74,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95008500"; }; class Trees_926 { position[] = {9841.26,8805.48,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95008500"; }; class Trees_927 { position[] = {9171.69,9033.33,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95009500"; }; class Trees_928 { position[] = {9909,9127.32,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95009500"; }; class Trees_929 { position[] = {9397.68,9521.54,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95009500"; }; class Trees_930 { position[] = {9899.28,9641.48,0}; orientation[] = {20,20,0}; type = "Trees"; sector = "sector_95009500"; }; class Village_931 { position[] = {9329.79,1767.83}; orientation[] = {50,50}; type = "Village"; sector = "sector_95001500"; buildings = 3; }; class Village_932 { position[] = {4674.14,12428.8}; orientation[] = {125.274,231.613}; type = "Village"; sector = "sector_450012500"; buildings = 3; }; class Village_933 { position[] = {5863.38,1580.33}; orientation[] = {226.677,50}; type = "Village"; sector = "sector_55001500"; buildings = 3; }; class Village_934 { position[] = {12492.1,10125.7}; orientation[] = {56.8573,58.401}; type = "Village"; sector = "sector_1250010500"; buildings = 3; }; class Village_935 { position[] = {6106.12,10532.8}; orientation[] = {188.198,68.6641}; type = "Village"; sector = "sector_650010500"; buildings = 3; }; class Village_936 { position[] = {6688.24,7420.75}; orientation[] = {50,83.5157}; type = "Village"; sector = "sector_65007500"; buildings = 3; }; class Village_937 { position[] = {12599.2,9827.21}; orientation[] = {50,50}; type = "Village"; sector = "sector_125009500"; buildings = 3; }; class Village_938 { position[] = {8573.12,3026.71}; orientation[] = {72.4109,110.635}; type = "Village"; sector = "sector_85003500"; buildings = 3; }; class Village_939 { position[] = {3962.94,9343.18}; orientation[] = {53.6911,52.4777}; type = "Village"; sector = "sector_35009500"; buildings = 3; }; class Village_940 { position[] = {7272.13,368.26}; orientation[] = {50,50}; type = "Village"; sector = "sector_75000500"; buildings = 3; }; class Village_941 { position[] = {6014.72,6909.2}; orientation[] = {50,100.413}; type = "Village"; sector = "sector_65006500"; buildings = 3; }; class Village_942 { position[] = {10409.6,10899.7}; orientation[] = {169.71,58.5127}; type = "Village"; sector = "sector_1050010500"; buildings = 3; }; class Village_943 { position[] = {5978.58,10384.5}; orientation[] = {50.6537,50}; type = "Village"; sector = "sector_550010500"; buildings = 3; }; class Village_944 { position[] = {10329.8,10830.9}; orientation[] = {50,54.4221}; type = "Village"; sector = "sector_1050010500"; buildings = 3; }; class Village_945 { position[] = {833.148,10507.4}; orientation[] = {50,102.048}; type = "Village"; sector = "sector_050010500"; buildings = 3; }; class Village_946 { position[] = {5953.09,10399.3}; orientation[] = {50,50}; type = "Village"; sector = "sector_550010500"; buildings = 3; }; class Village_947 { position[] = {6540.44,1154.2}; orientation[] = {50,50}; type = "Village"; sector = "sector_65001500"; buildings = 3; }; class Village_948 { position[] = {5747.03,9999.27}; orientation[] = {213.62,127.036}; type = "Village"; sector = "sector_55009500"; buildings = 3; }; class Village_949 { position[] = {8014.81,2956.72}; orientation[] = {64.0836,50}; type = "Village"; sector = "sector_85002500"; buildings = 3; }; class Village_950 { position[] = {8698.08,1824.64}; orientation[] = {50,50}; type = "Village"; sector = "sector_85001500"; buildings = 3; }; class Village_951 { position[] = {7218.43,11385.5}; orientation[] = {74.8827,50}; type = "Village"; sector = "sector_750011500"; buildings = 3; }; class Village_952 { position[] = {7192.4,1272.65}; orientation[] = {50,50}; type = "Village"; sector = "sector_75001500"; buildings = 3; }; class Village_953 { position[] = {10595.3,10859.8}; orientation[] = {92.8222,153.988}; type = "Village"; sector = "sector_1050010500"; buildings = 3; }; class Village_954 { position[] = {9185.1,6288}; orientation[] = {50,52.0464}; type = "Village"; sector = "sector_95006500"; buildings = 3; }; class Village_955 { position[] = {6634.11,5654.88}; orientation[] = {50,50}; type = "Village"; sector = "sector_65005500"; buildings = 4; }; class Village_956 { position[] = {8126.67,2999.16}; orientation[] = {305.287,266.895}; type = "Village"; sector = "sector_85002500"; buildings = 4; }; class Village_957 { position[] = {1171.36,3311.86}; orientation[] = {294.259,139.749}; type = "Village"; sector = "sector_15003500"; buildings = 4; }; class Village_958 { position[] = {7637.04,8029.52}; orientation[] = {188.875,219.661}; type = "Village"; sector = "sector_75008500"; buildings = 4; }; class Village_959 { position[] = {6282.29,10762.4}; orientation[] = {50,50}; type = "Village"; sector = "sector_650010500"; buildings = 4; }; class Village_960 { position[] = {11389.4,12310.1}; orientation[] = {57.7274,90.7812}; type = "Village"; sector = "sector_1150012500"; buildings = 4; }; class Village_961 { position[] = {10416.9,10973.7}; orientation[] = {158.944,122.169}; type = "Village"; sector = "sector_1050010500"; buildings = 4; }; class Village_962 { position[] = {3506.8,8158.13}; orientation[] = {217.31,134.58}; type = "Village"; sector = "sector_35008500"; buildings = 4; }; class Village_963 { position[] = {6841.15,7105.39}; orientation[] = {50,234.015}; type = "Village"; sector = "sector_65007500"; buildings = 4; }; class Village_964 { position[] = {9906.72,8660.62}; orientation[] = {50,50}; type = "Village"; sector = "sector_95008500"; buildings = 4; }; class Village_965 { position[] = {9557.56,11659.2}; orientation[] = {67.7542,85.8838}; type = "Village"; sector = "sector_950011500"; buildings = 4; }; class Village_966 { position[] = {8997.81,2631.84}; orientation[] = {67.7574,61.6816}; type = "Village"; sector = "sector_85002500"; buildings = 4; }; class Village_967 { position[] = {7839.23,3698.08}; orientation[] = {50,50}; type = "Village"; sector = "sector_75003500"; buildings = 4; }; class Village_968 { position[] = {8678.47,1423.33}; orientation[] = {50,58.3929}; type = "Village"; sector = "sector_85001500"; buildings = 4; }; class Village_969 { position[] = {3773.03,10304.9}; orientation[] = {227.265,144.589}; type = "Village"; sector = "sector_350010500"; buildings = 4; }; class Village_970 { position[] = {1562.3,11653}; orientation[] = {50,50}; type = "Village"; sector = "sector_150011500"; buildings = 4; }; class Village_971 { position[] = {3243.29,8168.21}; orientation[] = {106.587,111.309}; type = "Village"; sector = "sector_35008500"; buildings = 4; }; class Village_972 { position[] = {5634.68,9460.96}; orientation[] = {95.3901,154.799}; type = "Village"; sector = "sector_55009500"; buildings = 4; }; class Village_973 { position[] = {10285.9,10694.5}; orientation[] = {204.696,116.989}; type = "Village"; sector = "sector_1050010500"; buildings = 4; }; class Village_974 { position[] = {3024.74,5436.74}; orientation[] = {103.915,50}; type = "Village"; sector = "sector_35005500"; buildings = 5; }; class Village_975 { position[] = {10005.2,6438.97}; orientation[] = {86.4112,93.8771}; type = "Village"; sector = "sector_105006500"; buildings = 5; }; class Village_976 { position[] = {6618.06,10784.5}; orientation[] = {183.003,193.73}; type = "Village"; sector = "sector_650010500"; buildings = 5; }; class Village_977 { position[] = {9894.89,4351.98}; orientation[] = {58.2441,90.8096}; type = "Village"; sector = "sector_95004500"; buildings = 5; }; class Village_978 { position[] = {12029.3,11342.4}; orientation[] = {125.948,72.035}; type = "Village"; sector = "sector_1250011500"; buildings = 5; }; class Village_979 { position[] = {7994.19,2986.25}; orientation[] = {76.5472,50}; type = "Village"; sector = "sector_75002500"; buildings = 5; }; class Village_980 { position[] = {10718.4,10688.3}; orientation[] = {50,126.595}; type = "Village"; sector = "sector_1050010500"; buildings = 6; }; class Village_981 { position[] = {1852.35,3875.19}; orientation[] = {75.3546,86.5659}; type = "Village"; sector = "sector_15003500"; buildings = 6; }; class Village_982 { position[] = {4708.58,732.291}; orientation[] = {50,62.851}; type = "Village"; sector = "sector_45000500"; buildings = 6; }; class Village_983 { position[] = {2779.2,854.232}; orientation[] = {93.3585,50}; type = "Village"; sector = "sector_25000500"; buildings = 6; }; class Village_984 { position[] = {8874.49,2042.34}; orientation[] = {372.207,361.815}; type = "Village"; sector = "sector_85002500"; buildings = 6; }; class Village_985 { position[] = {3163.7,8219.51}; orientation[] = {68.3539,68.417}; type = "Village"; sector = "sector_35008500"; buildings = 6; }; class Village_986 { position[] = {6676.82,11452.2}; orientation[] = {213.51,252.465}; type = "Village"; sector = "sector_650011500"; buildings = 6; }; class Village_987 { position[] = {4640.71,5762.48}; orientation[] = {64.5482,50}; type = "Village"; sector = "sector_45005500"; buildings = 6; }; class Village_988 { position[] = {6193.13,5147.59}; orientation[] = {50,161.987}; type = "Village"; sector = "sector_65005500"; buildings = 6; }; class Village_989 { position[] = {6622.34,4521.06}; orientation[] = {175.187,257.603}; type = "Village"; sector = "sector_65004500"; buildings = 6; }; class Village_990 { position[] = {6260.68,10737.9}; orientation[] = {67.8423,50}; type = "Village"; sector = "sector_650010500"; buildings = 6; }; class Village_991 { position[] = {7938.79,3154.51}; orientation[] = {152.517,296.665}; type = "Village"; sector = "sector_75003500"; buildings = 7; }; class Village_992 { position[] = {6728.78,8885.06}; orientation[] = {98.9313,77.3298}; type = "Village"; sector = "sector_65008500"; buildings = 7; }; class Village_993 { position[] = {5954.79,10197.3}; orientation[] = {190.121,184.808}; type = "Village"; sector = "sector_550010500"; buildings = 7; }; class Village_994 { position[] = {12554.2,10047.5}; orientation[] = {53.8613,185.921}; type = "Village"; sector = "sector_1250010500"; buildings = 7; }; class Village_995 { position[] = {11707.9,11535.3}; orientation[] = {187.667,275.547}; type = "Village"; sector = "sector_1150011500"; buildings = 7; }; class Village_996 { position[] = {6086.2,10590}; orientation[] = {229.514,146.155}; type = "Village"; sector = "sector_650010500"; buildings = 7; }; class Village_997 { position[] = {2213.26,12136.8}; orientation[] = {115.366,184.552}; type = "Village"; sector = "sector_250012500"; buildings = 7; }; class Village_998 { position[] = {9617.14,6461.59}; orientation[] = {91.9445,101.326}; type = "Village"; sector = "sector_95006500"; buildings = 7; }; class Village_999 { position[] = {6765.46,5007.07}; orientation[] = {276.35,110.453}; type = "Village"; sector = "sector_65005500"; buildings = 7; }; class Village_1000 { position[] = {12114.5,9980.9}; orientation[] = {241.084,160.724}; type = "Village"; sector = "sector_125009500"; buildings = 7; }; class Village_1001 { position[] = {10446.8,11101.4}; orientation[] = {127.121,61.0264}; type = "Village"; sector = "sector_1050011500"; buildings = 8; }; class Village_1002 { position[] = {10233.1,10470.2}; orientation[] = {298.503,289.324}; type = "Village"; sector = "sector_1050010500"; buildings = 8; }; class Village_1003 { position[] = {11802,2625.27}; orientation[] = {83.4367,116.198}; type = "Village"; sector = "sector_115002500"; buildings = 8; }; class Village_1004 { position[] = {3704.73,5616.18}; orientation[] = {269.019,102.441}; type = "Village"; sector = "sector_35005500"; buildings = 9; }; class Village_1005 { position[] = {10451.8,11098.2}; orientation[] = {333.729,270.074}; type = "Village"; sector = "sector_1050011500"; buildings = 9; }; class Village_1006 { position[] = {3565.07,1289.97}; orientation[] = {95.1492,195.573}; type = "Village"; sector = "sector_35001500"; buildings = 9; }; class Village_1007 { position[] = {2733.51,7779.6}; orientation[] = {176.831,504.54}; type = "Village"; sector = "sector_25007500"; buildings = 9; }; class Village_1008 { position[] = {5980.62,8956.55}; orientation[] = {628.712,102.486}; type = "Village"; sector = "sector_55008500"; buildings = 9; }; class Village_1009 { position[] = {5622.46,9916.39}; orientation[] = {118.712,141.335}; type = "Village"; sector = "sector_55009500"; buildings = 9; }; class Village_1010 { position[] = {6919.39,6501.57}; orientation[] = {264.796,154.183}; type = "Village"; sector = "sector_65006500"; buildings = 9; }; class Village_1011 { position[] = {10489.8,11033.7}; orientation[] = {204.011,118.391}; type = "Village"; sector = "sector_1050011500"; buildings = 10; }; class Village_1012 { position[] = {10431.4,10448.9}; orientation[] = {395.659,407.447}; type = "Village"; sector = "sector_1050010500"; buildings = 10; }; class Village_1013 { position[] = {3883.89,10450.9}; orientation[] = {252.63,206.946}; type = "Village"; sector = "sector_350010500"; buildings = 10; }; class Village_1014 { position[] = {5771.04,8546.41}; orientation[] = {92.2023,70.588}; type = "Village"; sector = "sector_55008500"; buildings = 10; }; class Village_1015 { position[] = {3778.13,4490.64}; orientation[] = {244.508,283.812}; type = "Village"; sector = "sector_35004500"; buildings = 10; }; class Village_1016 { position[] = {6089.01,10479.1}; orientation[] = {206.883,161.419}; type = "Village"; sector = "sector_650010500"; buildings = 11; }; class Village_1017 { position[] = {11503.4,8242.7}; orientation[] = {94.7579,330.452}; type = "Village"; sector = "sector_115008500"; buildings = 12; }; class Village_1018 { position[] = {11503.4,8242.7}; orientation[] = {94.7579,330.452}; type = "Village"; sector = "sector_115008500"; buildings = 12; }; class Village_1019 { position[] = {3810.9,9133.87}; orientation[] = {109.872,302.077}; type = "Village"; sector = "sector_35009500"; buildings = 12; }; class Village_1020 { position[] = {1987.29,311.501}; orientation[] = {368.918,181.553}; type = "Village"; sector = "sector_15000500"; buildings = 13; }; class Village_1021 { position[] = {10981.9,6386.94}; orientation[] = {180.423,311.245}; type = "Village"; sector = "sector_105006500"; buildings = 13; }; class Village_1022 { position[] = {6922.07,11595.1}; orientation[] = {77.8486,178.893}; type = "Village"; sector = "sector_650011500"; buildings = 13; }; class Village_1023 { position[] = {5880.81,6385.39}; orientation[] = {106.191,234.388}; type = "Village"; sector = "sector_55006500"; buildings = 14; }; class Village_1024 { position[] = {6810.89,6058.09}; orientation[] = {262.317,228.816}; type = "Village"; sector = "sector_65006500"; buildings = 14; }; class Village_1025 { position[] = {4239.73,10877.1}; orientation[] = {310.045,136.057}; type = "Village"; sector = "sector_450010500"; buildings = 15; }; class Village_1026 { position[] = {6969.42,8828.72}; orientation[] = {399.653,288.155}; type = "Village"; sector = "sector_65008500"; buildings = 15; }; class Village_1027 { position[] = {3538.77,10085.9}; orientation[] = {247.374,279.194}; type = "Village"; sector = "sector_350010500"; buildings = 15; }; class Village_1028 { position[] = {11044.3,2476.86}; orientation[] = {240.812,238.274}; type = "Village"; sector = "sector_115002500"; buildings = 16; }; class Village_1029 { position[] = {2488.95,5049.48}; orientation[] = {143.912,146.473}; type = "Village"; sector = "sector_25005500"; buildings = 16; }; class Village_1030 { position[] = {6817.21,12262.1}; orientation[] = {111.926,143.918}; type = "Village"; sector = "sector_650012500"; buildings = 16; }; class Village_1031 { position[] = {8241.98,7742.76}; orientation[] = {213.886,213.637}; type = "Village"; sector = "sector_85007500"; buildings = 16; }; class Village_1032 { position[] = {5065.69,5315.3}; orientation[] = {243.232,247.569}; type = "Village"; sector = "sector_55005500"; buildings = 17; }; class Village_1033 { position[] = {4172.35,11775.4}; orientation[] = {131.912,152.686}; type = "Village"; sector = "sector_450011500"; buildings = 17; }; class Village_1034 { position[] = {8169.58,7788.54}; orientation[] = {373.172,314.352}; type = "Village"; sector = "sector_85007500"; buildings = 17; }; class Village_1035 { position[] = {106.16,2789.24}; orientation[] = {106.142,113.042}; type = "Village"; sector = "sector_05002500"; buildings = 18; }; class Village_1036 { position[] = {5334,4770.11}; orientation[] = {157.833,201.535}; type = "Village"; sector = "sector_55004500"; buildings = 19; }; class Village_1037 { position[] = {5334,4770.11}; orientation[] = {157.833,201.535}; type = "Village"; sector = "sector_55004500"; buildings = 19; }; class Village_1038 { position[] = {997.06,3169.37}; orientation[] = {98.4704,109.382}; type = "Village"; sector = "sector_05003500"; buildings = 19; }; class Village_1039 { position[] = {4143.81,10733.8}; orientation[] = {303.398,171.45}; type = "Village"; sector = "sector_450010500"; buildings = 20; }; class Village_1040 { position[] = {4172.35,11644.6}; orientation[] = {131.912,440.462}; type = "Village"; sector = "sector_450011500"; buildings = 20; }; class Village_1041 { position[] = {3507.07,4095.7}; orientation[] = {370.802,533.78}; type = "Village"; sector = "sector_35004500"; buildings = 20; }; class Village_1042 { position[] = {7537.65,1819.36}; orientation[] = {204.3,307.33}; type = "Village"; sector = "sector_75001500"; buildings = 21; }; class Village_1043 { position[] = {6543.82,2047.36}; orientation[] = {282.263,169.014}; type = "Village"; sector = "sector_65002500"; buildings = 23; }; class Village_1044 { position[] = {3256.98,3675.85}; orientation[] = {214.974,303.933}; type = "Village"; sector = "sector_35003500"; buildings = 23; }; class Village_1045 { position[] = {6136.67,1141.77}; orientation[] = {434.835,151.785}; type = "Village"; sector = "sector_65001500"; buildings = 24; }; class Village_1046 { position[] = {3645.38,8554.33}; orientation[] = {197.736,480.749}; type = "Village"; sector = "sector_35008500"; buildings = 24; }; class Village_1047 { position[] = {3607.26,8521.01}; orientation[] = {281.604,554.044}; type = "Village"; sector = "sector_35008500"; buildings = 25; }; class Village_1048 { position[] = {8991.52,1889.45}; orientation[] = {594.85,167.482}; type = "Village"; sector = "sector_85001500"; buildings = 25; }; class Village_1049 { position[] = {10483.6,2380.15}; orientation[] = {559.227,220.085}; type = "Village"; sector = "sector_105002500"; buildings = 29; }; class Village_1050 { position[] = {9078.54,6779.08}; orientation[] = {371.965,424.96}; type = "Village"; sector = "sector_95006500"; buildings = 31; }; class Village_1051 { position[] = {6005.97,7306.62}; orientation[] = {216.716,447.969}; type = "Village"; sector = "sector_65007500"; buildings = 31; }; class Village_1052 { position[] = {5823.62,9903.7}; orientation[] = {436.726,311.838}; type = "Village"; sector = "sector_55009500"; buildings = 31; }; class Village_1053 { position[] = {6005.97,7306.62}; orientation[] = {216.716,447.969}; type = "Village"; sector = "sector_65007500"; buildings = 31; }; class Village_1054 { position[] = {12298,10431.8}; orientation[] = {211.782,626.964}; type = "Village"; sector = "sector_1250010500"; buildings = 34; }; class Village_1055 { position[] = {5978,1288.57}; orientation[] = {392.973,474.74}; type = "Village"; sector = "sector_55001500"; buildings = 34; }; }; class Roads { class RoadSegment_0 { position[] = {1875.1,381.654,0}; direction = 243.76; sector = "sector_15000500"; }; class RoadSegment_1 { position[] = {2045.19,339.295,0}; direction = 115.325; sector = "sector_25000500"; }; class RoadSegment_2 { position[] = {2290.49,533.503,0}; direction = 52.1241; sector = "sector_25000500"; }; class RoadSegment_3 { position[] = {2481.47,744.952,0}; direction = 244.571; sector = "sector_25000500"; }; class RoadSegment_4 { position[] = {2732.29,881.024,0}; direction = 254.388; sector = "sector_25000500"; }; class RoadSegment_5 { position[] = {3049.9,848.098,0}; direction = 91.7139; sector = "sector_35000500"; }; class RoadSegment_6 { position[] = {3597.01,774.206,0}; direction = 171.499; sector = "sector_35000500"; }; class RoadSegment_7 { position[] = {3799.6,524.934,0}; direction = 102.052; sector = "sector_35000500"; }; class RoadSegment_8 { position[] = {4038.68,521.847,0}; direction = 86.2951; sector = "sector_45000500"; }; class RoadSegment_9 { position[] = {4266.11,698.747,0}; direction = 186.433; sector = "sector_45000500"; }; class RoadSegment_10 { position[] = {4344.19,996.793,0}; direction = 171.244; sector = "sector_45000500"; }; class RoadSegment_11 { position[] = {4531.84,572.694,0}; direction = 58.4835; sector = "sector_45000500"; }; class RoadSegment_12 { position[] = {4749.21,754.295,0}; direction = 244.426; sector = "sector_45000500"; }; class RoadSegment_13 { position[] = {5007.76,847.237,0}; direction = 252.49; sector = "sector_55000500"; }; class RoadSegment_14 { position[] = {5297.19,863.227,0}; direction = 313.328; sector = "sector_55000500"; }; class RoadSegment_15 { position[] = {5582.82,835.055,0}; direction = 90.8349; sector = "sector_55000500"; }; class RoadSegment_16 { position[] = {5847.67,935.764,0}; direction = 45.1198; sector = "sector_55000500"; }; class RoadSegment_17 { position[] = {7196.64,865.905,0}; direction = 168.263; sector = "sector_75000500"; }; class RoadSegment_18 { position[] = {7298.82,287.811,0}; direction = 154.285; sector = "sector_75000500"; }; class RoadSegment_19 { position[] = {7325.78,587.265,0}; direction = 357.21; sector = "sector_75000500"; }; class RoadSegment_20 { position[] = {3249.12,1000.57,0}; direction = 190.588; sector = "sector_35001500"; }; class RoadSegment_21 { position[] = {3486.99,1162.38,0}; direction = 42.613; sector = "sector_35001500"; }; class RoadSegment_22 { position[] = {4049.36,1447.14,0}; direction = 163.126; sector = "sector_45001500"; }; class RoadSegment_23 { position[] = {4116.7,1736.65,0}; direction = 197.645; sector = "sector_45001500"; }; class RoadSegment_24 { position[] = {4249.19,1241.12,0}; direction = 316.676; sector = "sector_45001500"; }; class RoadSegment_25 { position[] = {5889.37,1391.09,0}; direction = 163.406; sector = "sector_55001500"; }; class RoadSegment_26 { position[] = {5915.08,1010.35,0}; direction = 233.276; sector = "sector_55001500"; }; class RoadSegment_27 { position[] = {6005.1,1094.49,0}; direction = 198.018; sector = "sector_65001500"; }; class RoadSegment_28 { position[] = {6031.79,1636.76,0}; direction = 226.362; sector = "sector_65001500"; }; class RoadSegment_29 { position[] = {6286.47,1191.21,0}; direction = 256.216; sector = "sector_65001500"; }; class RoadSegment_30 { position[] = {6274.74,1791.46,0}; direction = 31.3202; sector = "sector_65001500"; }; class RoadSegment_31 { position[] = {6582.98,1235.26,0}; direction = 267.382; sector = "sector_65001500"; }; class RoadSegment_32 { position[] = {6696.02,1987.36,0}; direction = 307.405; sector = "sector_65001500"; }; class RoadSegment_33 { position[] = {6823.15,1729.73,0}; direction = 148.008; sector = "sector_65001500"; }; class RoadSegment_34 { position[] = {6850.88,1140.25,0}; direction = 122.711; sector = "sector_65001500"; }; class RoadSegment_35 { position[] = {6978.22,1397.5,0}; direction = 169.777; sector = "sector_65001500"; }; class RoadSegment_36 { position[] = {7045.09,1049.94,0}; direction = 101.119; sector = "sector_75001500"; }; class RoadSegment_37 { position[] = {7249.93,1291.81,0}; direction = 172.38; sector = "sector_75001500"; }; class RoadSegment_38 { position[] = {7380.15,1570.77,0}; direction = 235.509; sector = "sector_75001500"; }; class RoadSegment_39 { position[] = {7499.59,1836.49,0}; direction = 52.4056; sector = "sector_75001500"; }; class RoadSegment_40 { position[] = {7730.29,1592.74,0}; direction = 329.972; sector = "sector_75001500"; }; class RoadSegment_41 { position[] = {7990.03,1742.86,0}; direction = 329.972; sector = "sector_75001500"; }; class RoadSegment_42 { position[] = {8014.65,1780.2,0}; direction = 149.972; sector = "sector_85001500"; }; class RoadSegment_43 { position[] = {8292.51,1869.82,0}; direction = 57.5337; sector = "sector_85001500"; }; class RoadSegment_44 { position[] = {8558.92,1989.91,0}; direction = 68.1955; sector = "sector_85001500"; }; class RoadSegment_45 { position[] = {8694.02,1439.58,0}; direction = 266.941; sector = "sector_85001500"; }; class RoadSegment_46 { position[] = {8658.1,1723.78,0}; direction = 138.55; sector = "sector_85001500"; }; class RoadSegment_47 { position[] = {8849.2,1987.38,0}; direction = 25.1031; sector = "sector_85001500"; }; class RoadSegment_48 { position[] = {9116.61,1997.48,0}; direction = 144.463; sector = "sector_95001500"; }; class RoadSegment_49 { position[] = {9318.81,1786.27,0}; direction = 300.902; sector = "sector_95001500"; }; class RoadSegment_50 { position[] = {94.9884,2792.7,0}; direction = 67.1383; sector = "sector_05002500"; }; class RoadSegment_51 { position[] = {394.636,2820.99,0}; direction = 96.3177; sector = "sector_05002500"; }; class RoadSegment_52 { position[] = {676.878,2906.74,0}; direction = 45.0413; sector = "sector_05002500"; }; class RoadSegment_53 { position[] = {4096.19,2896.01,0}; direction = 347.689; sector = "sector_45002500"; }; class RoadSegment_54 { position[] = {4149.96,2359.22,0}; direction = 159.07; sector = "sector_45002500"; }; class RoadSegment_55 { position[] = {4175.23,2048.08,0}; direction = 186.157; sector = "sector_45002500"; }; class RoadSegment_56 { position[] = {4370,2805.89,0}; direction = 59.1907; sector = "sector_45002500"; }; class RoadSegment_57 { position[] = {4616.4,2945.61,0}; direction = 53.8823; sector = "sector_45002500"; }; class RoadSegment_58 { position[] = {6475.25,2016.67,0}; direction = 20.4223; sector = "sector_65002500"; }; class RoadSegment_59 { position[] = {7492.02,2197.36,0}; direction = 163.52; sector = "sector_75002500"; }; class RoadSegment_60 { position[] = {7492.09,2491.26,0}; direction = 199.76; sector = "sector_75002500"; }; class RoadSegment_61 { position[] = {7587.24,2781.45,0}; direction = 197.284; sector = "sector_75002500"; }; class RoadSegment_62 { position[] = {7747.41,2013.97,0}; direction = 237.907; sector = "sector_75002500"; }; class RoadSegment_63 { position[] = {7975.37,2344.72,0}; direction = 155.064; sector = "sector_75002500"; }; class RoadSegment_64 { position[] = {7973.51,2648.76,0}; direction = 353.015; sector = "sector_75002500"; }; class RoadSegment_65 { position[] = {7999.62,2942.62,0}; direction = 351.057; sector = "sector_75002500"; }; class RoadSegment_66 { position[] = {8006.76,2011.3,0}; direction = 61.2455; sector = "sector_85002500"; }; class RoadSegment_67 { position[] = {8002.88,2796.99,0}; direction = 5.71156; sector = "sector_85002500"; }; class RoadSegment_68 { position[] = {8198.23,2240.17,0}; direction = 77.3956; sector = "sector_85002500"; }; class RoadSegment_69 { position[] = {8385.59,2017.7,0}; direction = 149.971; sector = "sector_85002500"; }; class RoadSegment_70 { position[] = {8442.79,2447.95,0}; direction = 347.485; sector = "sector_85002500"; }; class RoadSegment_71 { position[] = {8638.66,2224.8,0}; direction = 288.26; sector = "sector_85002500"; }; class RoadSegment_72 { position[] = {8733.33,2547.45,0}; direction = 241.93; sector = "sector_85002500"; }; class RoadSegment_73 { position[] = {8857.55,2013.63,0}; direction = 0.735062; sector = "sector_85002500"; }; class RoadSegment_74 { position[] = {8996.06,2661.38,0}; direction = 254.998; sector = "sector_85002500"; }; class RoadSegment_75 { position[] = {9007.62,2222.99,0}; direction = 268.171; sector = "sector_95002500"; }; class RoadSegment_76 { position[] = {9029.21,2566.83,0}; direction = 134.4; sector = "sector_95002500"; }; class RoadSegment_77 { position[] = {9289.6,2259.47,0}; direction = 64.9627; sector = "sector_95002500"; }; class RoadSegment_78 { position[] = {9267.79,2728.81,0}; direction = 66.4026; sector = "sector_95002500"; }; class RoadSegment_79 { position[] = {9534.71,2870.35,0}; direction = 22.6505; sector = "sector_95002500"; }; class RoadSegment_80 { position[] = {9565.12,2373.06,0}; direction = 264.567; sector = "sector_95002500"; }; class RoadSegment_81 { position[] = {9870.95,2337.42,0}; direction = 99.1783; sector = "sector_95002500"; }; class RoadSegment_82 { position[] = {10025.4,2325.25,0}; direction = 271.635; sector = "sector_105002500"; }; class RoadSegment_83 { position[] = {10346.1,2397.4,0}; direction = 260.12; sector = "sector_105002500"; }; class RoadSegment_84 { position[] = {10646.1,2385.07,0}; direction = 80.7241; sector = "sector_105002500"; }; class RoadSegment_85 { position[] = {10920.3,2474.84,0}; direction = 240.728; sector = "sector_105002500"; }; class RoadSegment_86 { position[] = {11004.5,2447.71,0}; direction = 295.07; sector = "sector_115002500"; }; class RoadSegment_87 { position[] = {11290.3,2436.73,0}; direction = 79.0919; sector = "sector_115002500"; }; class RoadSegment_88 { position[] = {11596.1,2517.8,0}; direction = 73.8205; sector = "sector_115002500"; }; class RoadSegment_89 { position[] = {11883.1,2536.19,0}; direction = 296.896; sector = "sector_115002500"; }; class RoadSegment_90 { position[] = {786.609,3024.55,0}; direction = 227.785; sector = "sector_05003500"; }; class RoadSegment_91 { position[] = {1022.82,3156.47,0}; direction = 70.5614; sector = "sector_15003500"; }; class RoadSegment_92 { position[] = {1148,3996.53,0}; direction = 144.961; sector = "sector_15003500"; }; class RoadSegment_93 { position[] = {1245.37,3342.38,0}; direction = 39.0425; sector = "sector_15003500"; }; class RoadSegment_94 { position[] = {1297.9,3757.49,0}; direction = 136.673; sector = "sector_15003500"; }; class RoadSegment_95 { position[] = {1478.26,3524.33,0}; direction = 258.487; sector = "sector_15003500"; }; class RoadSegment_96 { position[] = {1658.18,3754.39,0}; direction = 55.4541; sector = "sector_15003500"; }; class RoadSegment_97 { position[] = {1889,3934.28,0}; direction = 194.09; sector = "sector_15003500"; }; class RoadSegment_98 { position[] = {3198,3547.34,0}; direction = 41.9309; sector = "sector_35003500"; }; class RoadSegment_99 { position[] = {3347.09,3790.81,0}; direction = 19.163; sector = "sector_35003500"; }; class RoadSegment_100 { position[] = {3567.53,3989.31,0}; direction = 146.24; sector = "sector_35003500"; }; class RoadSegment_101 { position[] = {3795.72,3752.5,0}; direction = 323.965; sector = "sector_35003500"; }; class RoadSegment_102 { position[] = {3897.78,3343.68,0}; direction = 161.862; sector = "sector_35003500"; }; class RoadSegment_103 { position[] = {4048.21,3095.37,0}; direction = 321.462; sector = "sector_45003500"; }; class RoadSegment_104 { position[] = {4692.61,3012.4,0}; direction = 41.8929; sector = "sector_45003500"; }; class RoadSegment_105 { position[] = {4887.57,3219.3,0}; direction = 241.062; sector = "sector_45003500"; }; class RoadSegment_106 { position[] = {5010.5,3286.3,0}; direction = 241.329; sector = "sector_55003500"; }; class RoadSegment_107 { position[] = {5169.6,3526.55,0}; direction = 170.112; sector = "sector_55003500"; }; class RoadSegment_108 { position[] = {5343.78,3757.22,0}; direction = 39.9955; sector = "sector_55003500"; }; class RoadSegment_109 { position[] = {7669.07,3006.99,0}; direction = 194.353; sector = "sector_75003500"; }; class RoadSegment_110 { position[] = {7858.41,3227.56,0}; direction = 12.3048; sector = "sector_75003500"; }; class RoadSegment_111 { position[] = {7878.22,3532.14,0}; direction = 170.761; sector = "sector_75003500"; }; class RoadSegment_112 { position[] = {8019.06,3782.47,0}; direction = 56.4346; sector = "sector_85003500"; }; class RoadSegment_113 { position[] = {8093.62,3021.09,0}; direction = 223.641; sector = "sector_85003500"; }; class RoadSegment_114 { position[] = {8310.11,3785.87,0}; direction = 92.7428; sector = "sector_85003500"; }; class RoadSegment_115 { position[] = {8360.51,3134.58,0}; direction = 278.005; sector = "sector_85003500"; }; class RoadSegment_116 { position[] = {8595.08,3777.8,0}; direction = 270.574; sector = "sector_85003500"; }; class RoadSegment_117 { position[] = {8649.76,3040.3,0}; direction = 89.16; sector = "sector_85003500"; }; class RoadSegment_118 { position[] = {8847.63,3649.5,0}; direction = 309.687; sector = "sector_85003500"; }; class RoadSegment_119 { position[] = {8921.7,3199.94,0}; direction = 27.8626; sector = "sector_85003500"; }; class RoadSegment_120 { position[] = {9048.17,3314.04,0}; direction = 271.222; sector = "sector_95003500"; }; class RoadSegment_121 { position[] = {9341.71,3308.27,0}; direction = 269.25; sector = "sector_95003500"; }; class RoadSegment_122 { position[] = {9549.71,3028.14,0}; direction = 353.976; sector = "sector_95003500"; }; class RoadSegment_123 { position[] = {649.033,4495.37,0}; direction = 159.282; sector = "sector_05004500"; }; class RoadSegment_124 { position[] = {738.14,4772.44,0}; direction = 217.488; sector = "sector_05004500"; }; class RoadSegment_125 { position[] = {843.043,4279.67,0}; direction = 123.444; sector = "sector_05004500"; }; class RoadSegment_126 { position[] = {923.101,4995.69,0}; direction = 30.7645; sector = "sector_05004500"; }; class RoadSegment_127 { position[] = {1040.03,4142.9,0}; direction = 318.75; sector = "sector_15004500"; }; class RoadSegment_128 { position[] = {1929.76,4046.8,0}; direction = 16.4275; sector = "sector_15004500"; }; class RoadSegment_129 { position[] = {2000.29,4254.02,0}; direction = 213.226; sector = "sector_25004500"; }; class RoadSegment_130 { position[] = {2190.53,4477.83,0}; direction = 40.9684; sector = "sector_25004500"; }; class RoadSegment_131 { position[] = {2342.2,4720.96,0}; direction = 197.037; sector = "sector_25004500"; }; class RoadSegment_132 { position[] = {2478.88,4981.62,0}; direction = 24.8347; sector = "sector_25004500"; }; class RoadSegment_133 { position[] = {3399.69,4004.12,0}; direction = 9.43619; sector = "sector_35004500"; }; class RoadSegment_134 { position[] = {3547.93,4259.31,0}; direction = 204.672; sector = "sector_35004500"; }; class RoadSegment_135 { position[] = {3597.65,4988.18,0}; direction = 160.653; sector = "sector_35004500"; }; class RoadSegment_136 { position[] = {3644.54,4615.33,0}; direction = 160.073; sector = "sector_35004500"; }; class RoadSegment_137 { position[] = {3835.32,4368.79,0}; direction = 79.1862; sector = "sector_35004500"; }; class RoadSegment_138 { position[] = {5346.54,4526.68,0}; direction = 349.319; sector = "sector_55004500"; }; class RoadSegment_139 { position[] = {5306.11,4818.36,0}; direction = 186.414; sector = "sector_55004500"; }; class RoadSegment_140 { position[] = {5357.83,4034.66,0}; direction = 174.873; sector = "sector_55004500"; }; class RoadSegment_141 { position[] = {6589.89,4549.61,0}; direction = 17.1957; sector = "sector_65004500"; }; class RoadSegment_142 { position[] = {6747.12,4793.71,0}; direction = 38.4635; sector = "sector_65004500"; }; class RoadSegment_143 { position[] = {6980.78,4973.99,0}; direction = 288.446; sector = "sector_65004500"; }; class RoadSegment_144 { position[] = {7018.6,4961.07,0}; direction = 289.067; sector = "sector_75004500"; }; class RoadSegment_145 { position[] = {7340.56,4898.05,0}; direction = 273.355; sector = "sector_75004500"; }; class RoadSegment_146 { position[] = {8646.3,4005.04,0}; direction = 234.984; sector = "sector_85004500"; }; class RoadSegment_147 { position[] = {8744.76,4599.06,0}; direction = 131.885; sector = "sector_85004500"; }; class RoadSegment_148 { position[] = {8733.93,4887.43,0}; direction = 171.721; sector = "sector_85004500"; }; class RoadSegment_149 { position[] = {8870.36,4193.58,0}; direction = 212.586; sector = "sector_85004500"; }; class RoadSegment_150 { position[] = {9014.58,4304.95,0}; direction = 59.2482; sector = "sector_95004500"; }; class RoadSegment_151 { position[] = {9133.79,4567.5,0}; direction = 252.619; sector = "sector_95004500"; }; class RoadSegment_152 { position[] = {24.3178,5503.74,0}; direction = 76.2069; sector = "sector_05005500"; }; class RoadSegment_153 { position[] = {313.65,5612.55,0}; direction = 244.794; sector = "sector_05005500"; }; class RoadSegment_154 { position[] = {604.662,5623.54,0}; direction = 244.618; sector = "sector_05005500"; }; class RoadSegment_155 { position[] = {886.861,5713.3,0}; direction = 83.6769; sector = "sector_05005500"; }; class RoadSegment_156 { position[] = {931.942,5010.79,0}; direction = 29.4635; sector = "sector_05005500"; }; class RoadSegment_157 { position[] = {1004.13,5138.85,0}; direction = 212.669; sector = "sector_15005500"; }; class RoadSegment_158 { position[] = {1036.66,5791.43,0}; direction = 234.669; sector = "sector_15005500"; }; class RoadSegment_159 { position[] = {1224.68,5345.52,0}; direction = 246.662; sector = "sector_15005500"; }; class RoadSegment_160 { position[] = {1339.19,5844.19,0}; direction = 294.288; sector = "sector_15005500"; }; class RoadSegment_161 { position[] = {1461.13,5492.55,0}; direction = 43.1136; sector = "sector_15005500"; }; class RoadSegment_162 { position[] = {1697.9,5673.44,0}; direction = 92.2777; sector = "sector_15005500"; }; class RoadSegment_163 { position[] = {1999.58,5562,0}; direction = 274.941; sector = "sector_15005500"; }; class RoadSegment_164 { position[] = {2046.27,5545.49,0}; direction = 299.395; sector = "sector_25005500"; }; class RoadSegment_165 { position[] = {2296.81,5392.04,0}; direction = 325.196; sector = "sector_25005500"; }; class RoadSegment_166 { position[] = {2435.62,5135.04,0}; direction = 129.058; sector = "sector_25005500"; }; class RoadSegment_167 { position[] = {2722.97,5199.67,0}; direction = 55.2429; sector = "sector_25005500"; }; class RoadSegment_168 { position[] = {2974.01,5397.81,0}; direction = 236.105; sector = "sector_25005500"; }; class RoadSegment_169 { position[] = {3025.32,5428.97,0}; direction = 240.771; sector = "sector_35005500"; }; class RoadSegment_170 { position[] = {3321.38,5508.01,0}; direction = 75.7657; sector = "sector_35005500"; }; class RoadSegment_171 { position[] = {3580.09,5040.39,0}; direction = 162.431; sector = "sector_35005500"; }; class RoadSegment_172 { position[] = {3591.05,5599.84,0}; direction = 248.718; sector = "sector_35005500"; }; class RoadSegment_173 { position[] = {3880.82,5651.06,0}; direction = 268.773; sector = "sector_35005500"; }; class RoadSegment_174 { position[] = {4040.35,5650.72,0}; direction = 84.5235; sector = "sector_45005500"; }; class RoadSegment_175 { position[] = {4336.21,5737.86,0}; direction = 260.472; sector = "sector_45005500"; }; class RoadSegment_176 { position[] = {4641.76,5790.69,0}; direction = 259.426; sector = "sector_45005500"; }; class RoadSegment_177 { position[] = {4849.52,5544.09,0}; direction = 134.709; sector = "sector_45005500"; }; class RoadSegment_178 { position[] = {4883.54,5963.56,0}; direction = 39.8971; sector = "sector_45005500"; }; class RoadSegment_179 { position[] = {5042.15,5431.31,0}; direction = 109.745; sector = "sector_55005500"; }; class RoadSegment_180 { position[] = {5245.8,5097.84,0}; direction = 150.669; sector = "sector_55005500"; }; class RoadSegment_181 { position[] = {5323.56,5441.83,0}; direction = 256.753; sector = "sector_55005500"; }; class RoadSegment_182 { position[] = {5588.28,5537.51,0}; direction = 32.1142; sector = "sector_55005500"; }; class RoadSegment_183 { position[] = {5799.72,5894.19,0}; direction = 161.751; sector = "sector_55005500"; }; class RoadSegment_184 { position[] = {5866.96,5597.75,0}; direction = 54.5406; sector = "sector_55005500"; }; class RoadSegment_185 { position[] = {6032.74,5442.18,0}; direction = 148.588; sector = "sector_65005500"; }; class RoadSegment_186 { position[] = {6016.18,5845.23,0}; direction = 89.0094; sector = "sector_65005500"; }; class RoadSegment_187 { position[] = {6186.57,5164.6,0}; direction = 311.24; sector = "sector_65005500"; }; class RoadSegment_188 { position[] = {6261.58,5610.17,0}; direction = 96.364; sector = "sector_65005500"; }; class RoadSegment_189 { position[] = {6271.53,5994.25,0}; direction = 259.29; sector = "sector_65005500"; }; class RoadSegment_190 { position[] = {6482.55,5125.14,0}; direction = 280.692; sector = "sector_65005500"; }; class RoadSegment_191 { position[] = {6543.53,5668.27,0}; direction = 249.665; sector = "sector_65005500"; }; class RoadSegment_192 { position[] = {6572.51,5990.58,0}; direction = 63.3691; sector = "sector_65005500"; }; class RoadSegment_193 { position[] = {6778,5032.19,0}; direction = 104.769; sector = "sector_65005500"; }; class RoadSegment_194 { position[] = {6876.13,5983.36,0}; direction = 314.642; sector = "sector_65005500"; }; class RoadSegment_195 { position[] = {7009.07,5849.62,0}; direction = 125.612; sector = "sector_75005500"; }; class RoadSegment_196 { position[] = {7298.97,5710.89,0}; direction = 111.175; sector = "sector_75005500"; }; class RoadSegment_197 { position[] = {7598.33,5005.74,0}; direction = 249.424; sector = "sector_75005500"; }; class RoadSegment_198 { position[] = {7582.39,5635.41,0}; direction = 279.778; sector = "sector_75005500"; }; class RoadSegment_199 { position[] = {7887.72,5088.98,0}; direction = 255.904; sector = "sector_75005500"; }; class RoadSegment_200 { position[] = {7889.17,5579.75,0}; direction = 100.473; sector = "sector_75005500"; }; class RoadSegment_201 { position[] = {8036.23,5098.25,0}; direction = 279.054; sector = "sector_85005500"; }; class RoadSegment_202 { position[] = {8047.59,5551.14,0}; direction = 99.3678; sector = "sector_85005500"; }; class RoadSegment_203 { position[] = {8339.24,5129.13,0}; direction = 70.4481; sector = "sector_85005500"; }; class RoadSegment_204 { position[] = {8323.57,5481.45,0}; direction = 262.565; sector = "sector_85005500"; }; class RoadSegment_205 { position[] = {8635.75,5142.2,0}; direction = 86.1313; sector = "sector_85005500"; }; class RoadSegment_206 { position[] = {8723.13,5414.73,0}; direction = 266.221; sector = "sector_85005500"; }; class RoadSegment_207 { position[] = {8984.54,5536.49,0}; direction = 0.502857; sector = "sector_85005500"; }; class RoadSegment_208 { position[] = {8986.72,5823.1,0}; direction = 199.49; sector = "sector_85005500"; }; class RoadSegment_209 { position[] = {9022.01,5885.6,0}; direction = 214.616; sector = "sector_95005500"; }; class RoadSegment_210 { position[] = {1134.65,6975.18,0}; direction = 145.101; sector = "sector_15006500"; }; class RoadSegment_211 { position[] = {1341.56,6758.23,0}; direction = 311.799; sector = "sector_15006500"; }; class RoadSegment_212 { position[] = {1444.76,6489.03,0}; direction = 159.768; sector = "sector_15006500"; }; class RoadSegment_213 { position[] = {1464.11,6000.96,0}; direction = 172.844; sector = "sector_15006500"; }; class RoadSegment_214 { position[] = {4767.4,6729.53,0}; direction = 146.27; sector = "sector_45006500"; }; class RoadSegment_215 { position[] = {4937.34,6036.12,0}; direction = 215.462; sector = "sector_45006500"; }; class RoadSegment_216 { position[] = {5016.13,6099.64,0}; direction = 238.8; sector = "sector_55006500"; }; class RoadSegment_217 { position[] = {5047.65,6484.49,0}; direction = 164.668; sector = "sector_55006500"; }; class RoadSegment_218 { position[] = {5011.94,6797.51,0}; direction = 67.5491; sector = "sector_55006500"; }; class RoadSegment_219 { position[] = {5294.37,6242.27,0}; direction = 228.351; sector = "sector_55006500"; }; class RoadSegment_220 { position[] = {5583.5,6399.39,0}; direction = 53.2285; sector = "sector_55006500"; }; class RoadSegment_221 { position[] = {5769.94,6630.24,0}; direction = 227.56; sector = "sector_55006500"; }; class RoadSegment_222 { position[] = {5802.6,6008.92,0}; direction = 191.917; sector = "sector_55006500"; }; class RoadSegment_223 { position[] = {5873.96,6294.7,0}; direction = 8.56859; sector = "sector_55006500"; }; class RoadSegment_224 { position[] = {5941,6897.07,0}; direction = 198.575; sector = "sector_55006500"; }; class RoadSegment_225 { position[] = {6594.35,6001.89,0}; direction = 60.3158; sector = "sector_65006500"; }; class RoadSegment_226 { position[] = {6740.72,6247.74,0}; direction = 181.441; sector = "sector_65006500"; }; class RoadSegment_227 { position[] = {6747.16,6635.16,0}; direction = 170.838; sector = "sector_65006500"; }; class RoadSegment_228 { position[] = {6781.16,6937.96,0}; direction = 14.9018; sector = "sector_65006500"; }; class RoadSegment_229 { position[] = {8927.57,6985.53,0}; direction = 326.305; sector = "sector_85006500"; }; class RoadSegment_230 { position[] = {9030.57,6845.93,0}; direction = 135.541; sector = "sector_95006500"; }; class RoadSegment_231 { position[] = {9147.54,6032.95,0}; direction = 29.4653; sector = "sector_95006500"; }; class RoadSegment_232 { position[] = {9149.08,6457.5,0}; direction = 174.838; sector = "sector_95006500"; }; class RoadSegment_233 { position[] = {9425.72,6585,0}; direction = 280.651; sector = "sector_95006500"; }; class RoadSegment_234 { position[] = {9722.28,6497.41,0}; direction = 105.018; sector = "sector_95006500"; }; class RoadSegment_235 { position[] = {10035.4,6431.49,0}; direction = 281.724; sector = "sector_105006500"; }; class RoadSegment_236 { position[] = {10349.3,6375.56,0}; direction = 279.217; sector = "sector_105006500"; }; class RoadSegment_237 { position[] = {10629.9,6287.38,0}; direction = 86.3867; sector = "sector_105006500"; }; class RoadSegment_238 { position[] = {10939.4,6295.65,0}; direction = 90.9577; sector = "sector_105006500"; }; class RoadSegment_239 { position[] = {11019.5,6293.43,0}; direction = 275.198; sector = "sector_115006500"; }; class RoadSegment_240 { position[] = {35.576,7081.47,0}; direction = 19.7179; sector = "sector_05007500"; }; class RoadSegment_241 { position[] = {205.622,7307.31,0}; direction = 252.573; sector = "sector_05007500"; }; class RoadSegment_242 { position[] = {493.489,7407.54,0}; direction = 67.6331; sector = "sector_05007500"; }; class RoadSegment_243 { position[] = {749.774,7545.8,0}; direction = 20.7285; sector = "sector_05007500"; }; class RoadSegment_244 { position[] = {851.744,7813.82,0}; direction = 248.145; sector = "sector_05007500"; }; class RoadSegment_245 { position[] = {1012.9,7867.16,0}; direction = 67.9321; sector = "sector_15007500"; }; class RoadSegment_246 { position[] = {1122.7,7000.79,0}; direction = 165.867; sector = "sector_15007500"; }; class RoadSegment_247 { position[] = {1291.96,7901.49,0}; direction = 92.84; sector = "sector_15007500"; }; class RoadSegment_248 { position[] = {1432.77,7063.17,0}; direction = 77.4417; sector = "sector_15007500"; }; class RoadSegment_249 { position[] = {1586.58,7890.11,0}; direction = 87.5204; sector = "sector_15007500"; }; class RoadSegment_250 { position[] = {1699.99,7152.21,0}; direction = 42.5005; sector = "sector_15007500"; }; class RoadSegment_251 { position[] = {1861.41,7385.17,0}; direction = 216.598; sector = "sector_15007500"; }; class RoadSegment_252 { position[] = {1890.82,7842.7,0}; direction = 297.624; sector = "sector_15007500"; }; class RoadSegment_253 { position[] = {2006.83,7582.13,0}; direction = 29.9854; sector = "sector_25007500"; }; class RoadSegment_254 { position[] = {2244.48,7745.3,0}; direction = 259.154; sector = "sector_25007500"; }; class RoadSegment_255 { position[] = {2545.24,7813.87,0}; direction = 256.513; sector = "sector_25007500"; }; class RoadSegment_256 { position[] = {2829.15,7866.78,0}; direction = 52.8806; sector = "sector_25007500"; }; class RoadSegment_257 { position[] = {3043.94,7937,0}; direction = 60.5299; sector = "sector_35007500"; }; class RoadSegment_258 { position[] = {5880.12,7193.8,0}; direction = 157.705; sector = "sector_55007500"; }; class RoadSegment_259 { position[] = {5955.7,7494.48,0}; direction = 6.79114; sector = "sector_55007500"; }; class RoadSegment_260 { position[] = {5967.61,7794.13,0}; direction = 180.549; sector = "sector_55007500"; }; class RoadSegment_261 { position[] = {6001.65,7215.76,0}; direction = 254.703; sector = "sector_65007500"; }; class RoadSegment_262 { position[] = {6278.23,7330.69,0}; direction = 260.397; sector = "sector_65007500"; }; class RoadSegment_263 { position[] = {6585.83,7367.44,0}; direction = 267.799; sector = "sector_65007500"; }; class RoadSegment_264 { position[] = {6798.48,7005.78,0}; direction = 13.3728; sector = "sector_65007500"; }; class RoadSegment_265 { position[] = {7853.26,7993.91,0}; direction = 107.191; sector = "sector_75007500"; }; class RoadSegment_266 { position[] = {8022.57,7933.28,0}; direction = 296.733; sector = "sector_85007500"; }; class RoadSegment_267 { position[] = {8297.73,7725.01,0}; direction = 319.003; sector = "sector_85007500"; }; class RoadSegment_268 { position[] = {8498.26,7518.67,0}; direction = 130.696; sector = "sector_85007500"; }; class RoadSegment_269 { position[] = {8739.68,7285.99,0}; direction = 136.293; sector = "sector_85007500"; }; class RoadSegment_270 { position[] = {8888.44,7038.94,0}; direction = 143.431; sector = "sector_85007500"; }; class RoadSegment_271 { position[] = {3138.69,8008.52,0}; direction = 231.509; sector = "sector_35008500"; }; class RoadSegment_272 { position[] = {3351.07,8197.15,0}; direction = 57.2404; sector = "sector_35008500"; }; class RoadSegment_273 { position[] = {3542.99,8406.42,0}; direction = 38.7647; sector = "sector_35008500"; }; class RoadSegment_274 { position[] = {3649.79,8675.83,0}; direction = 17.6709; sector = "sector_35008500"; }; class RoadSegment_275 { position[] = {3712.91,8974.6,0}; direction = 159.757; sector = "sector_35008500"; }; class RoadSegment_276 { position[] = {4300.92,8946.79,0}; direction = 43.0044; sector = "sector_45008500"; }; class RoadSegment_277 { position[] = {5548.31,8868.98,0}; direction = 330.868; sector = "sector_55008500"; }; class RoadSegment_278 { position[] = {5689.77,8532.31,0}; direction = 333.795; sector = "sector_55008500"; }; class RoadSegment_279 { position[] = {5798.11,8234.85,0}; direction = 169.182; sector = "sector_55008500"; }; class RoadSegment_280 { position[] = {5811.09,8973.33,0}; direction = 77.4183; sector = "sector_55008500"; }; class RoadSegment_281 { position[] = {5959.64,8001.76,0}; direction = 312.312; sector = "sector_55008500"; }; class RoadSegment_282 { position[] = {6147.73,8996.29,0}; direction = 282.921; sector = "sector_65008500"; }; class RoadSegment_283 { position[] = {6436.11,8975.23,0}; direction = 76.7683; sector = "sector_65008500"; }; class RoadSegment_284 { position[] = {6725.37,8938.03,0}; direction = 102.464; sector = "sector_65008500"; }; class RoadSegment_285 { position[] = {7003.34,8833,0}; direction = 302.897; sector = "sector_75008500"; }; class RoadSegment_286 { position[] = {7243.02,8643.96,0}; direction = 316.815; sector = "sector_75008500"; }; class RoadSegment_287 { position[] = {7437.74,8335.35,0}; direction = 147.995; sector = "sector_75008500"; }; class RoadSegment_288 { position[] = {7644.87,8110.74,0}; direction = 125.659; sector = "sector_75008500"; }; class RoadSegment_289 { position[] = {8121.33,8893.77,0}; direction = 141.277; sector = "sector_85008500"; }; class RoadSegment_290 { position[] = {8336.69,8664.88,0}; direction = 134.059; sector = "sector_85008500"; }; class RoadSegment_291 { position[] = {8383.54,8019.93,0}; direction = 200.813; sector = "sector_85008500"; }; class RoadSegment_292 { position[] = {8538.66,8290.11,0}; direction = 207.446; sector = "sector_85008500"; }; class RoadSegment_293 { position[] = {8836.93,8226.07,0}; direction = 86.2288; sector = "sector_85008500"; }; class RoadSegment_294 { position[] = {9035.96,8387.81,0}; direction = 228.956; sector = "sector_95008500"; }; class RoadSegment_295 { position[] = {9243.28,8589.59,0}; direction = 33.272; sector = "sector_95008500"; }; class RoadSegment_296 { position[] = {9278.66,8882.81,0}; direction = 186.182; sector = "sector_95008500"; }; class RoadSegment_297 { position[] = {11445.6,8194.33,0}; direction = 28.9656; sector = "sector_115008500"; }; class RoadSegment_298 { position[] = {11566.7,8488.21,0}; direction = 15.5292; sector = "sector_115008500"; }; class RoadSegment_299 { position[] = {11602.2,8789.72,0}; direction = 182.982; sector = "sector_115008500"; }; class RoadSegment_300 { position[] = {2847.13,9757.45,0}; direction = 37.0671; sector = "sector_25009500"; }; class RoadSegment_301 { position[] = {3038.84,9858.27,0}; direction = 75.8521; sector = "sector_35009500"; }; class RoadSegment_302 { position[] = {3284.71,9710.61,0}; direction = 299.144; sector = "sector_35009500"; }; class RoadSegment_303 { position[] = {3441.89,9453.72,0}; direction = 143.323; sector = "sector_35009500"; }; class RoadSegment_304 { position[] = {3445.93,9994.16,0}; direction = 103.901; sector = "sector_35009500"; }; class RoadSegment_305 { position[] = {3687.58,9287.22,0}; direction = 315.699; sector = "sector_35009500"; }; class RoadSegment_306 { position[] = {3788.94,9013.96,0}; direction = 205.215; sector = "sector_35009500"; }; class RoadSegment_307 { position[] = {3983.73,9298.78,0}; direction = 221.125; sector = "sector_35009500"; }; class RoadSegment_308 { position[] = {4003.96,9321,0}; direction = 222.974; sector = "sector_45009500"; }; class RoadSegment_309 { position[] = {4241.3,9488.07,0}; direction = 271.817; sector = "sector_45009500"; }; class RoadSegment_310 { position[] = {4291.57,9778.49,0}; direction = 9.13583; sector = "sector_45009500"; }; class RoadSegment_311 { position[] = {4358.14,9021.36,0}; direction = 24.794; sector = "sector_45009500"; }; class RoadSegment_312 { position[] = {4532.23,9427.64,0}; direction = 241.344; sector = "sector_45009500"; }; class RoadSegment_313 { position[] = {4598.63,9874.85,0}; direction = 239.749; sector = "sector_45009500"; }; class RoadSegment_314 { position[] = {4695.05,9192.63,0}; direction = 80.4983; sector = "sector_45009500"; }; class RoadSegment_315 { position[] = {4796.16,9541.14,0}; direction = 271.846; sector = "sector_45009500"; }; class RoadSegment_316 { position[] = {4883.6,9809.59,0}; direction = 250.41; sector = "sector_45009500"; }; class RoadSegment_317 { position[] = {5048,9422.3,0}; direction = 297.128; sector = "sector_55009500"; }; class RoadSegment_318 { position[] = {5008.61,9845.02,0}; direction = 256.712; sector = "sector_55009500"; }; class RoadSegment_319 { position[] = {5276.45,9997.06,0}; direction = 85.5939; sector = "sector_55009500"; }; class RoadSegment_320 { position[] = {5498.19,9046.13,0}; direction = 176.022; sector = "sector_55009500"; }; class RoadSegment_321 { position[] = {5514.26,9340.72,0}; direction = 173.731; sector = "sector_55009500"; }; class RoadSegment_322 { position[] = {5547.47,9629.57,0}; direction = 196.019; sector = "sector_55009500"; }; class RoadSegment_323 { position[] = {5642.42,9912.47,0}; direction = 38.7407; sector = "sector_55009500"; }; class RoadSegment_324 { position[] = {5933.82,9002.11,0}; direction = 258.459; sector = "sector_55009500"; }; class RoadSegment_325 { position[] = {5901.88,9787.84,0}; direction = 317.733; sector = "sector_55009500"; }; class RoadSegment_326 { position[] = {6047.28,9011.58,0}; direction = 270.324; sector = "sector_65009500"; }; class RoadSegment_327 { position[] = {6894.85,9041.43,0}; direction = 20.9493; sector = "sector_65009500"; }; class RoadSegment_328 { position[] = {7007.79,9298.47,0}; direction = 27.0311; sector = "sector_75009500"; }; class RoadSegment_329 { position[] = {7272.1,9398.01,0}; direction = 59.4993; sector = "sector_75009500"; }; class RoadSegment_330 { position[] = {7316.56,9699.78,0}; direction = 200.769; sector = "sector_75009500"; }; class RoadSegment_331 { position[] = {7441.39,9999.81,0}; direction = 202.418; sector = "sector_75009500"; }; class RoadSegment_332 { position[] = {7547.71,9311.66,0}; direction = 277.687; sector = "sector_75009500"; }; class RoadSegment_333 { position[] = {7825.22,9248.44,0}; direction = 287.115; sector = "sector_75009500"; }; class RoadSegment_334 { position[] = {8033.88,9178.78,0}; direction = 289.407; sector = "sector_85009500"; }; class RoadSegment_335 { position[] = {8688.17,9976.92,0}; direction = 46.156; sector = "sector_85009500"; }; class RoadSegment_336 { position[] = {9148.73,9536.7,0}; direction = 170.279; sector = "sector_95009500"; }; class RoadSegment_337 { position[] = {9196.39,9815.76,0}; direction = 187.76; sector = "sector_95009500"; }; class RoadSegment_338 { position[] = {9297.5,9244.64,0}; direction = 336.647; sector = "sector_95009500"; }; class RoadSegment_339 { position[] = {11648.8,9282.17,0}; direction = 344.477; sector = "sector_115009500"; }; class RoadSegment_340 { position[] = {11605.4,9577.87,0}; direction = 183.627; sector = "sector_115009500"; }; class RoadSegment_341 { position[] = {11642.3,9876.32,0}; direction = 0.427692; sector = "sector_115009500"; }; class RoadSegment_342 { position[] = {12200.1,9947.15,0}; direction = 2.07869; sector = "sector_125009500"; }; class RoadSegment_343 { position[] = {12479,9998.15,0}; direction = 152.405; sector = "sector_125009500"; }; class RoadSegment_344 { position[] = {831.69,10474.4,0}; direction = 283.483; sector = "sector_050010500"; }; class RoadSegment_345 { position[] = {1021.43,10393.4,0}; direction = 298.143; sector = "sector_150010500"; }; class RoadSegment_346 { position[] = {1255.45,10244,0}; direction = 71.1045; sector = "sector_150010500"; }; class RoadSegment_347 { position[] = {1315.3,10510.9,0}; direction = 173.937; sector = "sector_150010500"; }; class RoadSegment_348 { position[] = {1325.01,10792.1,0}; direction = 348.766; sector = "sector_150010500"; }; class RoadSegment_349 { position[] = {1870.51,10647.3,0}; direction = 183.255; sector = "sector_150010500"; }; class RoadSegment_350 { position[] = {1927.34,10947.9,0}; direction = 180.743; sector = "sector_150010500"; }; class RoadSegment_351 { position[] = {2486.73,10975.3,0}; direction = 137.295; sector = "sector_250010500"; }; class RoadSegment_352 { position[] = {2648.34,10647.3,0}; direction = 151.899; sector = "sector_250010500"; }; class RoadSegment_353 { position[] = {2836.88,10390.9,0}; direction = 132.798; sector = "sector_250010500"; }; class RoadSegment_354 { position[] = {2816.33,10885.7,0}; direction = 244.114; sector = "sector_250010500"; }; class RoadSegment_355 { position[] = {3046.43,10099.7,0}; direction = 346.368; sector = "sector_350010500"; }; class RoadSegment_356 { position[] = {3011.82,10948.5,0}; direction = 61.6645; sector = "sector_350010500"; }; class RoadSegment_357 { position[] = {3344.69,10057,0}; direction = 144.123; sector = "sector_350010500"; }; class RoadSegment_358 { position[] = {3542.5,10262.1,0}; direction = 222.13; sector = "sector_350010500"; }; class RoadSegment_359 { position[] = {3686.41,10798.5,0}; direction = 158.976; sector = "sector_350010500"; }; class RoadSegment_360 { position[] = {3772.81,10470.9,0}; direction = 235.535; sector = "sector_350010500"; }; class RoadSegment_361 { position[] = {3989.61,10243.6,0}; direction = 128.708; sector = "sector_350010500"; }; class RoadSegment_362 { position[] = {3970.39,10676,0}; direction = 30.6087; sector = "sector_350010500"; }; class RoadSegment_363 { position[] = {3972.08,10992.3,0}; direction = 298.021; sector = "sector_350010500"; }; class RoadSegment_364 { position[] = {4005.32,10231,0}; direction = 126.289; sector = "sector_450010500"; }; class RoadSegment_365 { position[] = {4049.35,10512.6,0}; direction = 47.4271; sector = "sector_450010500"; }; class RoadSegment_366 { position[] = {4049.16,10815.3,0}; direction = 28.6525; sector = "sector_450010500"; }; class RoadSegment_367 { position[] = {4241.86,10063.5,0}; direction = 318.673; sector = "sector_450010500"; }; class RoadSegment_368 { position[] = {4340.15,10380.7,0}; direction = 325.562; sector = "sector_450010500"; }; class RoadSegment_369 { position[] = {4335.78,10816.2,0}; direction = 31.6781; sector = "sector_450010500"; }; class RoadSegment_370 { position[] = {4544.39,10107.6,0}; direction = 320.926; sector = "sector_450010500"; }; class RoadSegment_371 { position[] = {4830.08,10176.8,0}; direction = 213.908; sector = "sector_450010500"; }; class RoadSegment_372 { position[] = {4860.91,10996.4,0}; direction = 321.285; sector = "sector_450010500"; }; class RoadSegment_373 { position[] = {5009.99,10237.6,0}; direction = 97.2665; sector = "sector_550010500"; }; class RoadSegment_374 { position[] = {5040.08,10746.7,0}; direction = 330.606; sector = "sector_550010500"; }; class RoadSegment_375 { position[] = {5234.87,10418.4,0}; direction = 305.869; sector = "sector_550010500"; }; class RoadSegment_376 { position[] = {5299.62,10943.5,0}; direction = 315.007; sector = "sector_550010500"; }; class RoadSegment_377 { position[] = {5331.32,10001,0}; direction = 266.192; sector = "sector_550010500"; }; class RoadSegment_378 { position[] = {5542.45,10386.3,0}; direction = 48.4912; sector = "sector_550010500"; }; class RoadSegment_379 { position[] = {5721.83,10005.9,0}; direction = 38.9334; sector = "sector_550010500"; }; class RoadSegment_380 { position[] = {5715.85,10642.1,0}; direction = 211.708; sector = "sector_550010500"; }; class RoadSegment_381 { position[] = {5875.91,10279.1,0}; direction = 19.7109; sector = "sector_550010500"; }; class RoadSegment_382 { position[] = {5892.71,10871,0}; direction = 224.583; sector = "sector_550010500"; }; class RoadSegment_383 { position[] = {6030.01,10391.3,0}; direction = 55.1847; sector = "sector_650010500"; }; class RoadSegment_384 { position[] = {6035.43,10696,0}; direction = 20.9115; sector = "sector_650010500"; }; class RoadSegment_385 { position[] = {6014.97,10986.7,0}; direction = 33.1288; sector = "sector_650010500"; }; class RoadSegment_386 { position[] = {6319.75,10997.7,0}; direction = 106.061; sector = "sector_650010500"; }; class RoadSegment_387 { position[] = {6896.57,10968,0}; direction = 132.198; sector = "sector_650010500"; }; class RoadSegment_388 { position[] = {7015.82,10838,0}; direction = 135.398; sector = "sector_750010500"; }; class RoadSegment_389 { position[] = {7194.69,10615.3,0}; direction = 144.037; sector = "sector_750010500"; }; class RoadSegment_390 { position[] = {7397.87,10387.7,0}; direction = 320.1; sector = "sector_750010500"; }; class RoadSegment_391 { position[] = {7447.11,10013.7,0}; direction = 202.418; sector = "sector_750010500"; }; class RoadSegment_392 { position[] = {8442.61,10781.1,0}; direction = 166.863; sector = "sector_850010500"; }; class RoadSegment_393 { position[] = {8577.22,10520.5,0}; direction = 126.302; sector = "sector_850010500"; }; class RoadSegment_394 { position[] = {8733.34,10020.8,0}; direction = 45.0188; sector = "sector_850010500"; }; class RoadSegment_395 { position[] = {8829.85,10393.1,0}; direction = 148.128; sector = "sector_850010500"; }; class RoadSegment_396 { position[] = {9038.94,10232.1,0}; direction = 288.269; sector = "sector_950010500"; }; class RoadSegment_397 { position[] = {9270.48,10027.4,0}; direction = 206.649; sector = "sector_950010500"; }; class RoadSegment_398 { position[] = {9524.92,10198.2,0}; direction = 52.782; sector = "sector_950010500"; }; class RoadSegment_399 { position[] = {9698.95,10427.8,0}; direction = 26.4659; sector = "sector_950010500"; }; class RoadSegment_400 { position[] = {9748.73,10711,0}; direction = 177.061; sector = "sector_950010500"; }; class RoadSegment_401 { position[] = {9769.25,10993.7,0}; direction = 193.943; sector = "sector_950010500"; }; class RoadSegment_402 { position[] = {10630.1,10971.9,0}; direction = 313.262; sector = "sector_1050010500"; }; class RoadSegment_403 { position[] = {10842.3,10784,0}; direction = 125.706; sector = "sector_1050010500"; }; class RoadSegment_404 { position[] = {11037.8,10648.1,0}; direction = 305.44; sector = "sector_1150010500"; }; class RoadSegment_405 { position[] = {11023.7,10932.1,0}; direction = 94.1762; sector = "sector_1150010500"; }; class RoadSegment_406 { position[] = {11279.9,10481.5,0}; direction = 120.959; sector = "sector_1150010500"; }; class RoadSegment_407 { position[] = {11324.5,10925.3,0}; direction = 87.8947; sector = "sector_1150010500"; }; class RoadSegment_408 { position[] = {11544.3,10287.1,0}; direction = 313.529; sector = "sector_1150010500"; }; class RoadSegment_409 { position[] = {11636.7,10019.7,0}; direction = 356.46; sector = "sector_1150010500"; }; class RoadSegment_410 { position[] = {11640,10934.8,0}; direction = 283.241; sector = "sector_1150010500"; }; class RoadSegment_411 { position[] = {11893.7,10756.3,0}; direction = 303.551; sector = "sector_1150010500"; }; class RoadSegment_412 { position[] = {12009.7,10685.8,0}; direction = 105.494; sector = "sector_1250010500"; }; class RoadSegment_413 { position[] = {12203.8,10034.6,0}; direction = 183.348; sector = "sector_1250010500"; }; class RoadSegment_414 { position[] = {12268.4,10346.8,0}; direction = 11.7593; sector = "sector_1250010500"; }; class RoadSegment_415 { position[] = {12282.7,10838.3,0}; direction = 34.0653; sector = "sector_1250010500"; }; class RoadSegment_416 { position[] = {12729.3,10980.9,0}; direction = 121.876; sector = "sector_1250010500"; }; class RoadSegment_417 { position[] = {1316.18,11019.7,0}; direction = 204.197; sector = "sector_150011500"; }; class RoadSegment_418 { position[] = {1515.74,11228.3,0}; direction = 25.1238; sector = "sector_150011500"; }; class RoadSegment_419 { position[] = {1592.05,11499.7,0}; direction = 358.038; sector = "sector_150011500"; }; class RoadSegment_420 { position[] = {1686.13,11776,0}; direction = 217.945; sector = "sector_150011500"; }; class RoadSegment_421 { position[] = {1883.98,11520.3,0}; direction = 294.128; sector = "sector_150011500"; }; class RoadSegment_422 { position[] = {1879.8,11981.3,0}; direction = 60.3528; sector = "sector_150011500"; }; class RoadSegment_423 { position[] = {1935.86,11024.2,0}; direction = 192.389; sector = "sector_150011500"; }; class RoadSegment_424 { position[] = {2018.8,11244.9,0}; direction = 24.5327; sector = "sector_250011500"; }; class RoadSegment_425 { position[] = {2028.99,11733.1,0}; direction = 294.246; sector = "sector_250011500"; }; class RoadSegment_426 { position[] = {2292.95,11524.7,0}; direction = 340.978; sector = "sector_250011500"; }; class RoadSegment_427 { position[] = {2390.05,11246.2,0}; direction = 338.698; sector = "sector_250011500"; }; class RoadSegment_428 { position[] = {3130.35,11016.9,0}; direction = 239.914; sector = "sector_350011500"; }; class RoadSegment_429 { position[] = {3412.04,11082.4,0}; direction = 89.0562; sector = "sector_350011500"; }; class RoadSegment_430 { position[] = {3618.92,11277.6,0}; direction = 211.844; sector = "sector_350011500"; }; class RoadSegment_431 { position[] = {3840.42,11050,0}; direction = 284.908; sector = "sector_350011500"; }; class RoadSegment_432 { position[] = {4091.8,11889.1,0}; direction = 159.653; sector = "sector_450011500"; }; class RoadSegment_433 { position[] = {4148.63,11001.3,0}; direction = 25.2649; sector = "sector_450011500"; }; class RoadSegment_434 { position[] = {4188.58,11292.8,0}; direction = 352.607; sector = "sector_450011500"; }; class RoadSegment_435 { position[] = {4152.28,11590.9,0}; direction = 353.703; sector = "sector_450011500"; }; class RoadSegment_436 { position[] = {4392.41,11889.6,0}; direction = 71.8842; sector = "sector_450011500"; }; class RoadSegment_437 { position[] = {4694,11296.4,0}; direction = 166.018; sector = "sector_450011500"; }; class RoadSegment_438 { position[] = {4666.39,11585.6,0}; direction = 183.77; sector = "sector_450011500"; }; class RoadSegment_439 { position[] = {4677.01,11880.5,0}; direction = 340.268; sector = "sector_450011500"; }; class RoadSegment_440 { position[] = {4834.75,11029.3,0}; direction = 141.755; sector = "sector_450011500"; }; class RoadSegment_441 { position[] = {4944.92,11522.7,0}; direction = 107.572; sector = "sector_450011500"; }; class RoadSegment_442 { position[] = {5031.85,11495.7,0}; direction = 288.075; sector = "sector_550011500"; }; class RoadSegment_443 { position[] = {5243.06,11000.1,0}; direction = 135.009; sector = "sector_550011500"; }; class RoadSegment_444 { position[] = {5296.96,11317.8,0}; direction = 115.327; sector = "sector_550011500"; }; class RoadSegment_445 { position[] = {5547.14,11162.9,0}; direction = 315.009; sector = "sector_550011500"; }; class RoadSegment_446 { position[] = {5618.62,11447.2,0}; direction = 46.9902; sector = "sector_550011500"; }; class RoadSegment_447 { position[] = {5797.79,11686.6,0}; direction = 214.496; sector = "sector_550011500"; }; class RoadSegment_448 { position[] = {5832.76,11231.9,0}; direction = 42.2839; sector = "sector_550011500"; }; class RoadSegment_449 { position[] = {6031.2,11012,0}; direction = 31.9817; sector = "sector_650011500"; }; class RoadSegment_450 { position[] = {6004.95,11476.9,0}; direction = 225.152; sector = "sector_650011500"; }; class RoadSegment_451 { position[] = {6020.98,11777.8,0}; direction = 135.009; sector = "sector_650011500"; }; class RoadSegment_452 { position[] = {6254.97,11185.1,0}; direction = 211.977; sector = "sector_650011500"; }; class RoadSegment_453 { position[] = {6341.68,11471.5,0}; direction = 128.462; sector = "sector_650011500"; }; class RoadSegment_454 { position[] = {6541.26,11155.2,0}; direction = 306.785; sector = "sector_650011500"; }; class RoadSegment_455 { position[] = {6641.94,11425.7,0}; direction = 226.899; sector = "sector_650011500"; }; class RoadSegment_456 { position[] = {6749.8,11699.1,0}; direction = 6.98927; sector = "sector_650011500"; }; class RoadSegment_457 { position[] = {6732.97,11997.1,0}; direction = 176.161; sector = "sector_650011500"; }; class RoadSegment_458 { position[] = {6821.29,11034.2,0}; direction = 283.046; sector = "sector_650011500"; }; class RoadSegment_459 { position[] = {6940.93,11378.3,0}; direction = 146.537; sector = "sector_650011500"; }; class RoadSegment_460 { position[] = {7043.97,11229.6,0}; direction = 331.13; sector = "sector_750011500"; }; class RoadSegment_461 { position[] = {7746.75,11550.2,0}; direction = 125.26; sector = "sector_750011500"; }; class RoadSegment_462 { position[] = {7845.74,11209.7,0}; direction = 155.321; sector = "sector_750011500"; }; class RoadSegment_463 { position[] = {8031.77,11144.8,0}; direction = 263.942; sector = "sector_850011500"; }; class RoadSegment_464 { position[] = {8161.35,11425.6,0}; direction = 192.007; sector = "sector_850011500"; }; class RoadSegment_465 { position[] = {8315.93,11113.3,0}; direction = 284.535; sector = "sector_850011500"; }; class RoadSegment_466 { position[] = {8537.52,11326.3,0}; direction = 272.999; sector = "sector_850011500"; }; class RoadSegment_467 { position[] = {8583.2,11017.3,0}; direction = 206.474; sector = "sector_850011500"; }; class RoadSegment_468 { position[] = {9445.69,11893.8,0}; direction = 158.204; sector = "sector_950011500"; }; class RoadSegment_469 { position[] = {9632.09,11669.8,0}; direction = 136.743; sector = "sector_950011500"; }; class RoadSegment_470 { position[] = {9775.37,11017.9,0}; direction = 13.8655; sector = "sector_950011500"; }; class RoadSegment_471 { position[] = {9797.28,11436.4,0}; direction = 345.914; sector = "sector_950011500"; }; class RoadSegment_472 { position[] = {10006.2,11427.8,0}; direction = 123.901; sector = "sector_1050011500"; }; class RoadSegment_473 { position[] = {10296.2,11241.8,0}; direction = 308.699; sector = "sector_1050011500"; }; class RoadSegment_474 { position[] = {10537.5,11063.2,0}; direction = 315.092; sector = "sector_1050011500"; }; class RoadSegment_475 { position[] = {11595,11946.3,0}; direction = 137.322; sector = "sector_1150011500"; }; class RoadSegment_476 { position[] = {11666.3,11643.7,0}; direction = 143.019; sector = "sector_1150011500"; }; class RoadSegment_477 { position[] = {11887.8,11452,0}; direction = 302.118; sector = "sector_1150011500"; }; class RoadSegment_478 { position[] = {12028.7,11348.6,0}; direction = 123.196; sector = "sector_1250011500"; }; class RoadSegment_479 { position[] = {12144.1,11032.9,0}; direction = 231.047; sector = "sector_1250011500"; }; class RoadSegment_480 { position[] = {12427.9,11144.1,0}; direction = 298.94; sector = "sector_1250011500"; }; class RoadSegment_481 { position[] = {12691.8,11005.9,0}; direction = 125.439; sector = "sector_1250011500"; }; class RoadSegment_482 { position[] = {1540.27,12010.7,0}; direction = 252.95; sector = "sector_150012500"; }; class RoadSegment_483 { position[] = {1922.77,12006.8,0}; direction = 56.9982; sector = "sector_150012500"; }; class RoadSegment_484 { position[] = {1925.11,12592.2,0}; direction = 138.113; sector = "sector_150012500"; }; class RoadSegment_485 { position[] = {2030.64,12089.5,0}; direction = 47.7017; sector = "sector_250012500"; }; class RoadSegment_486 { position[] = {2045.46,12446.6,0}; direction = 325.363; sector = "sector_250012500"; }; class RoadSegment_487 { position[] = {2324.95,12599.2,0}; direction = 43.117; sector = "sector_250012500"; }; class RoadSegment_488 { position[] = {4089.75,12030.8,0}; direction = 218.86; sector = "sector_450012500"; }; class RoadSegment_489 { position[] = {4348.81,12159.3,0}; direction = 46.0988; sector = "sector_450012500"; }; class RoadSegment_490 { position[] = {4595.84,12313.1,0}; direction = 22.1322; sector = "sector_450012500"; }; class RoadSegment_491 { position[] = {4593.81,12740.8,0}; direction = 160.263; sector = "sector_450012500"; }; class RoadSegment_492 { position[] = {4645.94,12015.3,0}; direction = 203.444; sector = "sector_450012500"; }; class RoadSegment_493 { position[] = {6732.18,12021.1,0}; direction = 178.617; sector = "sector_650012500"; }; class RoadSegment_494 { position[] = {6907.82,12260.3,0}; direction = 27.919; sector = "sector_650012500"; }; class RoadSegment_495 { position[] = {7011.38,12416.9,0}; direction = 45.0788; sector = "sector_750012500"; }; class RoadSegment_496 { position[] = {7117.59,12693.9,0}; direction = 204.058; sector = "sector_750012500"; }; class RoadSegment_497 { position[] = {9196.29,12640.2,0}; direction = 340.676; sector = "sector_950012500"; }; class RoadSegment_498 { position[] = {9248.47,12350.6,0}; direction = 333.86; sector = "sector_950012500"; }; class RoadSegment_499 { position[] = {9384.07,12082,0}; direction = 137.347; sector = "sector_950012500"; }; class RoadSegment_500 { position[] = {11038.6,12773.3,0}; direction = 145.512; sector = "sector_1150012500"; }; class RoadSegment_501 { position[] = {11199.5,12493.4,0}; direction = 148.496; sector = "sector_1150012500"; }; class RoadSegment_502 { position[] = {11400,12239.8,0}; direction = 137.865; sector = "sector_1150012500"; }; class RoadSegment_503 { position[] = {11552.2,12001.4,0}; direction = 318.535; sector = "sector_1150012500"; }; }; };
26
231
0.600857
ademirt
fa2560b88c3f7c3a96619d68bcf7f70f1ada8a6f
2,062
cpp
C++
pass/lec/lec_test1.cpp
maximiliantiao/livehd
88215f0d6fc395db96e6ed058f00b9205454bd0c
[ "BSD-3-Clause" ]
null
null
null
pass/lec/lec_test1.cpp
maximiliantiao/livehd
88215f0d6fc395db96e6ed058f00b9205454bd0c
[ "BSD-3-Clause" ]
null
null
null
pass/lec/lec_test1.cpp
maximiliantiao/livehd
88215f0d6fc395db96e6ed058f00b9205454bd0c
[ "BSD-3-Clause" ]
null
null
null
// This file is distributed under the BSD 3-Clause License. See LICENSE for details. #include <unistd.h> #include <string> #include "gmock/gmock.h" #include "gtest/gtest.h" #include "eprp_utils.hpp" #include "lgraph.hpp" #include "pass_lec.hpp" #include "ezsat.hpp" #include "ezminisat.hpp" using testing::HasSubstr; class LecMainTest : public ::testing::Test { protected: void SetUp() override {} }; TEST_F(LecMainTest, NoLGraphTest) { //Attempt 2 to add to Git for review ezMiniSAT sat; std::vector<int> vx = sat.vec_var("x", 2); std::vector<int> vy = sat.vec_var("y", 2); //std::vector<int> t = sat.vec_xor(vx, vy); std::vector<int> modelExpressions; std::vector<bool> modelValues; sat.vec_append(modelExpressions, vx); sat.vec_append(modelExpressions, vy); std::vector<int> z1 = sat.vec_not( sat.vec_or( sat.vec_not(vx), vy)); std::vector<int> z2 = sat.vec_not( sat.vec_or( sat.vec_not(vx), sat.vec_not(vy))); std::vector<int> result_out = sat.vec_xor( z1, sat.vec_and( vx, vy)); fmt::print("Formula: (!(!a || b))^(a && b) \n"); if(!sat.solve(modelExpressions, modelValues, result_out)) { fmt::print("SAT solver failed to find a model!\n"); }else{ fmt::print("SAT solver found a model!\n"); for(auto val : modelValues){ fmt::print("{}", val ? 1 : 0); } fmt::print("\n"); } fmt::print("Formula: (!(!a || !b))^(a && b) \n"); std::vector<int> result_out2 = sat.vec_xor( z2, sat.vec_and( vx, vy)); if(!sat.solve(modelExpressions, modelValues, result_out2)) { fmt::print("SAT solver failed to find a model!\n"); }else{ fmt::print("SAT solver found a model!\n"); for(auto val : modelValues){ fmt::print("{}", val ? 1 : 0); } fmt::print("\n"); } // x = sat.vec_model_get_unsigned(modelExpressions, modelValues, sat.vec_var("x", 32)); // FIXME: Add the ezlib calls to check that // // (!(!a || !b )) ^ (a&&b) is not satisfiable // (!(!a || b )) ^ (a&&b) is satisfiable EXPECT_TRUE(true); // FIXME: replace sat/not sat result }
25.775
89
0.628031
maximiliantiao
fa26d3d45072c260ea21c4573022361aa0719a9f
1,615
cpp
C++
codeforces/C - Amr and Chemistry/Wrong answer on test 7.cpp
kzvd4729/Problem-Solving
13b105e725a4c2f8db7fecc5d7a8f932b9fef4ab
[ "MIT" ]
1
2022-02-11T16:55:36.000Z
2022-02-11T16:55:36.000Z
codeforces/C - Amr and Chemistry/Wrong answer on test 7.cpp
kzvd4729/Problem-Solving
13b105e725a4c2f8db7fecc5d7a8f932b9fef4ab
[ "MIT" ]
null
null
null
codeforces/C - Amr and Chemistry/Wrong answer on test 7.cpp
kzvd4729/Problem-Solving
13b105e725a4c2f8db7fecc5d7a8f932b9fef4ab
[ "MIT" ]
null
null
null
/**************************************************************************************** * @author: kzvd4729 created: Mar/29/2018 15:40 * solution_verdict: Wrong answer on test 7 language: GNU C++14 * run_time: 15 ms memory_used: 3900 KB * problem: https://codeforces.com/contest/558/problem/C ****************************************************************************************/ #include<bits/stdc++.h> #define long long long using namespace std; int arr[100005],n,mx,xx,mn=99999999; vector<int>po; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin>>n; for(int i=1;i<=n;i++) { cin>>arr[i]; mx=max(mx,arr[i]); } for(int i=mx;i<=1e6;i*=2)po.push_back(i); for(int i=mx/2;i>=1;i/=2)po.push_back(i); sort(po.begin(),po.end()); mx=0; for(auto x:po) { int cnt=0; for(int i=1;i<=n;i++) { int f=0; if(arr[i]==x)continue; else if(arr[i]<x) { xx=arr[i]; while(xx<x) { xx*=2; cnt++; if(xx==x) { f=1; break; } } } else { xx=arr[i]; while(xx>x) { xx/=2; cnt++; if(xx==x) { f=1; break; } } } if(f==0) { cnt=99999999; break; } } mn=min(mn,cnt); } cout<<mn<<endl; return 0; }
22.746479
111
0.346749
kzvd4729
fa2f882d0f928874c53da676a98e00efe4019cec
512
cpp
C++
exercise/CMake/CMake_07/tutorial.cpp
caliyang/TKeed_annotated_version_LY
55183574c335cd6717b8e1e35b0b7a85a8937e55
[ "MIT" ]
null
null
null
exercise/CMake/CMake_07/tutorial.cpp
caliyang/TKeed_annotated_version_LY
55183574c335cd6717b8e1e35b0b7a85a8937e55
[ "MIT" ]
null
null
null
exercise/CMake/CMake_07/tutorial.cpp
caliyang/TKeed_annotated_version_LY
55183574c335cd6717b8e1e35b0b7a85a8937e55
[ "MIT" ]
null
null
null
// 计算平方根的简单程序。 #include <stdio.h> #include <stdlib.h> #include <math.h> #include "build/Config.h" int main(int argc, char *argv[]) { #ifdef CMAKEDEFINE_VAR1 fprintf(stdout, "CMAKEDEFINE_VAR1 = %d\n", CMAKEDEFINE_VAR1); #endif #ifdef CMAKEDEFINE_VAR2 fprintf(stdout, "CMAKEDEFINE_VAR2 = %d\n", CMAKEDEFINE_VAR2); #endif #ifdef DEFINE_VAR1 fprintf(stdout, "DEFINE_VAR1 = %d\n", DEFINE_VAR1); #endif #ifdef DEFINE_VAR2 fprintf(stdout, "DEFINE_VAR2 = %d\n", DEFINE_VAR2); #endif return 0; }
18.962963
65
0.701172
caliyang
fa308bf1ed8f677b0cca7a5e5cf0e5079f004eee
4,550
cpp
C++
src/game/client/dod/dod_hud_warmuplabel.cpp
cstom4994/SourceEngineRebuild
edfd7f8ce8af13e9d23586318350319a2e193c08
[ "MIT" ]
6
2022-01-23T09:40:33.000Z
2022-03-20T20:53:25.000Z
src/game/client/dod/dod_hud_warmuplabel.cpp
cstom4994/SourceEngineRebuild
edfd7f8ce8af13e9d23586318350319a2e193c08
[ "MIT" ]
null
null
null
src/game/client/dod/dod_hud_warmuplabel.cpp
cstom4994/SourceEngineRebuild
edfd7f8ce8af13e9d23586318350319a2e193c08
[ "MIT" ]
1
2022-02-06T21:05:23.000Z
2022-02-06T21:05:23.000Z
//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // //============================================================================= #include "cbase.h" #include "hud.h" #include "hudelement.h" #include "hud_macros.h" #include "iclientmode.h" #include "vgui_controls/AnimationController.h" #include "vgui_controls/Label.h" #include "vgui/ILocalize.h" #include "vgui/ISurface.h" #include "text_message.h" #include "dod_gamerules.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" //----------------------------------------------------------------------------- // Purpose: Displays current ammunition level //----------------------------------------------------------------------------- class CDODHudWarmupLabel : public vgui::Panel, public CHudElement { DECLARE_CLASS_SIMPLE( CDODHudWarmupLabel, vgui::Panel ); public: CDODHudWarmupLabel( const char *pElementName ); virtual void Reset(); virtual void PerformLayout(); protected: virtual void ApplySchemeSettings( vgui::IScheme *pScheme ); virtual void OnThink(); private: vgui::HFont m_hFont; Color m_bgColor; vgui::Label *m_pWarmupLabel; // "Warmup Mode" vgui::Label *m_pBackground; // black box bool m_bInWarmup; CPanelAnimationVarAliasType( int, m_iTextX, "text_xpos", "8", "proportional_int" ); CPanelAnimationVarAliasType( int, m_iTextY, "text_ypos", "8", "proportional_int" ); }; DECLARE_HUDELEMENT( CDODHudWarmupLabel ); //----------------------------------------------------------------------------- // Purpose: Constructor //----------------------------------------------------------------------------- CDODHudWarmupLabel::CDODHudWarmupLabel( const char *pElementName ) : BaseClass(NULL, "WarmupLabel"), CHudElement( pElementName ) { vgui::Panel *pParent = g_pClientMode->GetViewport(); SetParent( pParent ); SetVisible( false ); SetAlpha( 0 ); m_pBackground = new vgui::Label( this, "Background", "" ); m_pWarmupLabel = new vgui::Label( this, "RoundState_warmup", g_pVGuiLocalize->Find( "#Clan_warmup_mode" ) ); m_pWarmupLabel->SetPaintBackgroundEnabled( false ); m_pWarmupLabel->SetPaintBorderEnabled( false ); m_pWarmupLabel->SizeToContents(); m_pWarmupLabel->SetContentAlignment( vgui::Label::a_west ); m_pWarmupLabel->SetFgColor( GetFgColor() ); m_bInWarmup = false; } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CDODHudWarmupLabel::Reset() { g_pClientMode->GetViewportAnimationController()->StartAnimationSequence( "WarmupLabelHide" ); m_bInWarmup = false; } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CDODHudWarmupLabel::ApplySchemeSettings( vgui::IScheme *pScheme ) { BaseClass::ApplySchemeSettings( pScheme ); SetFgColor( Color(0,0,0,0) ); //GetSchemeColor("RoundStateFg", pScheme) ); m_hFont = pScheme->GetFont( "HudHintText", true ); m_pBackground->SetBgColor( GetSchemeColor("HintMessageBg", pScheme) ); m_pBackground->SetPaintBackgroundType( 2 ); SetAlpha( 0 ); } //----------------------------------------------------------------------------- // Purpose: Resizes the label //----------------------------------------------------------------------------- void CDODHudWarmupLabel::PerformLayout() { BaseClass::PerformLayout(); int wide, tall; GetSize( wide, tall ); // find the widest line int labelWide = m_pWarmupLabel->GetWide(); // find the total height int fontTall = vgui::surface()->GetFontTall( m_hFont ); int labelTall = fontTall; labelWide += m_iTextX*2; labelTall += m_iTextY*2; m_pBackground->SetBounds( 0, 0, labelWide, labelTall ); int xOffset = (labelWide - m_pWarmupLabel->GetWide())/2; m_pWarmupLabel->SetPos( 0 + xOffset, 0 + m_iTextY ); } //----------------------------------------------------------------------------- // Purpose: Updates the label color each frame //----------------------------------------------------------------------------- void CDODHudWarmupLabel::OnThink() { m_pBackground->SetFgColor(GetFgColor()); m_pWarmupLabel->SetFgColor(GetFgColor()); bool bInWarmup = DODGameRules()->IsInWarmup(); if( bInWarmup != m_bInWarmup ) { if( bInWarmup ) { g_pClientMode->GetViewportAnimationController()->StartAnimationSequence( "WarmupLabelShow" ); InvalidateLayout(); } m_bInWarmup = bInWarmup; } }
30.536913
128
0.566154
cstom4994
fa3170c5f62d1af250991c9008570d9d22c7783b
3,469
cpp
C++
src/essence.game/packets/lobby/LobbyPacketHandler.cpp
Deluze/qpang-essence-emulator
943189161fd1fb8022221f24524a18244724edd6
[ "MIT" ]
15
2019-12-04T14:36:09.000Z
2021-06-11T12:00:04.000Z
src/essence.game/packets/lobby/LobbyPacketHandler.cpp
Deluze/qpang-essence-emulator
943189161fd1fb8022221f24524a18244724edd6
[ "MIT" ]
6
2019-12-24T11:28:01.000Z
2020-03-31T00:14:50.000Z
src/essence.game/packets/lobby/LobbyPacketHandler.cpp
Deluze/qpang-essence-emulator
943189161fd1fb8022221f24524a18244724edd6
[ "MIT" ]
21
2019-12-04T14:35:56.000Z
2022-02-14T20:59:31.000Z
#include "LobbyPacketHandler.h" #include "GiftCardEvent.h" #include "UseCraneEvent.h" #include "packets/lobby/incoming/Handshake.h" #include "packets/lobby/incoming/Login.h" #include "packets/lobby/incoming/channel/RequestChannelList.h" #include "packets/lobby/incoming/channel/RequestChannelHost.h" #include "packets/lobby/incoming/inventory/RequestInventory.h" #include "packets/lobby/incoming/equipment/RequestEquippedSkillCards.h" #include "packets/lobby/incoming/shop/RequestShopItems.h" #include "packets/lobby/incoming/shop/RequestShopPackages.h" #include "packets/lobby/incoming/player/RequestCashBalance.h" #include "packets/lobby/incoming/friend/RequestFriendList.h" #include "packets/lobby/incoming/player/RequestPlayerInfo.h" #include "packets/lobby/incoming/memo/RequestMemos.h" #include "packets/lobby/incoming/player/RequestPlayerRanking.h" #include "packets/lobby/incoming/inventory/RequestGifts.h" #include "packets/lobby/incoming/inventory/OpenGift.h" #include "packets/lobby/incoming/inventory/DeleteCard.h" #include "packets/lobby/incoming/equipment/EquipWeapon.h" #include "packets/lobby/incoming/equipment/EquipArmor.h" #include "packets/lobby/incoming/shop/BuyCardEvent.h" #include "packets/lobby/incoming/player/ChangeCharacterEvent.h" #include "packets/lobby/incoming/inventory/EnableFunctionCardEvent.h" #include "packets/lobby/incoming/inventory/DisableFunctionCardEvent.h" #include "packets/lobby/incoming/inventory/ExtendCardEvent.h" #include "packets/lobby/incoming/friend/SendFriendRequestEvent.h" #include "packets/lobby/incoming/friend/DenyIncomingFriendRequestEvent.h" #include "packets/lobby/incoming/friend/CancelOutgoingFriendRequestEvent.h" #include "packets/lobby/incoming/friend/AcceptIncomingFriendRequestEvent.h" #include "packets/lobby/incoming/friend/RemoveFriendEvent.h" #include "packets/lobby/incoming/player/WhisperEvent.h" #include "packets/lobby/incoming/gameroom/RequestGameSettingsEvent.h" #include "packets/lobby/incoming/gameroom/RequestGameRoomsEvent.h" #include "packets/lobby/incoming/player/ResetWinLossEvent.h" #include "packets/lobby/incoming/player/ResetKillDeathEvent.h" LobbyPacketHandler::LobbyPacketHandler() : PacketHandler() { add(1, new Handshake()); add(600, new Login()); add(620, new EquipArmor()); add(623, new EquipWeapon()); add(646, new RequestEquippedSkillCards()); add(652, new DeleteCard()); add(679, new ChangeCharacterEvent()); add(691, new RequestPlayerInfo()); add(694, new RequestFriendList()); add(697, new SendFriendRequestEvent()); add(701, new AcceptIncomingFriendRequestEvent()); add(705, new DenyIncomingFriendRequestEvent()); add(709, new CancelOutgoingFriendRequestEvent()); add(713, new RemoveFriendEvent()); add(725, new RequestMemos()); add(738, new WhisperEvent()); add(742, new OpenGift()); add(745, new RequestGifts()); add(758, new RequestGameRoomsEvent()); add(762, new RequestChannelList()); add(766, new RequestChannelHost()); add(769, new RequestGameSettingsEvent()); add(780, new RequestInventory()); add(791, new RequestPlayerRanking()); add(797, new RequestShopItems()); add(800, new RequestShopPackages()); add(803, new BuyCardEvent()); add(809, new ExtendCardEvent()); add(812, new GiftCardEvent()); add(831, new RequestCashBalance()); add(834, new EnableFunctionCardEvent()); add(841, new ResetWinLossEvent()); add(844, new ResetKillDeathEvent()); add(861, new DisableFunctionCardEvent()); add(897, new UseCraneEvent()); }
44.474359
75
0.794465
Deluze
fa328991ce863536c6dc69779cc6749fee183bfd
1,357
hpp
C++
Versionen/2021_06_15/rmf_ws/install/rmf_task_msgs/include/rmf_task_msgs/msg/detail/task_profile__traits.hpp
flitzmo-hso/flitzmo_agv_control_system
99e8006920c03afbd93e4c7d38b4efff514c7069
[ "MIT" ]
null
null
null
Versionen/2021_06_15/rmf_ws/install/rmf_task_msgs/include/rmf_task_msgs/msg/detail/task_profile__traits.hpp
flitzmo-hso/flitzmo_agv_control_system
99e8006920c03afbd93e4c7d38b4efff514c7069
[ "MIT" ]
null
null
null
Versionen/2021_06_15/rmf_ws/install/rmf_task_msgs/include/rmf_task_msgs/msg/detail/task_profile__traits.hpp
flitzmo-hso/flitzmo_agv_control_system
99e8006920c03afbd93e4c7d38b4efff514c7069
[ "MIT" ]
2
2021-06-21T07:32:09.000Z
2021-08-17T03:05:38.000Z
// generated from rosidl_generator_cpp/resource/idl__traits.hpp.em // with input from rmf_task_msgs:msg/TaskProfile.idl // generated code does not contain a copyright notice #ifndef RMF_TASK_MSGS__MSG__DETAIL__TASK_PROFILE__TRAITS_HPP_ #define RMF_TASK_MSGS__MSG__DETAIL__TASK_PROFILE__TRAITS_HPP_ #include "rmf_task_msgs/msg/detail/task_profile__struct.hpp" #include <rosidl_runtime_cpp/traits.hpp> #include <stdint.h> #include <type_traits> // Include directives for member types // Member 'submission_time' #include "builtin_interfaces/msg/detail/time__traits.hpp" // Member 'description' #include "rmf_task_msgs/msg/detail/task_description__traits.hpp" namespace rosidl_generator_traits { template<> inline const char * data_type<rmf_task_msgs::msg::TaskProfile>() { return "rmf_task_msgs::msg::TaskProfile"; } template<> inline const char * name<rmf_task_msgs::msg::TaskProfile>() { return "rmf_task_msgs/msg/TaskProfile"; } template<> struct has_fixed_size<rmf_task_msgs::msg::TaskProfile> : std::integral_constant<bool, false> {}; template<> struct has_bounded_size<rmf_task_msgs::msg::TaskProfile> : std::integral_constant<bool, false> {}; template<> struct is_message<rmf_task_msgs::msg::TaskProfile> : std::true_type {}; } // namespace rosidl_generator_traits #endif // RMF_TASK_MSGS__MSG__DETAIL__TASK_PROFILE__TRAITS_HPP_
27.693878
66
0.801032
flitzmo-hso
fa3ad12678c135087538cb4d5c14b3d41c0ada5d
11,793
cc
C++
src/parsing/pattern-rewriter.cc
Drieger/v8
93283bf04ae3fd96592b4090e90ac75130aa9d52
[ "BSD-3-Clause" ]
null
null
null
src/parsing/pattern-rewriter.cc
Drieger/v8
93283bf04ae3fd96592b4090e90ac75130aa9d52
[ "BSD-3-Clause" ]
null
null
null
src/parsing/pattern-rewriter.cc
Drieger/v8
93283bf04ae3fd96592b4090e90ac75130aa9d52
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2015 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/ast/ast.h" #include "src/message-template.h" #include "src/objects-inl.h" #include "src/parsing/expression-scope-reparenter.h" #include "src/parsing/parser.h" namespace v8 { namespace internal { // An AST visitor which performs declaration and assignment related tasks, // particularly for destructuring patterns: // // 1. Declares variables from variable proxies (particularly for destructuring // declarations), // 2. Marks destructuring-assigned variable proxies as assigned, and // 3. Rewrites scopes for parameters containing a sloppy eval. // // Historically this also rewrote destructuring assignments/declarations as a // block of multiple assignments, hence the named, however this is now done // during bytecode generation. // // TODO(leszeks): Rename or remove this class class PatternRewriter final : public AstVisitor<PatternRewriter> { public: // Limit the allowed number of local variables in a function. The hard limit // is that offsets computed by FullCodeGenerator::StackOperand and similar // functions are ints, and they should not overflow. In addition, accessing // local variables creates user-controlled constants in the generated code, // and we don't want too much user-controlled memory inside the code (this was // the reason why this limit was introduced in the first place; see // https://codereview.chromium.org/7003030/ ). static const int kMaxNumFunctionLocals = 4194303; // 2^22-1 typedef Parser::DeclarationDescriptor DeclarationDescriptor; static void InitializeVariables( Parser* parser, const DeclarationDescriptor* declaration_descriptor, const Parser::DeclarationParsingResult::Declaration* declaration, ZonePtrList<const AstRawString>* names); private: PatternRewriter(Parser* parser, const DeclarationDescriptor* descriptor, ZonePtrList<const AstRawString>* names, bool has_initializer, int initializer_position = kNoSourcePosition, bool declares_parameter_containing_sloppy_eval = false) : parser_(parser), descriptor_(descriptor), names_(names), initializer_position_(initializer_position), has_initializer_(has_initializer), declares_parameter_containing_sloppy_eval_( declares_parameter_containing_sloppy_eval) {} #define DECLARE_VISIT(type) void Visit##type(v8::internal::type* node); // Visiting functions for AST nodes make this an AstVisitor. AST_NODE_LIST(DECLARE_VISIT) #undef DECLARE_VISIT void RecurseIntoSubpattern(AstNode* pattern) { Visit(pattern); } Expression* Visit(Assignment* assign) { if (parser_->has_error()) return parser_->FailureExpression(); DCHECK_EQ(Token::ASSIGN, assign->op()); Expression* pattern = assign->target(); if (pattern->IsObjectLiteral()) { VisitObjectLiteral(pattern->AsObjectLiteral()); } else { DCHECK(pattern->IsArrayLiteral()); VisitArrayLiteral(pattern->AsArrayLiteral()); } return assign; } void RewriteParameterScopes(Expression* expr); AstNodeFactory* factory() const { return parser_->factory(); } AstValueFactory* ast_value_factory() const { return parser_->ast_value_factory(); } std::vector<void*>* pointer_buffer() { return parser_->pointer_buffer(); } Zone* zone() const { return parser_->zone(); } Scope* scope() const { return parser_->scope(); } Parser* const parser_; const DeclarationDescriptor* descriptor_; ZonePtrList<const AstRawString>* names_; const int initializer_position_; const bool has_initializer_; const bool declares_parameter_containing_sloppy_eval_; DEFINE_AST_VISITOR_MEMBERS_WITHOUT_STACKOVERFLOW() }; void Parser::InitializeVariables( ScopedPtrList<Statement>* statements, const DeclarationDescriptor* declaration_descriptor, const DeclarationParsingResult::Declaration* declaration, ZonePtrList<const AstRawString>* names) { if (has_error()) return; PatternRewriter::InitializeVariables(this, declaration_descriptor, declaration, names); if (declaration->initializer) { int pos = declaration->value_beg_position; if (pos == kNoSourcePosition) { pos = declaration->initializer_position; } Assignment* assignment = factory()->NewAssignment( Token::INIT, declaration->pattern, declaration->initializer, pos); statements->Add(factory()->NewExpressionStatement(assignment, pos)); } } void PatternRewriter::InitializeVariables( Parser* parser, const DeclarationDescriptor* declaration_descriptor, const Parser::DeclarationParsingResult::Declaration* declaration, ZonePtrList<const AstRawString>* names) { PatternRewriter rewriter(parser, declaration_descriptor, names, declaration->initializer != nullptr, declaration->initializer_position, declaration_descriptor->kind == PARAMETER_VARIABLE && parser->scope()->is_block_scope()); rewriter.RecurseIntoSubpattern(declaration->pattern); } void PatternRewriter::VisitVariableProxy(VariableProxy* proxy) { DCHECK_NOT_NULL(descriptor_); Scope* target_scope = scope(); if (declares_parameter_containing_sloppy_eval_) { // When an extra declaration scope needs to be inserted to account for // a sloppy eval in a default parameter or function body, the parameter // needs to be declared in the function's scope, not in the varblock // scope which will be used for the initializer expression. DCHECK_EQ(descriptor_->mode, VariableMode::kLet); target_scope = target_scope->outer_scope(); } Scope* var_init_scope = scope(); #ifdef DEBUG // Calculate the scope we expect the variable to be declared in, for DCHECKs. Scope* expected_declaration_scope = declares_parameter_containing_sloppy_eval_ ? scope()->outer_scope() : (IsLexicalVariableMode(descriptor_->mode) ? scope() : scope()->GetDeclarationScope()); #endif // Declare variable. // Note that we *always* must treat the initial value via a separate init // assignment for variables and constants because the value must be assigned // when the variable is encountered in the source. But the variable/constant // is declared (and set to 'undefined') upon entering the function within // which the variable or constant is declared. Only function variables have // an initial value in the declaration (because they are initialized upon // entering the function). // A declaration of the form: // // var v = x; // // is syntactic sugar for: // // var v; v = x; // // In particular, we need to re-lookup 'v' if it may be a different 'v' than // the 'v' in the declaration (e.g., if we are inside a 'with' statement or // 'catch' block). // // For 'let' and 'const' declared variables the initialization always assigns // to the declared variable. But for var initializations that are declared in // a different scope we need to do a new lookup, so clone the variable for the // declaration and don't consider the original variable resolved. if (has_initializer_ && descriptor_->mode == VariableMode::kVar && !var_init_scope->is_declaration_scope()) { DCHECK_EQ(target_scope->GetDeclarationScope(), expected_declaration_scope); // The cloned variable is not added to the unresolved list of the target // scope, as it is about to be resolved by the declaration. The original // variable will be left unresolved for now. var_init_scope->AddUnresolved(proxy); proxy = factory()->NewVariableProxy(proxy->raw_name(), NORMAL_VARIABLE, proxy->position()); } parser_->DeclareVariable( proxy, descriptor_->kind, descriptor_->mode, Variable::DefaultInitializationFlag(descriptor_->mode), target_scope, descriptor_->declaration_pos); if (parser_->has_error()) return; Variable* var = proxy->var(); DCHECK_NOT_NULL(var); DCHECK(proxy->is_resolved()); DCHECK_EQ(var->scope(), expected_declaration_scope); DCHECK_NE(initializer_position_, kNoSourcePosition); var->set_initializer_position(initializer_position_); if (var->scope()->num_var() > kMaxNumFunctionLocals) { parser_->ReportMessage(MessageTemplate::kTooManyVariables); return; } if (names_) { names_->Add(proxy->raw_name(), zone()); } } // When an extra declaration scope needs to be inserted to account for // a sloppy eval in a default parameter or function body, the expressions // needs to be in that new inner scope which was added after initial // parsing. void PatternRewriter::RewriteParameterScopes(Expression* expr) { if (declares_parameter_containing_sloppy_eval_) { ReparentExpressionScope(parser_->stack_limit(), expr, scope()); } } void PatternRewriter::VisitObjectLiteral(ObjectLiteral* pattern) { for (ObjectLiteralProperty* property : *pattern->properties()) { Expression* key = property->key(); if (!key->IsLiteral()) { // Computed property names contain expressions which might require // scope rewriting. RewriteParameterScopes(key); } RecurseIntoSubpattern(property->value()); } } void PatternRewriter::VisitArrayLiteral(ArrayLiteral* node) { for (Expression* value : *node->values()) { if (value->IsTheHoleLiteral()) continue; RecurseIntoSubpattern(value); } } void PatternRewriter::VisitAssignment(Assignment* node) { DCHECK_EQ(Token::ASSIGN, node->op()); // Initializer may have been parsed in the wrong scope. RewriteParameterScopes(node->value()); RecurseIntoSubpattern(node->target()); } void PatternRewriter::VisitSpread(Spread* node) { RecurseIntoSubpattern(node->expression()); } // =============== UNREACHABLE ============================= #define NOT_A_PATTERN(Node) \ void PatternRewriter::Visit##Node(v8::internal::Node*) { UNREACHABLE(); } NOT_A_PATTERN(BinaryOperation) NOT_A_PATTERN(NaryOperation) NOT_A_PATTERN(Block) NOT_A_PATTERN(BreakStatement) NOT_A_PATTERN(Call) NOT_A_PATTERN(CallNew) NOT_A_PATTERN(CallRuntime) NOT_A_PATTERN(ClassLiteral) NOT_A_PATTERN(CompareOperation) NOT_A_PATTERN(CompoundAssignment) NOT_A_PATTERN(Conditional) NOT_A_PATTERN(ContinueStatement) NOT_A_PATTERN(CountOperation) NOT_A_PATTERN(DebuggerStatement) NOT_A_PATTERN(DoExpression) NOT_A_PATTERN(DoWhileStatement) NOT_A_PATTERN(EmptyStatement) NOT_A_PATTERN(EmptyParentheses) NOT_A_PATTERN(ExpressionStatement) NOT_A_PATTERN(ForInStatement) NOT_A_PATTERN(ForOfStatement) NOT_A_PATTERN(ForStatement) NOT_A_PATTERN(FunctionDeclaration) NOT_A_PATTERN(FunctionLiteral) NOT_A_PATTERN(GetTemplateObject) NOT_A_PATTERN(IfStatement) NOT_A_PATTERN(ImportCallExpression) NOT_A_PATTERN(Literal) NOT_A_PATTERN(NativeFunctionLiteral) NOT_A_PATTERN(Property) NOT_A_PATTERN(RegExpLiteral) NOT_A_PATTERN(ResolvedProperty) NOT_A_PATTERN(ReturnStatement) NOT_A_PATTERN(SloppyBlockFunctionStatement) NOT_A_PATTERN(StoreInArrayLiteral) NOT_A_PATTERN(SuperPropertyReference) NOT_A_PATTERN(SuperCallReference) NOT_A_PATTERN(SwitchStatement) NOT_A_PATTERN(TemplateLiteral) NOT_A_PATTERN(ThisFunction) NOT_A_PATTERN(Throw) NOT_A_PATTERN(TryCatchStatement) NOT_A_PATTERN(TryFinallyStatement) NOT_A_PATTERN(UnaryOperation) NOT_A_PATTERN(VariableDeclaration) NOT_A_PATTERN(WhileStatement) NOT_A_PATTERN(WithStatement) NOT_A_PATTERN(Yield) NOT_A_PATTERN(YieldStar) NOT_A_PATTERN(Await) NOT_A_PATTERN(InitializeClassMembersStatement) #undef NOT_A_PATTERN } // namespace internal } // namespace v8
36.968652
80
0.7401
Drieger
fa47c82e607d77978bdc943a7afa5e6900d5eb69
11,640
hpp
C++
include/lxgui/gui_button.hpp
cschreib/lxgui
b317774d9b4296dda8a70b994950987378a05678
[ "MIT" ]
50
2015-01-15T10:00:31.000Z
2022-02-04T20:45:25.000Z
include/lxgui/gui_button.hpp
cschreib/lxgui
b317774d9b4296dda8a70b994950987378a05678
[ "MIT" ]
88
2020-03-15T17:40:04.000Z
2022-03-15T08:21:44.000Z
include/lxgui/gui_button.hpp
cschreib/lxgui
b317774d9b4296dda8a70b994950987378a05678
[ "MIT" ]
19
2017-03-11T04:32:01.000Z
2022-01-12T22:47:12.000Z
#ifndef LXGUI_GUI_BUTTON_HPP #define LXGUI_GUI_BUTTON_HPP #include <lxgui/lxgui.hpp> #include <lxgui/utils.hpp> #include <lxgui/utils_string.hpp> #include "lxgui/gui_frame.hpp" #include <string> namespace lxgui { namespace gui { class texture; class font_string; /// A #frame with a button that can be clicked. /** This class can handle three different states: "normal", "pushed" * and "disabled". You can provide a different texture for each of * these states, and two different fontstrings for "normal" and * "disabled". * * In addition, you can provide another texture/fontstring for the * "highlight" state (when the mouse is over the button widget). * * Note that there is no fontstring for the "pushed" state: in this * case, the "normal" font is rendered with a slight offset that you * are free to define. * * Note that a button has frame::enable_mouse set to `true` by * default. * * __Events.__ Hard-coded events available to all buttons, in * addition to those from frame: * * - `OnClick`: Triggered when the button is clicked, either when * button::click is called, or after the mouse is released after a * click over the button. * - `OnDoubleClick`: Triggered when the button is double-clicked. * - `OnEnable`: Triggered by button::enable. * - `OnDisable`: Triggered by button::disable. */ class button : public frame { public : enum class state { UP, DOWN, DISABLED }; /// Constructor. explicit button(manager& mManager); /// Prints all relevant information about this widget in a string. /** \param sTab The offset to give to all lines * \return All relevant information about this widget */ std::string serialize(const std::string& sTab) const override; /// Creates the associated Lua glue. void create_glue() override; /// Returns 'true' if this Button can use a script. /** \param sScriptName The name of the script * \note This method can be overriden if needed. */ bool can_use_script(const std::string& sScriptName) const override; /// Calls a script. /** \param sScriptName The name of the script * \param mData Stores scripts arguments * \note Triggered callbacks could destroy the frame. If you need * to use the frame again after calling this function, use * the helper class alive_checker. */ void on_script(const std::string& sScriptName, const event_data& mData = event_data{}) override; /// Calls the on_event script. /** \param mEvent The Event that occured * \note Triggered callbacks could destroy the frame. If you need * to use the frame again after calling this function, use * the helper class alive_checker. */ void on_event(const event& mEvent) override; /// Copies an uiobject's parameters into this Button (inheritance). /** \param mObj The uiobject to copy */ void copy_from(const uiobject& mObj) override; /// Sets this button's text. /** \param sText The new text */ virtual void set_text(const utils::ustring& sText); /// Returns this button's text. /** \return This button's text */ const utils::ustring& get_text() const; /// Returns this button's normal texture. /** \return This button's normal texture */ const utils::observer_ptr<texture>& get_normal_texture() { return pNormalTexture_; } /// Returns this button's normal texture. /** \return This button's normal texture */ utils::observer_ptr<const texture> get_normal_texture() const { return pNormalTexture_; } /// Returns this button's pushed texture. /** \return This button's pushed texture */ const utils::observer_ptr<texture>& get_pushed_texture() { return pPushedTexture_; } /// Returns this button's pushed texture. /** \return This button's pushed texture */ utils::observer_ptr<const texture> get_pushed_texture() const { return pPushedTexture_; } /// Returns this button's disabled texture. /** \return This button's disabled texture */ const utils::observer_ptr<texture>& get_disabled_texture() { return pDisabledTexture_; } /// Returns this button's disabled texture. /** \return This button's disabled texture */ utils::observer_ptr<const texture> get_disabled_texture() const { return pDisabledTexture_; } /// Returns this button's highlight texture. /** \return This button's highlight texture */ const utils::observer_ptr<texture>& get_highlight_texture() { return pHighlightTexture_; } /// Returns this button's highlight texture. /** \return This button's highlight texture */ utils::observer_ptr<const texture> get_highlight_texture() const { return pHighlightTexture_; } /// Returns this button's normal text. /** \return This button's normal text */ const utils::observer_ptr<font_string>& get_normal_text() { return pNormalText_; } /// Returns this button's normal text. /** \return This button's normal text */ utils::observer_ptr<const font_string> get_normal_text() const { return pNormalText_; } /// Returns this button's highlight text. /** \return This button's highlight text */ const utils::observer_ptr<font_string>& get_highlight_text() { return pHighlightText_; } /// Returns this button's highlight text. /** \return This button's highlight text */ utils::observer_ptr<const font_string> get_highlight_text() const { return pHighlightText_; } /// Returns this button's disabled text. /** \return This button's disabled text */ const utils::observer_ptr<font_string>& get_disabled_text() { return pDisabledText_; } /// Returns this button's disabled text. /** \return This button's disabled text */ utils::observer_ptr<const font_string> get_disabled_text() const { return pDisabledText_; } /// Returns the currently displayed text object. /** \return The currently displayed text object */ const utils::observer_ptr<font_string>& get_current_font_string() { return pCurrentFontString_; } /// Returns the currently displayed text object. /** \return The currently displayed text object */ utils::observer_ptr<const font_string> get_current_font_string() const { return pCurrentFontString_; } /// Sets this button's normal texture. /** \param pTexture The new texture */ void set_normal_texture(utils::observer_ptr<texture> pTexture); /// Sets this button's pushed texture. /** \param pTexture The new texture */ void set_pushed_texture(utils::observer_ptr<texture> pTexture); /// Sets this button's disabled texture. /** \param pTexture The new texture */ void set_disabled_texture(utils::observer_ptr<texture> pTexture); /// Sets this button's highlight texture. /** \param pTexture The new texture */ void set_highlight_texture(utils::observer_ptr<texture> pTexture); /// Sets this button's normal text. /** \param pFont The new text object */ void set_normal_text(utils::observer_ptr<font_string> pFont); /// Sets this button's highlight text. /** \param pFont The new text object */ void set_highlight_text(utils::observer_ptr<font_string> pFont); /// Sets this button's disabled text. /** \param pFont The new text object */ void set_disabled_text(utils::observer_ptr<font_string> pFont); /// Disables this Button. /** \note A disabled button doesn't receive any input. */ virtual void disable(); /// Enables this Button. virtual void enable(); /// Checks if this Button is enabled. /** \return 'true' if this Button is enabled */ bool is_enabled() const; /// Pushed this Button. /** \note This function only has a visual impact : * the OnClick() handler is not called. */ virtual void push(); /// Releases this Button. /** \note This function only has a visual impact : * the OnClick() handler is not called. */ virtual void release(); /// Highlights this Button. /** \note The Button will be highlighted even if the * mouse is not over it. It will stop when the * mouse leaves it. */ virtual void highlight(); /// Unlights this Button. /** \note The Button will be unlighted even if the * mouse is over it. It will highlight again * when the mouse leaves then enters its region. */ virtual void unlight(); /// Returns this button's state. /** \return This button's state (see ButtonState) */ state get_button_state() const; /// Locks this button's highlighting. /** \note The button will always be highlighted * until you call unlock_highlight(). */ void lock_highlight(); /// Unlocks this button's highlighting. void unlock_highlight(); /// Sets this button's pushed text offset. /** \param lOffset The pushed text offset */ void set_pushed_text_offset(const vector2f& lOffset); /// Returns this button's pushed text offset. /** \return This button's pushed text offset */ const vector2f& get_pushed_text_offset() const; /// Registers this widget class to the provided Lua state static void register_on_lua(sol::state& mLua); static constexpr const char* CLASS_NAME = "Button"; protected : void parse_attributes_(const layout_node& mNode) override; void parse_all_nodes_before_children_(const layout_node& mNode) override; state mState_ = state::UP; bool bHighlighted_ = false; bool bLockHighlight_ = false; utils::ustring sText_; utils::observer_ptr<texture> pNormalTexture_ = nullptr; utils::observer_ptr<texture> pPushedTexture_ = nullptr; utils::observer_ptr<texture> pDisabledTexture_ = nullptr; utils::observer_ptr<texture> pHighlightTexture_ = nullptr; utils::observer_ptr<font_string> pNormalText_ = nullptr; utils::observer_ptr<font_string> pHighlightText_ = nullptr; utils::observer_ptr<font_string> pDisabledText_ = nullptr; utils::observer_ptr<font_string> pCurrentFontString_ = nullptr; vector2f mPushedTextOffset_ = vector2f::ZERO; }; } } #endif
37.070064
111
0.604467
cschreib
fa48027134baf80cd892629cd2afc5faf917983e
1,474
cpp
C++
src/Libs/CodecUtils/IntraDCH263VlcDecoder.cpp
miseri/rtp_plus_plus
244ddd86f40f15247dd39ae7f9283114c2ef03a2
[ "BSD-3-Clause" ]
1
2021-07-14T08:15:05.000Z
2021-07-14T08:15:05.000Z
src/Libs/CodecUtils/IntraDCH263VlcDecoder.cpp
7956968/rtp_plus_plus
244ddd86f40f15247dd39ae7f9283114c2ef03a2
[ "BSD-3-Clause" ]
null
null
null
src/Libs/CodecUtils/IntraDCH263VlcDecoder.cpp
7956968/rtp_plus_plus
244ddd86f40f15247dd39ae7f9283114c2ef03a2
[ "BSD-3-Clause" ]
2
2021-07-14T08:15:02.000Z
2021-07-14T08:56:10.000Z
/** @file MODULE : IntraDCH263VlcDecoder TAG : IDH263VD FILE NAME : IntraDCH263VlcDecoder.cpp DESCRIPTION : A class to implement a Intra DC coeff decoder as defined in the ITU-T Recommendation H.263 (02/98) Section 5.4.1 Page 41. There is no Esc coding requirements. It implements the IVlcDecoder interface. REVISION HISTORY : COPYRIGHT : RESTRICTIONS : =========================================================================== */ #ifdef _WINDOWS #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include <windows.h> #else #include <stdio.h> #endif #include "IntraDCH263VlcDecoder.h" /* --------------------------------------------------------------------------- Interface Methods. --------------------------------------------------------------------------- */ /** Decode an INTRADC value from the stream. The H.263 standard defines a fixed length code of 8 bits where 0 and 128 are not used. Read the codeword from the bit stream and return it. _numCodeBits is set. @param bsr : Bit stream to read from. @return : The decoded INTRADC value. */ int IntraDCH263VlcDecoder::Decode(IBitStreamReader* bsr) { _numCodeBits = 8; // INTRADC is an 8 FLC. int coeff = bsr->Read(8); if( (coeff == 0)||(coeff == 128) ) return(0); // Implies an error. if(coeff != 255) return(coeff); else return(128); }//end Decode.
26.321429
79
0.56038
miseri
fa580804fb6bc869cf448eb82e0b774c54c56bb0
1,561
cpp
C++
Leetcode Solution/Top 100 Liked Questions/Hard/84. Largest Rectangle in Histogram.cpp
bilwa496/Placement-Preparation
bd32ee717f671d95c17f524ed28b0179e0feb044
[ "MIT" ]
169
2021-05-30T10:02:19.000Z
2022-03-27T18:09:32.000Z
Leetcode Solution/Top 100 Liked Questions/Hard/84. Largest Rectangle in Histogram.cpp
bilwa496/Placement-Preparation
bd32ee717f671d95c17f524ed28b0179e0feb044
[ "MIT" ]
1
2021-10-02T14:46:26.000Z
2021-10-02T14:46:26.000Z
Leetcode Solution/Top 100 Liked Questions/Hard/84. Largest Rectangle in Histogram.cpp
bilwa496/Placement-Preparation
bd32ee717f671d95c17f524ed28b0179e0feb044
[ "MIT" ]
44
2021-05-30T19:56:29.000Z
2022-03-17T14:49:00.000Z
class Solution { public: int largestRectangleArea(vector<int>& h) { vector<int> l; vector<int> r; stack<int> sl; stack<int> sr; int n=h.size(); for(int i=n-1;i>=0;i--) { while(sr.size()>0 && h[sr.top()]>=h[i]) { sr.pop(); } if(sr.size()==0) { r.push_back(n); } else { r.push_back(sr.top()); } sr.push(i); } reverse(r.begin(),r.end()); for(int i=0;i<n;i++) { while(sl.size()>0 && h[sl.top()]>=h[i]) { sl.pop(); } if(sl.size()==0) { l.push_back(-1); } else { l.push_back(sl.top()); } sl.push(i); } long long int ans=0; long long int width[n]; for(int i=0;i<n;i++) { width[i] = r[i]-l[i]-1; ans = max(ans,(width[i])*h[i]); } return ans; } };
26.457627
59
0.232543
bilwa496
fa5c65dfc320721c37a2ede54fb5f64186cc6094
2,491
cpp
C++
TouchMindLib/touchmind/control/StatusBar.cpp
yohei-yoshihara/TouchMind
3ad878aacde7322ae7c4f94d462e0a2d4a24d3fa
[ "MIT" ]
15
2015-07-10T05:03:27.000Z
2021-06-08T08:24:46.000Z
TouchMindLib/touchmind/control/StatusBar.cpp
yohei-yoshihara/TouchMind
3ad878aacde7322ae7c4f94d462e0a2d4a24d3fa
[ "MIT" ]
null
null
null
TouchMindLib/touchmind/control/StatusBar.cpp
yohei-yoshihara/TouchMind
3ad878aacde7322ae7c4f94d462e0a2d4a24d3fa
[ "MIT" ]
10
2015-01-04T01:23:56.000Z
2020-12-29T11:35:47.000Z
#include "StdAfx.h" #include "touchmind/Common.h" #include "touchmind/logging/Logging.h" #include "touchmind/control/StatusBar.h" touchmind::control::StatusBar::StatusBar(void) : m_hWnd(nullptr) , m_parehtHWnd(nullptr) , m_numberOfParts(0) { } touchmind::control::StatusBar::~StatusBar(void) { } HRESULT touchmind::control::StatusBar::Initialize(HWND hwndParent, int idStatus, HINSTANCE hInstance, int numberOfParts) { HRESULT hr; m_parehtHWnd = hwndParent; INITCOMMONCONTROLSEX initCtrls; initCtrls.dwSize = sizeof(initCtrls); initCtrls.dwICC = ICC_BAR_CLASSES; if (!InitCommonControlsEx(&initCtrls)) { LOG(SEVERITY_LEVEL_ERROR) << L"InitCommonControlsEx failed"; return E_FAIL; } m_hWnd = CreateWindowEx(0, STATUSCLASSNAME, nullptr, SBARS_SIZEGRIP | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hwndParent, (HMENU)idStatus, hInstance, nullptr); hr = m_hWnd != nullptr ? S_OK : E_FAIL; if (FAILED(hr)) { LOG(SEVERITY_LEVEL_ERROR) << L"Create status bar failed"; return hr; } SetParts(numberOfParts); return hr; } RECT touchmind::control::StatusBar::GetRect() { RECT rect; GetClientRect(m_hWnd, &rect); return rect; } void touchmind::control::StatusBar::OnSize(WPARAM wParam, LPARAM lParam) { SendMessage(m_hWnd, WM_SIZE, wParam, lParam); SetParts(m_numberOfParts); } void touchmind::control::StatusBar::SetParts(int numberOfParts) { m_numberOfParts = numberOfParts; RECT clientRect; GetClientRect(m_parehtHWnd, &clientRect); HLOCAL hlocal = LocalAlloc(LHND, sizeof(int) * numberOfParts); PINT paParts = (PINT)LocalLock(hlocal); int nWidth = clientRect.right / numberOfParts; for (int i = 0; i < numberOfParts; ++i) { paParts[i] = nWidth; nWidth += nWidth; } SendMessage(m_hWnd, SB_SETPARTS, (WPARAM)numberOfParts, (LPARAM)paParts); LocalUnlock(hlocal); LocalFree(hlocal); } void touchmind::control::StatusBar::SetColor(COLORREF color) { SendMessage(m_hWnd, SB_SETBKCOLOR, 0, (LPARAM)color); } void touchmind::control::StatusBar::SetText(int index, const std::wstring &text) { SendMessage(m_hWnd, SB_SETTEXT, index, (LPARAM)text.c_str()); } void touchmind::control::StatusBar::SetText(int index, const wchar_t *text) { SendMessage(m_hWnd, SB_SETTEXT, index, (LPARAM)text); } void touchmind::control::StatusBar::ClearText(int index) { WCHAR *s = L""; SendMessage(m_hWnd, SB_SETTEXT, index, (LPARAM)s); }
28.306818
118
0.702529
yohei-yoshihara
fa63a0e4c7a3e9edae88e956c8a15d2deb163a3b
1,729
cpp
C++
iroha-master/shared_model/backend/protobuf/queries/impl/proto_get_account_assets.cpp
rogelcorral/My-Iroha-Playground
c370a114e6039f8667c2b68b7dcb10e4c387c67d
[ "Apache-2.0" ]
1
2019-06-23T12:47:19.000Z
2019-06-23T12:47:19.000Z
shared_model/backend/protobuf/queries/impl/proto_get_account_assets.cpp
ecsantana76/iroha
9cc430bb2c8eb885393e2a636fa92d1e605443ae
[ "Apache-2.0" ]
8
2017-12-25T05:25:58.000Z
2018-01-20T10:12:45.000Z
shared_model/backend/protobuf/queries/impl/proto_get_account_assets.cpp
ecsantana76/iroha
9cc430bb2c8eb885393e2a636fa92d1e605443ae
[ "Apache-2.0" ]
1
2018-01-18T18:23:09.000Z
2018-01-18T18:23:09.000Z
/** * Copyright Soramitsu Co., Ltd. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ #include "backend/protobuf/queries/proto_get_account_assets.hpp" namespace shared_model { namespace proto { template <typename QueryType> GetAccountAssets::GetAccountAssets(QueryType &&query) : CopyableProto(std::forward<QueryType>(query)), account_assets_{proto_->payload().get_account_assets()}, pagination_meta_{ [this]() -> boost::optional<const AssetPaginationMeta> { if (this->account_assets_.has_pagination_meta()) { return AssetPaginationMeta{ this->account_assets_.pagination_meta()}; } else { return boost::none; } }()} {} template GetAccountAssets::GetAccountAssets( GetAccountAssets::TransportType &); template GetAccountAssets::GetAccountAssets( const GetAccountAssets::TransportType &); template GetAccountAssets::GetAccountAssets( GetAccountAssets::TransportType &&); GetAccountAssets::GetAccountAssets(const GetAccountAssets &o) : GetAccountAssets(o.proto_) {} GetAccountAssets::GetAccountAssets(GetAccountAssets &&o) noexcept : GetAccountAssets(std::move(o.proto_)) {} const interface::types::AccountIdType &GetAccountAssets::accountId() const { return account_assets_.account_id(); } boost::optional<const interface::AssetPaginationMeta &> GetAccountAssets::paginationMeta() const { if (pagination_meta_) { return pagination_meta_.value(); } return boost::none; } } // namespace proto } // namespace shared_model
33.25
80
0.65587
rogelcorral
fa6a48b7b99af2f705ab9113f5451695d9619938
4,353
cpp
C++
bmlb/src/v20180625/model/CreateLoadBalancerBzConf.cpp
sinjoywong/tencentcloud-sdk-cpp
1b931d20956a90b15a6720f924e5c69f8786f9f4
[ "Apache-2.0" ]
null
null
null
bmlb/src/v20180625/model/CreateLoadBalancerBzConf.cpp
sinjoywong/tencentcloud-sdk-cpp
1b931d20956a90b15a6720f924e5c69f8786f9f4
[ "Apache-2.0" ]
null
null
null
bmlb/src/v20180625/model/CreateLoadBalancerBzConf.cpp
sinjoywong/tencentcloud-sdk-cpp
1b931d20956a90b15a6720f924e5c69f8786f9f4
[ "Apache-2.0" ]
null
null
null
/* * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved. * * 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 <tencentcloud/bmlb/v20180625/model/CreateLoadBalancerBzConf.h> using TencentCloud::CoreInternalOutcome; using namespace TencentCloud::Bmlb::V20180625::Model; using namespace std; CreateLoadBalancerBzConf::CreateLoadBalancerBzConf() : m_bzPayModeHasBeenSet(false), m_bzL4MetricsHasBeenSet(false), m_bzL7MetricsHasBeenSet(false) { } CoreInternalOutcome CreateLoadBalancerBzConf::Deserialize(const rapidjson::Value &value) { string requestId = ""; if (value.HasMember("BzPayMode") && !value["BzPayMode"].IsNull()) { if (!value["BzPayMode"].IsString()) { return CoreInternalOutcome(Error("response `CreateLoadBalancerBzConf.BzPayMode` IsString=false incorrectly").SetRequestId(requestId)); } m_bzPayMode = string(value["BzPayMode"].GetString()); m_bzPayModeHasBeenSet = true; } if (value.HasMember("BzL4Metrics") && !value["BzL4Metrics"].IsNull()) { if (!value["BzL4Metrics"].IsString()) { return CoreInternalOutcome(Error("response `CreateLoadBalancerBzConf.BzL4Metrics` IsString=false incorrectly").SetRequestId(requestId)); } m_bzL4Metrics = string(value["BzL4Metrics"].GetString()); m_bzL4MetricsHasBeenSet = true; } if (value.HasMember("BzL7Metrics") && !value["BzL7Metrics"].IsNull()) { if (!value["BzL7Metrics"].IsString()) { return CoreInternalOutcome(Error("response `CreateLoadBalancerBzConf.BzL7Metrics` IsString=false incorrectly").SetRequestId(requestId)); } m_bzL7Metrics = string(value["BzL7Metrics"].GetString()); m_bzL7MetricsHasBeenSet = true; } return CoreInternalOutcome(true); } void CreateLoadBalancerBzConf::ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const { if (m_bzPayModeHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "BzPayMode"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_bzPayMode.c_str(), allocator).Move(), allocator); } if (m_bzL4MetricsHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "BzL4Metrics"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_bzL4Metrics.c_str(), allocator).Move(), allocator); } if (m_bzL7MetricsHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "BzL7Metrics"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_bzL7Metrics.c_str(), allocator).Move(), allocator); } } string CreateLoadBalancerBzConf::GetBzPayMode() const { return m_bzPayMode; } void CreateLoadBalancerBzConf::SetBzPayMode(const string& _bzPayMode) { m_bzPayMode = _bzPayMode; m_bzPayModeHasBeenSet = true; } bool CreateLoadBalancerBzConf::BzPayModeHasBeenSet() const { return m_bzPayModeHasBeenSet; } string CreateLoadBalancerBzConf::GetBzL4Metrics() const { return m_bzL4Metrics; } void CreateLoadBalancerBzConf::SetBzL4Metrics(const string& _bzL4Metrics) { m_bzL4Metrics = _bzL4Metrics; m_bzL4MetricsHasBeenSet = true; } bool CreateLoadBalancerBzConf::BzL4MetricsHasBeenSet() const { return m_bzL4MetricsHasBeenSet; } string CreateLoadBalancerBzConf::GetBzL7Metrics() const { return m_bzL7Metrics; } void CreateLoadBalancerBzConf::SetBzL7Metrics(const string& _bzL7Metrics) { m_bzL7Metrics = _bzL7Metrics; m_bzL7MetricsHasBeenSet = true; } bool CreateLoadBalancerBzConf::BzL7MetricsHasBeenSet() const { return m_bzL7MetricsHasBeenSet; }
29.612245
148
0.713531
sinjoywong
fa7577a814aae7199e5a2708e2b61d046f0031aa
570
hpp
C++
include/range.hpp
richard-vock/graphene
1a721894a9972c8865a1ad0861d500cef8436932
[ "Unlicense" ]
null
null
null
include/range.hpp
richard-vock/graphene
1a721894a9972c8865a1ad0861d500cef8436932
[ "Unlicense" ]
null
null
null
include/range.hpp
richard-vock/graphene
1a721894a9972c8865a1ad0861d500cef8436932
[ "Unlicense" ]
null
null
null
#pragma once #include "common.hpp" #include "tracked.hpp" namespace graphene::property { class range { public: range(std::string label, shared<float> value, bounds<float> range); template <typename F> range(std::string label, shared<float> value, bounds<float> range, F func); template <typename F> range(std::string label, float default_value, bounds<float> range, F func); void render(); protected: std::string label_; bounds<float> range_; tracked<float> value_; }; } // namespace graphene::property #include "range.ipp"
19
79
0.687719
richard-vock
fa7688df8851ae8028ae51f3a8094ed48996f722
6,655
hpp
C++
static-strings/static-strings.hpp
erdavila/c-plus-plus-11
ca5d1a1f902ce1004928e91f8f59909f676f2b0e
[ "MIT" ]
null
null
null
static-strings/static-strings.hpp
erdavila/c-plus-plus-11
ca5d1a1f902ce1004928e91f8f59909f676f2b0e
[ "MIT" ]
null
null
null
static-strings/static-strings.hpp
erdavila/c-plus-plus-11
ca5d1a1f902ce1004928e91f8f59909f676f2b0e
[ "MIT" ]
null
null
null
#ifndef STATIC_STRINGS_HPP_ #define STATIC_STRINGS_HPP_ #include <string> #include <type_traits> namespace static_string { namespace __impl { template <size_t Index, typename Char, Char... chars> struct char_at; template <size_t N, typename Char, Char x, Char... chars> struct find; template <size_t N, size_t Found, typename Char, Char x, Char... chars> struct rfind; template <size_t Pos, size_t Len, typename Char, Char... chars> struct substring; } /* namespace __impl */ enum { NOT_FOUND = static_cast<size_t>(-1) }; template <typename Char, Char...> struct static_string; template <typename Char> struct static_string<Char> { using char_type = Char; using string_type = std::basic_string<Char>; enum { size = 0 }; inline static string_type string() { return {}; } template <Char x> using find = typename __impl::find<0, Char, x>; template <Char x> using rfind = typename __impl::rfind<0, NOT_FOUND, Char, x>; template <size_t Pos, size_t Len> using substring = typename __impl::substring<Pos, Len, Char>::type; private: template <typename C, C...> friend struct static_string; inline static void append_to(string_type& string) {} }; template <typename Char, Char c, Char... chars> struct static_string<Char, c, chars...> { using char_type = Char; using string_type = std::basic_string<Char>; enum { size = 1 + sizeof...(chars) }; inline static string_type string() { string_type result; result.reserve(size); append_to(result); return result; } template <size_t Index> using char_at = typename __impl::char_at<Index, Char, c, chars...>; template <Char x> using find = typename __impl::find<0, Char, x, c, chars...>; template <Char x> using rfind = typename __impl::rfind<0, NOT_FOUND, Char, x, c, chars...>; template <size_t Pos, size_t Len> using substring = typename __impl::substring<Pos, Len, Char, c, chars...>::type; private: template <typename C, C...> friend struct static_string; inline static void append_to(string_type& string) { string += c; static_string<Char, chars...>::append_to(string); } }; namespace __impl { template <typename StrProvider, size_t len, typename Char, char... chars> struct build_from_provider { using type = typename build_from_provider<StrProvider, len - 1, Char, StrProvider::str()[len - 1], chars... >::type; }; template <typename StrProvider, typename Char, char... chars> struct build_from_provider<StrProvider, 0, Char, chars...> { using type = static_string<Char, chars...>; }; template <typename StrProvider> struct has_size { template <size_t N> struct Check; template <typename T> static constexpr bool test(Check<T::size>*) { return true; } // SFINAE! template <typename T> static constexpr bool test(...) { return false; } static constexpr bool value = test<StrProvider>(nullptr); }; template <typename StrProvider, bool = has_size<StrProvider>::value> struct size_for; template <typename StrProvider> struct size_for<StrProvider, true> { enum { value = StrProvider::size }; }; template <typename StrProvider> struct size_for<StrProvider, false> { template <typename Char> static constexpr size_t str_length(const Char* str) { return str[0] == Char(0) ? 0 : (1 + str_length(str + 1)); } enum { value = str_length(StrProvider::str()) }; }; template <typename... SSs> struct concat; template <typename Char, Char... chars> struct concat<static_string<Char, chars...>> { using type = static_string<Char, chars...>; }; template <typename Char, Char... chars1, Char... chars2, typename... SSs> struct concat<static_string<Char, chars1...>, static_string<Char, chars2...>, SSs...> { using type = typename concat<static_string<Char, chars1..., chars2...>, SSs...>::type; }; template <typename Char, Char c, Char... chars> struct char_at<0, Char, c, chars...> { static constexpr Char value = c; }; template <size_t Index, typename Char, Char c, Char... chars> struct char_at<Index, Char, c, chars...> { static constexpr Char value = char_at<Index - 1, Char, chars...>::value; }; template <size_t N, typename Char, Char x> struct find<N, Char, x> { static constexpr size_t value = NOT_FOUND; }; template <size_t N, typename Char, Char x, Char... chars> struct find<N, Char, x, x, chars...> { static constexpr size_t value = N; }; template <size_t N, typename Char, Char x, Char c, Char... chars> struct find<N, Char, x, c, chars...> { static constexpr size_t value = find<N + 1, Char, x, chars...>::value; }; template <size_t N, size_t Found, typename Char, Char x> struct rfind<N, Found, Char, x> { static constexpr size_t value = Found; }; template <size_t N, size_t Found, typename Char, Char x, Char... chars> struct rfind<N, Found, Char, x, x, chars...> { static constexpr size_t value = rfind<N + 1, N, Char, x, chars...>::value; }; template <size_t N, size_t Found, typename Char, Char x, Char c, Char... chars> struct rfind<N, Found, Char, x, c, chars...> { static constexpr size_t value = rfind<N + 1, Found, Char, x, chars...>::value; }; template <typename Char, Char... chars> struct substring<0, 0, Char, chars...> { using type = static_string<Char>; }; template <typename Char, Char c, Char... chars> struct substring<0, 0, Char, c, chars...> { using type = static_string<Char>; }; template <size_t Len, typename Char, Char c, Char... chars> struct substring<0, Len, Char, c, chars...> { private: using first = static_string<Char, c>; using rest = typename substring<0, Len - 1, Char, chars...>::type; public: using type = typename concat<first, rest>::type; }; template <size_t Pos, size_t Len, typename Char, Char c, Char... chars> struct substring<Pos, Len, Char, c, chars...> { using type = typename substring<Pos - 1, Len, Char, chars...>::type; }; } /* namespace __impl */ template <typename StrProvider, size_t len = __impl::size_for<StrProvider>::value> using from_provider = typename __impl::build_from_provider<StrProvider, len, typename std::decay<decltype(StrProvider::str()[0])>::type >::type; template <typename... SSs> using concat = typename __impl::concat<SSs...>::type; } /* namespace static_string */ #endif /* STATIC_STRINGS_HPP_ */
27.052846
117
0.643426
erdavila
fa76aa97e42de7040426ae5a5350a61926295937
190
hpp
C++
src/algorithm/Point.hpp
KennFatt/ConvexHull
f1f8321e3a090f49f416b63c13f647459a532be8
[ "MIT" ]
null
null
null
src/algorithm/Point.hpp
KennFatt/ConvexHull
f1f8321e3a090f49f416b63c13f647459a532be8
[ "MIT" ]
null
null
null
src/algorithm/Point.hpp
KennFatt/ConvexHull
f1f8321e3a090f49f416b63c13f647459a532be8
[ "MIT" ]
null
null
null
#ifndef __KF_POINT_H #define __KF_POINT_H namespace kf { struct Point { int x; int y; Point(int _x, int _y) : x(_x) , y(_y) {} }; } // namespace kf #endif
11.176471
25
0.542105
KennFatt
fa7b1678ac545061305879fedb981e225b24e295
696
cpp
C++
src/core/music/trackmetadata.cpp
jimmypoms/couch
2371ad236a04bf9623098da9b1fdec10997f1dd0
[ "Apache-2.0" ]
null
null
null
src/core/music/trackmetadata.cpp
jimmypoms/couch
2371ad236a04bf9623098da9b1fdec10997f1dd0
[ "Apache-2.0" ]
null
null
null
src/core/music/trackmetadata.cpp
jimmypoms/couch
2371ad236a04bf9623098da9b1fdec10997f1dd0
[ "Apache-2.0" ]
null
null
null
/* * trackmetadata.cpp * * Created on: 14 Feb 2016 * Author: jimmypoms */ #include "trackmetadata.h" TrackMetadata::TrackMetadata(QObject *parent) : AlbumMetadata(parent), m_trackPosition(0) { } const QString &TrackMetadata::track() const { return m_track; } void TrackMetadata::setTrack(const QString& track) { if (m_track != track) { m_track = track; Q_EMIT trackChanged(); } } int TrackMetadata::trackPosition() const { return m_trackPosition; } void TrackMetadata::setTrackPosition(int trackPosition) { if (m_trackPosition != trackPosition) { m_trackPosition = trackPosition; Q_EMIT trackPositionChanged(); } }
17.4
55
0.66954
jimmypoms
fa7c6f24c465a7a710aa780ef4de4cd3fa7b65e6
1,863
cpp
C++
crystal/storage/builder/test/RecordBuilderTest.cpp
crystal-dataop/crystal
128e1dcde1ef68cabadab9b16d45f5199f0afe5c
[ "Apache-2.0" ]
2
2020-10-02T03:31:50.000Z
2020-12-31T09:41:48.000Z
crystal/storage/builder/test/RecordBuilderTest.cpp
crystal-dataop/crystal
128e1dcde1ef68cabadab9b16d45f5199f0afe5c
[ "Apache-2.0" ]
null
null
null
crystal/storage/builder/test/RecordBuilderTest.cpp
crystal-dataop/crystal
128e1dcde1ef68cabadab9b16d45f5199f0afe5c
[ "Apache-2.0" ]
null
null
null
/* * Copyright 2017-present Yeolar * * 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 <gtest/gtest.h> #include "crystal/storage/builder/RecordBuilder.h" using namespace crystal; TEST(RecordBuilder, record) { const char* conf = R"( { record=[ { tag=1, name="menuId", type="uint64" }, { tag=2, name="status", type="int32", bits=4, default=1 }, { tag=3, name="keyword", type="string" }, { tag=4, name="content", type="string" }, { tag=5, name="food", type="string", count=0 } ] } )"; const char* cson = R"( { menuId=1000, status=0, keyword="menu", content="menu content", food=["a","b","c"] } )"; RecordBuilder<SysAllocator> builder(parseCson(conf)); builder.init(nullptr); Record record = builder.build(parseCson(cson)); EXPECT_EQ(1000, record.get<uint64_t>(1)); EXPECT_EQ(0, record.get<int32_t>(2)); EXPECT_STREQ("menu", record.get<std::string>(3).c_str()); EXPECT_STREQ("menu content", record.get<std::string>(4).c_str()); Array<std::string_view> a = record.get<Array<std::string_view>>(5); EXPECT_EQ(3, a.size()); EXPECT_STREQ("a", std::string(a.get(0)).c_str()); EXPECT_STREQ("b", std::string(a.get(1)).c_str()); EXPECT_STREQ("c", std::string(a.get(2)).c_str()); }
31.05
75
0.63124
crystal-dataop
fa8a465f17ad753a34a1a356f794c5701fe4a4fa
40,260
cxx
C++
src/PyBridge.cxx
peerschuett/easy_pbr
9a2e8117117d194124f800648644e97a7fc3c095
[ "MIT" ]
null
null
null
src/PyBridge.cxx
peerschuett/easy_pbr
9a2e8117117d194124f800648644e97a7fc3c095
[ "MIT" ]
null
null
null
src/PyBridge.cxx
peerschuett/easy_pbr
9a2e8117117d194124f800648644e97a7fc3c095
[ "MIT" ]
null
null
null
#include "easy_pbr/PyBridge.h" #ifdef EASYPBR_WITH_TORCH #include <torch/extension.h> #include "torch/torch.h" #include "torch/csrc/utils/pybind.h" #include "UtilsPytorch.h" #endif // #include "pybind11_tests.h" // #include "constructor_stats.h" #include <pybind11/operators.h> #include <functional> //my stuff #include "easy_pbr/Viewer.h" #include "easy_pbr/Gui.h" #include "easy_pbr/Mesh.h" #include "easy_pbr/Scene.h" #include "easy_pbr/LabelMngr.h" #include "easy_pbr/Recorder.h" #include "easy_pbr/Camera.h" #include "easy_pbr/SpotLight.h" #include "easy_pbr/Frame.h" #include "easy_gl/UtilsGL.h" #include "Profiler.h" #include "opencv_utils.h" #include "string_utils.h" //boost #include <boost/filesystem.hpp> namespace fs = boost::filesystem; // https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html // PYBIND11_MAKE_OPAQUE(std::vector<int>); //to be able to pass vectors by reference to functions and have things like push back actually work // PYBIND11_MAKE_OPAQUE(std::vector<float>, std::allocator<float> >); namespace py = pybind11; namespace easy_pbr{ //way to declare multiple templaded class with the same functions that are exposed through pybind11 https://stackoverflow.com/a/47749076 template<typename T> void eigen_affine_bindings(py::module &m, const std::string typestr) { using Class = Eigen::Transform<T,3,Eigen::Affine>; std::string pyclass_name = std::string("Affine3") + typestr; py::class_<Class> (m, pyclass_name.c_str()) .def(py::init<>()) //operators .def(py::self * py::self) //multiply a matrix with another one .def("from_matrix", [](Class &m, const Eigen::Matrix<T, 4, 4>& mat) { m.matrix()=mat; return m; } ) //getters .def("matrix", [](const Class &m) { return m.matrix(); } ) .def("translation", [](const Class &m) { return m.translation(); } ) .def("linear", [](const Class &m) { return m.linear(); } ) .def("quat", [](const Class &m) { Eigen::Quaternion<T> q ( m.linear() ); return q.coeffs(); } ) .def("inverse", [](const Class &m) { return m.inverse(); } ) //TODO euler //TODO to_xyz_quat_vec //setters .def("set_identity", [](Class &m) { m.setIdentity(); return m; } ) .def("set_translation", [](Class &m, const Eigen::Matrix<T, 3, 1>& t) { m.translation()=t; return m; } ) .def("set_linear", [](Class &m, const Eigen::Matrix<T, 3, 3>& r) { m.linear()=r; return m; } ) .def("set_quat", [](Class &m, const Eigen::Matrix<T, 4, 1>& q_vec) { Eigen::Quaternion<T> q; q.coeffs()=q_vec; m.linear()=q.toRotationMatrix(); return m; } ) //convenience functions .def("translate", [](Class &m, const Eigen::Matrix<T, 3, 1>& t) { m.translation()+=t; return m; } ) .def("flip_x", [](Class &m) { m.matrix().col(0)= -m.matrix().col(0); return m; } ) .def("flip_y", [](Class &m) { m.matrix().col(1)= -m.matrix().col(1); return m; } ) .def("flip_z", [](Class &m) { m.matrix().col(2)= -m.matrix().col(2); return m; } ) .def("rotate_axis_angle", [](Class &m, const Eigen::Matrix<T, 3, 1>& axis, const float angle_degrees) { Eigen::Quaternion<T> q = Eigen::Quaternion<T>( Eigen::AngleAxis<T>( angle_degrees * M_PI / 180.0 , axis.normalized() ) ); Class tf; tf.setIdentity(); tf.linear()=q.toRotationMatrix(); //compose the old transform with this new one m=tf*m; return m; } ) .def("rotate_axis_angle_local", [](Class &m, const Eigen::Matrix<T, 3, 1>& axis, const float angle_degrees) { Eigen::Quaternion<T> q = Eigen::Quaternion<T>( Eigen::AngleAxis<T>( angle_degrees * M_PI / 180.0 , axis.normalized() ) ); Class rot; rot.setIdentity(); rot.linear()=q.toRotationMatrix(); Class tf=Eigen::Translation<T,3>(m.translation()) * rot * Eigen::Translation<T,3>(-m.translation()); //compose the old transform with this new one m=tf*m; return m; } ) .def("orbit_y_around_point", [](Class &m, const Eigen::Matrix<T, 3, 1>& point, const float angle_degrees) { Eigen::Matrix<T, 3, 1> axis_y; axis_y << 0,1,0; Eigen::Quaternion<T> q_y = Eigen::Quaternion<T>( Eigen::AngleAxis<T>( angle_degrees*M_PI/180.0 , axis_y.normalized() ) ); //we apply rotations around the lookat point so we have to substract, apply rotation and then add back the lookat point Eigen::Transform<T,3,Eigen::Affine> model_matrix_rotated = Eigen::Translation< T, 3 >(point) * q_y * Eigen::Translation< T, 3 >(-point) * m ; m=model_matrix_rotated; return model_matrix_rotated; } ) //cast .def("to_float", [](const Class &m) { return m.template cast<float>(); } ) //template case es needed because of https://stackoverflow.com/a/48029026 .def("to_double", [](const Class &m) { return m.template cast<double>(); } ) //template case es needed because of https://stackoverflow.com/a/48029026 .def("clone", [](const Class &m) { Class m_new=m; return m_new; } ) ; } PYBIND11_MODULE(easypbr, m) { py::class_<cv::Mat> (m, "Mat") .def(py::init<>()) .def(py::init([](std::string file_path) { // return std::unique_ptr<Example>(new Example(arg)); cv::Mat m; std::string filepath_trim= radu::utils::trim_copy(file_path); std::string file_path_abs; if (fs::path( filepath_trim ).is_relative()){ file_path_abs=(fs::path(PROJECT_SOURCE_DIR) / filepath_trim).string(); }else{ file_path_abs=filepath_trim; } m=cv::imread(file_path_abs, cv::IMREAD_UNCHANGED); return m; })) .def("create", [](cv::Mat &m, int rows, int cols, int channels) { if (channels==1) m=cv::Mat(rows,cols,CV_32FC1); if (channels==2) m=cv::Mat(rows,cols,CV_32FC2); if (channels==3) m=cv::Mat(rows,cols,CV_32FC3); if (channels==4) m=cv::Mat(rows,cols,CV_32FC4); return m; } ) .def("from_file", [](cv::Mat &m, const std::string file_path) { std::string filepath_trim= radu::utils::trim_copy(file_path); std::string file_path_abs; if (fs::path( filepath_trim ).is_relative()){ file_path_abs=(fs::path(PROJECT_SOURCE_DIR) / filepath_trim).string(); }else{ file_path_abs=filepath_trim; } m=cv::imread(file_path_abs, cv::IMREAD_UNCHANGED); } ) .def("to_file", [](cv::Mat &m, const std::string path) { cv::imwrite(path,m); } ) .def("from_numpy", [](cv::Mat &m, py::array &arr) { // from https://stackoverflow.com/a/49693704 CHECK(arr.ndim()==3) <<"We assume 3 dimensions to the image corresponding to h,w,c. But instead it is "<< arr.ndim(); // VLOG(1) << "Mat from numpy"; //get nr of channels int nr_channels=arr.shape(2); CHECK(nr_channels==1 || nr_channels==2 || nr_channels==3 || nr_channels==4) << "Assuming nr of channels is 1,2,3 or 4. But it is " << nr_channels; //get h and width int h=arr.shape(0); int w=arr.shape(1); //get type int mat_type=-1; if(arr.dtype().is( py::dtype("int32"))){ switch ( nr_channels ) { case 1: mat_type = CV_32SC1; break; case 2: mat_type = CV_32SC2; break; case 3: mat_type = CV_32SC3; break; case 4: mat_type = CV_32SC4; break; default: mat_type=-1; break; } }else if(arr.dtype().is( py::dtype("int8"))){ switch ( nr_channels ) { case 1: mat_type = CV_8UC1; break; case 2: mat_type = CV_8UC2; break; case 3: mat_type = CV_8UC3; break; case 4: mat_type = CV_8UC4; break; default: mat_type=-1; break; } }else if(arr.dtype().is( py::dtype("float32"))){ switch ( nr_channels ) { case 1: mat_type = CV_32FC1; break; case 2: mat_type = CV_32FC2; break; case 3: mat_type = CV_32FC3; break; case 4: mat_type = CV_32FC4; break; default: mat_type=-1; break; } }else{ LOG(FATAL) << "Unknown numpy type"; } //wrap buffer py::buffer_info buf = arr.request(); m=cv::Mat(h,w, mat_type, buf.ptr); } ) .def("set_alpha_to_value", [](cv::Mat &m, const int val) { CHECK(m.channels()==4) << "Mat needs to have 4 channels and it only has " << m.channels(); cv::Mat mat; cv::Mat channels[4]; split(m, channels); merge(channels,3,mat); mat.setTo(cv::Scalar::all(val), (channels[3]<255)); m=mat; } ) .def("set_value_to_alpha", [](cv::Mat &m, const int val) { CHECK(m.channels()==3) << "Mat needs to have 4 channels and it only has " << m.channels(); // cv::Mat mat; // cv::cvtColor(m, mat, CV_8UC4); cv::Mat mat=cv::Mat(m.rows,m.cols,CV_8UC4); // find all white pixel and set alpha value to zero: for (int y = 0; y < mat.rows; ++y){ for (int x = 0; x < mat.cols; ++x){ cv::Vec3b & pixel = m.at<cv::Vec3b>(y, x); cv::Vec4b & pixel_out = mat.at<cv::Vec4b>(y, x); pixel_out[0] = pixel[0]; pixel_out[1] = pixel[1]; pixel_out[2] = pixel[2]; pixel_out[3] = 255; // if pixel is the value if (pixel[0] == val && pixel[1] == val && pixel[2] == val) { // set alpha to zero: pixel_out[3] = 0; } } } m=mat; return mat; } ) .def("clone", [](cv::Mat &m) { return m.clone(); } ) .def("set_val", [](cv::Mat &m, const float val) { m = cv::Scalar(val); } ) .def("set_val", [](cv::Mat &m, const float r, const float g) { m = cv::Scalar(r,g); } ) .def("set_val", [](cv::Mat &m, const float r, const float g, const float b) { m = cv::Scalar(b,g,r); } ) .def("set_val", [](cv::Mat &m, const float r, const float g, const float b, const float alpha) { m = cv::Scalar(b,g,r, alpha); } ) .def("hsv2rgb", [](cv::Mat &m) { cv::Mat res; cv::cvtColor(m, res, cv::COLOR_HSV2RGB); return res; } ) .def("hsv2bgr", [](cv::Mat &m) { cv::Mat res; cv::cvtColor(m, res, cv::COLOR_HSV2BGR); return res; } ) .def("rgb2bgr", [](cv::Mat &m) { cv::Mat res; cv::cvtColor(m, res, cv::COLOR_RGB2BGR); return res; } ) .def("bgr2rgb", [](cv::Mat &m) { cv::Mat res; cv::cvtColor(m, res, cv::COLOR_BGR2RGB); return res; } ) .def("rgba2bgra", [](cv::Mat &m) { cv::Mat res; cv::cvtColor(m, res, cv::COLOR_RGBA2BGRA); return res; } ) .def("bgra2rgba", [](cv::Mat &m) { cv::Mat res; cv::cvtColor(m, res, cv::COLOR_BGRA2RGBA); return res; } ) .def("rgb2rgba", [](cv::Mat &m) { cv::Mat res; cv::cvtColor(m, res, cv::COLOR_RGB2RGBA); return res; } ) .def("bgr2bgra", [](cv::Mat &m) { cv::Mat res; cv::cvtColor(m, res, cv::COLOR_BGR2BGRA); return res; } ) .def("normalize_range", [](cv::Mat &m) { cv::Mat res; cv::normalize(m, res, 0, 1, cv::NORM_MINMAX, CV_32F); return res; } ) // .def("rgba2rgbblack", [](cv::Mat &m ) { m=cv::imread(path, cv::IMREAD_UNCHANGED); } ) .def("flip_y", [](cv::Mat &m) { cv::Mat flipped; cv::flip(m, flipped, 0); m=flipped; return flipped; } ) .def("flip_x", [](cv::Mat &m) { cv::Mat flipped; cv::flip(m, flipped, 1); m=flipped; return flipped; } ) .def_readonly("rows", &cv::Mat::rows ) .def_readonly("cols", &cv::Mat::cols ) .def("channels", &cv::Mat::channels ) .def("empty", &cv::Mat::empty ) .def("to_cv8u", [](cv::Mat &m) { cv::Mat out; m.convertTo(out, CV_8U, 255, 0); m=out; return out; } ) .def("blend", [](cv::Mat &cur, cv::Mat &src2, float alpha ) { cv::Mat dst; cv::addWeighted( cur, alpha, src2, 1-alpha, 0.0, dst); return dst; } ) .def("hconcat", [](cv::Mat &cur, cv::Mat &src1 ) { cv::Mat dst; cv::hconcat(cur,src1,dst); return dst; } ) .def("vconcat", [](cv::Mat &cur, cv::Mat &src1 ) { cv::Mat dst; cv::vconcat(cur,src1,dst); return dst; } ) .def("type_string", [](cv::Mat &m) { return radu::utils::type2string(m.type()); } ) ; eigen_affine_bindings<float>(m, "f"); eigen_affine_bindings<double>(m, "d"); m.def("cv_imread", [](const std::string path) { cv::Mat mat=cv::imread(path); return mat; } ); //Frame py::class_<Frame, std::shared_ptr<Frame> > (m, "Frame") .def(py::init<>()) // .def_readwrite("rgb_32f", &Frame::rgb_32f) //not possible in pybind. You would need to wrap the opencv into a matrix type or soemthing like that .def("create_frustum_mesh", &Frame::create_frustum_mesh, py::arg("scale_multiplier") = 1.0, py::arg("show_texture")=true, py::arg("texture_max_size")=256 ) .def("random_crop", &Frame::random_crop ) .def("crop", &Frame::crop ) .def("subsample", &Frame::subsample, py::arg().noconvert(), py::arg("subsample_imgs") = true ) .def("upsample", &Frame::upsample, py::arg().noconvert(), py::arg("upsample_imgs") = true ) .def("depth2world_xyz_mat", &Frame::depth2world_xyz_mat ) .def("depth2world_xyz_mesh", &Frame::depth2world_xyz_mesh ) .def("pixels2dirs_mesh", &Frame::pixels2dirs_mesh ) .def("pixels2_euler_angles_mesh", &Frame::pixels2_euler_angles_mesh ) .def("pixels2coords", &Frame::pixels2coords ) .def("unproject", &Frame::unproject ) .def("project", &Frame::project ) .def("undistort", &Frame::undistort ) .def("has_right_stereo_pair", &Frame::has_right_stereo_pair ) .def("right_stereo_pair", &Frame::right_stereo_pair ) .def("set_right_stereo_pair", &Frame::set_right_stereo_pair ) .def("rectify_stereo_pair", &Frame::rectify_stereo_pair, py::arg("offset_disparity")=0 ) .def("draw_projected_line", &Frame::draw_projected_line, py::arg().noconvert(), py::arg().noconvert(), py::arg("thickness")=1 ) // .def("rotate_y_axis", &Frame::rotate_y_axis ) // .def("backproject_depth", &Frame::backproject_depth ) .def("rotate_clockwise_90", &Frame::rotate_clockwise_90 ) .def("from_camera", &Frame::from_camera, py::arg().noconvert(), py::arg().noconvert(), py::arg().noconvert(), py::arg("flip_z_axis")=true, py::arg("flip_y_axis")=true ) .def("assign_color", &Frame::assign_color ) // .def("pixel_world_direction", &Frame::pixel_world_direction ) // .def("pixel_world_direction_euler_angles", &Frame::pixel_world_direction_euler_angles ) .def("rgb_with_valid_depth", &Frame::rgb_with_valid_depth ) .def("compute_uv", &Frame::compute_uv ) .def("naive_splat", &Frame::naive_splat ) .def("pos_in_world", &Frame::pos_in_world ) .def("look_dir", &Frame::look_dir ) .def("name", &Frame::name ) .def("unload_images", &Frame::unload_images ) .def("load_images", [](Frame &frame) { frame.load_images(frame); } ) .def("has_extra_field", &Frame::has_extra_field ) .def("add_extra_field", &Frame::add_extra_field<int> ) .def("add_extra_field", &Frame::add_extra_field<float> ) .def("add_extra_field", &Frame::add_extra_field<double> ) .def("add_extra_field", &Frame::add_extra_field<std::string> ) .def("add_extra_field", &Frame::add_extra_field<Eigen::MatrixXi> ) .def("add_extra_field", &Frame::add_extra_field<Eigen::MatrixXf> ) .def("add_extra_field", &Frame::add_extra_field<Eigen::MatrixXd> ) .def("get_extra_field_int", &Frame::get_extra_field<int> ) .def("get_extra_field_float", &Frame::get_extra_field<float> ) .def("get_extra_field_double", &Frame::get_extra_field<double> ) .def("get_extra_field_string", &Frame::get_extra_field<std::string> ) .def("get_extra_field_mat", &Frame::get_extra_field<cv::Mat> ) .def("get_extra_field_matrixXi", &Frame::get_extra_field<Eigen::MatrixXi> ) .def("get_extra_field_matrixXf", &Frame::get_extra_field<Eigen::MatrixXf> ) .def("get_extra_field_matrixXd", &Frame::get_extra_field<Eigen::MatrixXd> ) .def("get_extra_field_mesh", &Frame::get_extra_field< std::shared_ptr<Mesh> > ) .def_readwrite("m_right_stereo_pair", &Frame::m_right_stereo_pair ) .def_readwrite("is_shell", &Frame::is_shell ) .def_readwrite("tf_cam_world", &Frame::tf_cam_world ) .def_readwrite("K", &Frame::K ) .def_readwrite("width", &Frame::width ) .def_readwrite("height", &Frame::height ) .def_readwrite("gray_8u", &Frame::gray_8u ) .def_readwrite("rgb_8u", &Frame::rgb_8u ) .def_readwrite("rgb_32f", &Frame::rgb_32f ) .def_readwrite("gray_32f", &Frame::gray_32f ) .def_readwrite("grad_x_32f", &Frame::grad_x_32f ) .def_readwrite("grad_y_32f", &Frame::grad_y_32f ) .def_readwrite("depth", &Frame::depth ) .def_readwrite("confidence", &Frame::confidence ) .def_readwrite("normal_32f", &Frame::normal_32f ) .def_readwrite("mask", &Frame::mask ) .def_readwrite("frame_idx", &Frame::frame_idx ) .def_readwrite("cam_id", &Frame::cam_id ) .def_readwrite("rgb_path", &Frame::rgb_path ) ; //convenience functions to transform from mat or eigen to tensors #ifdef EASYPBR_WITH_TORCH m.def("mat2tensor", &mat2tensor); m.def("tensor2mat", &tensor2mat); m.def("eigen2tensor", &eigen2tensor); m.def("eigen2mat", &eigen2mat); m.def("tensor2eigen", &tensor2eigen); m.def("vec2tensor", &vec2tensor); m.def("cuda_clear_cache", &cuda_clear_cache); #endif //Viewer py::class_<Viewer, std::shared_ptr<Viewer>> (m, "Viewer") // .def(py::init<const std::string>()) .def_static("create", &Viewer::create<const std::string>, py::arg("config_file") = DEFAULT_CONFIG ) //for templated methods like this one we need to explicitly instantiate one of the arguments .def("update", &Viewer::update, py::arg("fbo_id") = 0) .def("draw", &Viewer::draw, py::arg("fbo_id") = 0) .def("clear_framebuffers", &Viewer::clear_framebuffers) .def("load_environment_map", &Viewer::load_environment_map ) .def("spotlight_with_idx", &Viewer::spotlight_with_idx ) .def("gbuffer_mat_with_name", &Viewer::gbuffer_mat_with_name ) .def("rendered_tex_no_gui", &Viewer::rendered_tex_no_gui, py::return_value_policy::reference ) .def("rendered_tex_with_gui", &Viewer::rendered_tex_with_gui, py::return_value_policy::reference ) .def("rendered_mat_no_gui", &Viewer::rendered_mat_no_gui ) .def("rendered_mat_with_gui", &Viewer::rendered_mat_with_gui ) .def("upload_single_mesh_to_gpu", &Viewer::upload_single_mesh_to_gpu ) .def_readwrite("m_debug", &Viewer::m_debug ) .def_readwrite("m_use_offscreen", &Viewer::m_use_offscreen ) .def_readwrite("m_kernel_radius", &Viewer::m_kernel_radius ) .def_readwrite("m_enable_culling", &Viewer::m_enable_culling ) .def_readwrite("m_enable_edl_lighting", &Viewer::m_enable_edl_lighting ) .def_readwrite("m_enable_ssao", &Viewer::m_enable_ssao ) // .def("print_pointers", &Viewer::print_pointers ) // .def("set_position", &Viewer::set_position ) // .def("check_position", &Viewer::check_position ) .def_readwrite("m_swap_buffers", &Viewer::m_swap_buffers ) .def_readwrite("m_camera", &Viewer::m_camera ) .def_readwrite("m_default_camera", &Viewer::m_default_camera ) .def_readwrite("m_recorder", &Viewer::m_recorder ) .def_readwrite("m_viewport_size", &Viewer::m_viewport_size ) .def_readwrite("m_nr_drawn_frames", &Viewer::m_nr_drawn_frames ) .def_readwrite("m_background_color", &Viewer::m_background_color ) .def_readwrite("m_gui", &Viewer::m_gui ) .def_readwrite("m_new_cloud", &Viewer::m_new_cloud ) ; //Gui py::class_<Gui, std::shared_ptr<Gui> > (m, "Gui") // .def_static("show_rgb", []( const Frame& frame, const std::string name ) { Gui::show(frame.rgb_32f, name); }) //making function for eahc one because the frame cannot expose to python the cv mat .def_static("show", &Gui::show, py::arg().noconvert(), py::arg().noconvert(), py::arg("cv_mat_1") = cv::Mat(), py::arg("name_1") = "", py::arg("cv_mat_2") = cv::Mat(), py::arg("name_2") = "") .def_static("show_gl_texture", &Gui::show_gl_texture ) .def("selected_mesh_idx", &Gui::selected_mesh_idx ) ; //Camera py::class_<Camera, std::shared_ptr<Camera>> (m, "Camera") .def(py::init<>()) .def("model_matrix", &Camera::model_matrix ) .def("model_matrix_affine", &Camera::model_matrix_affine ) .def("view_matrix", &Camera::view_matrix ) .def("view_matrix_affine", &Camera::view_matrix_affine ) .def("intrinsics", &Camera::intrinsics ) .def("position", &Camera::position ) .def("lookat", &Camera::lookat ) .def("direction", &Camera::direction ) .def("up", &Camera::up ) .def("cam_axes", &Camera::cam_axes ) .def("dist_to_lookat", &Camera::dist_to_lookat ) .def("set_model_matrix", &Camera::set_model_matrix ) .def("set_position", &Camera::set_position ) .def("set_quat", &Camera::set_quat ) .def("set_lookat", &Camera::set_lookat ) .def("set_dist_to_lookat", &Camera::set_dist_to_lookat ) .def("push_away", &Camera::push_away ) .def("push_away_by_dist", &Camera::push_away_by_dist ) .def("orbit_y", &Camera::orbit_y ) .def("orbit_axis_angle", &Camera::orbit_axis_angle ) .def("rotate", &Camera::rotate ) .def("rotate_axis_angle", &Camera::rotate_axis_angle ) .def("flip_around_x", &Camera::flip_around_x ) .def("from_frame", &Camera::from_frame ) .def("from_string", &Camera::from_string ) .def("create_frustum_mesh", &Camera::create_frustum_mesh) .def("transform_model_matrix", &Camera::transform_model_matrix) .def("clone", &Camera::clone) .def_readwrite("m_exposure", &Camera::m_exposure ) .def_readwrite("m_near", &Camera::m_near ) .def_readwrite("m_far", &Camera::m_far ) .def_readwrite("m_fov", &Camera::m_fov ) .def_readwrite("m_model_matrix", &Camera::m_model_matrix ) .def_readwrite("m_use_fixed_proj_matrix", &Camera::m_use_fixed_proj_matrix ) ; //Spotlight py::class_<SpotLight, Camera, std::shared_ptr<SpotLight> > (m, "SpotLight") // py::class_<SpotLight, Camera, std::shared_ptr<Camera> > (m, "SpotLight") // .def(py::init<const std::string>()) .def_readwrite("m_power", &SpotLight::m_power ) .def_readwrite("m_color", &SpotLight::m_color ) ; //Scene py::class_<Scene> (m, "Scene") .def(py::init<>()) // .def_static("show", py::overload_cast<const Mesh&, const std::string>(&Scene::show) ) .def_static("show", py::overload_cast<const std::shared_ptr<Mesh>, const std::string>(&Scene::show) ) .def_static("hide_all", &Scene::hide_all ) .def_static("show_all", &Scene::show_all ) .def_static("get_mesh_with_idx", &Scene::get_mesh_with_idx ) .def_static("get_mesh_with_name", &Scene::get_mesh_with_name ) .def_static("get_scale", &Scene::get_scale, py::arg("use_mutex") = true ) .def_static("does_mesh_with_name_exist", &Scene::does_mesh_with_name_exist) .def_static("remove_meshes_starting_with_name", &Scene::remove_meshes_starting_with_name) .def_static("add_mesh", &Scene::add_mesh) .def_static("set_floor_visible", &Scene::set_floor_visible) .def_static("nr_meshes", &Scene::nr_meshes) ; //LabelMngr py::class_<LabelMngr, std::shared_ptr<LabelMngr>> (m, "LabelMngr") // .def(py::init<>()) //canot initialize it because it required in the construction a configuru::Config object and that is not exposed in python .def(py::init<const std::string, const std::string, const std::string, const int>()) .def(py::init<const int, const int>() ) .def("nr_classes", &LabelMngr::nr_classes ) .def("get_idx_unlabeled", &LabelMngr::get_idx_unlabeled ) .def("class_frequencies", &LabelMngr::class_frequencies ) .def("idx2label", &LabelMngr::idx2label ) .def("label2idx", &LabelMngr::label2idx ) .def("compact", &LabelMngr::compact ) .def("set_color_scheme", &LabelMngr::set_color_scheme ) .def("set_color_for_label_with_idx", &LabelMngr::set_color_for_label_with_idx ) ; //VisOptions py::class_<VisOptions> (m, "VisOptions") .def(py::init<>()) .def_readwrite("m_is_visible", &VisOptions::m_is_visible) .def_readwrite("m_force_cast_shadow", &VisOptions::m_force_cast_shadow) .def_readwrite("m_show_points", &VisOptions::m_show_points) .def_readwrite("m_show_lines", &VisOptions::m_show_lines) .def_readwrite("m_show_normals", &VisOptions::m_show_normals) .def_readwrite("m_show_mesh", &VisOptions::m_show_mesh) .def_readwrite("m_show_wireframe", &VisOptions::m_show_wireframe) .def_readwrite("m_show_surfels", &VisOptions::m_show_surfels) .def_readwrite("m_overlay_points", &VisOptions::m_overlay_points) .def_readwrite("m_overlay_lines", &VisOptions::m_overlay_lines) .def_readwrite("m_points_as_circle", &VisOptions::m_points_as_circle) .def_readwrite("m_point_size", &VisOptions::m_point_size) .def_readwrite("m_line_width", &VisOptions::m_line_width) // .def_readwrite("m_color_type", &VisOptions::m_color_type) // doesnt really work because I would have to also expose a lot of the better enum library, but I'll make some funcs instead .def_readwrite("m_point_color", &VisOptions::m_point_color) .def_readwrite("m_line_color", &VisOptions::m_line_color) .def_readwrite("m_solid_color", &VisOptions::m_solid_color) .def_readwrite("m_metalness", &VisOptions::m_metalness) .def_readwrite("m_roughness", &VisOptions::m_roughness) .def_readwrite("m_use_custom_shader", &VisOptions::m_use_custom_shader) .def("set_color_solid", &VisOptions::set_color_solid ) .def("set_color_pervertcolor", &VisOptions::set_color_pervertcolor ) .def("set_color_texture", &VisOptions::set_color_texture ) .def("set_color_semanticpred", &VisOptions::set_color_semanticpred ) .def("set_color_semanticgt", &VisOptions::set_color_semanticgt ) .def("set_color_normalvector", &VisOptions::set_color_normalvector ) .def("set_color_height", &VisOptions::set_color_height ) .def("set_color_intensity", &VisOptions::set_color_intensity ) .def("set_color_uv", &VisOptions::set_color_uv ) .def("set_color_normalvector_viewcoords", &VisOptions::set_color_normalvector_viewcoords ) ; //Mesh py::class_<Mesh, std::shared_ptr<Mesh>> (m, "Mesh") .def(py::init<>()) .def(py::init<std::string>()) .def("load_from_file", &Mesh::load_from_file ) .def("read_obj", &Mesh::read_obj, py::arg().noconvert(), py::arg("load_vti") = false, py::arg("load_vni") = false ) .def("save_to_file", &Mesh::save_to_file ) .def("sanity_check", &Mesh::sanity_check ) .def("clone", &Mesh::clone ) // .def("add", &Mesh::add ) .def("add", py::overload_cast<Mesh&>(&Mesh::add) ) .def("add", py::overload_cast<const std::vector<std::shared_ptr<Mesh>>&>(&Mesh::add) ) .def("is_empty", &Mesh::is_empty ) .def("preallocate_V", &Mesh::preallocate_V ) .def("create_box_ndc", &Mesh::create_box_ndc ) .def("create_box", &Mesh::create_box ) .def("create_floor", &Mesh::create_floor ) .def("create_sphere", &Mesh::create_sphere ) .def("create_cylinder", &Mesh::create_cylinder ) .def("create_line_strip_from_points", &Mesh::create_line_strip_from_points ) .def("has_extra_field", &Mesh::has_extra_field ) .def("add_extra_field", &Mesh::add_extra_field<int> ) .def("add_extra_field", &Mesh::add_extra_field<float> ) .def("add_extra_field", &Mesh::add_extra_field<double> ) .def("add_extra_field", &Mesh::add_extra_field<std::string> ) .def("add_extra_field", &Mesh::add_extra_field<cv::Mat> ) .def("add_extra_field", &Mesh::add_extra_field<Eigen::MatrixXi> ) .def("add_extra_field", &Mesh::add_extra_field<Eigen::MatrixXf> ) .def("add_extra_field", &Mesh::add_extra_field<Eigen::MatrixXd> ) .def("get_extra_field_int", &Mesh::get_extra_field<int> ) .def("get_extra_field_float", &Mesh::get_extra_field<float> ) .def("get_extra_field_double", &Mesh::get_extra_field<double> ) .def("get_extra_field_string", &Mesh::get_extra_field<std::string> ) .def("get_extra_field_mat", &Mesh::get_extra_field<cv::Mat> ) .def("get_extra_field_matrixXi", &Mesh::get_extra_field<Eigen::MatrixXi> ) .def("get_extra_field_matrixXf", &Mesh::get_extra_field<Eigen::MatrixXf> ) .def("get_extra_field_matrixXd", &Mesh::get_extra_field<Eigen::MatrixXd> ) .def_readwrite("id", &Mesh::id) .def_readwrite("name", &Mesh::name) .def_readwrite("m_width", &Mesh::m_width) .def_readwrite("m_height", &Mesh::m_height) .def_readwrite("m_vis", &Mesh::m_vis) .def_readwrite("m_force_vis_update", &Mesh::m_force_vis_update) .def_readwrite("m_is_dirty", &Mesh::m_is_dirty) .def_readwrite("m_is_shadowmap_dirty", &Mesh::m_is_shadowmap_dirty) .def_readwrite("V", &Mesh::V) .def_readwrite("F", &Mesh::F) .def_readwrite("C", &Mesh::C) .def_readwrite("E", &Mesh::E) .def_readwrite("D", &Mesh::D) .def_readwrite("NF", &Mesh::NF) .def_readwrite("NV", &Mesh::NV) .def_readwrite("UV", &Mesh::UV) .def_readwrite("V_tangent_u", &Mesh::V_tangent_u) .def_readwrite("V_lenght_v", &Mesh::V_length_v) .def_readwrite("V_bitangent_v", &Mesh::V_bitangent_v) .def_readwrite("L_pred", &Mesh::L_pred) .def_readwrite("L_gt", &Mesh::L_gt) .def_readwrite("I", &Mesh::I) .def_readwrite("VTI", &Mesh::VTI) .def_readwrite("VNI", &Mesh::VNI) .def_readwrite("m_label_mngr", &Mesh::m_label_mngr ) .def_readwrite("m_min_max_y_for_plotting", &Mesh::m_min_max_y_for_plotting ) .def_readwrite("m_disk_path", &Mesh::m_disk_path) .def_readwrite("custom_render_func", &Mesh::custom_render_func) // .def("model_matrix_d", [](const Mesh &m) { // return m.m_model_matrix; // } // ) // .def("model_matrix_f", [](const Mesh &m) { // return m.m_model_matrix.cast<float>(); // } // ) // .def_readwrite("m_model_matrix", &Mesh::m_model_matrix) // .def("model_matrix", &Mesh::model_matrix ) // .def("set_model_matrix", &Mesh::set_model_matrix ) // .def_property("model_matrix", &Mesh::model_matrix, &Mesh::set_model_matrix) .def("transform_model_matrix", &Mesh::transform_model_matrix) // This transform also the children of this mesh .def_property("model_matrix", &Mesh::model_matrix_ref, &Mesh::set_model_matrix) .def_property("cur_pose", &Mesh::cur_pose_ref, &Mesh::set_cur_pose) .def("set_model_matrix_from_string", &Mesh::set_model_matrix_from_string ) .def("get_scale", &Mesh::get_scale ) .def("color_solid2pervert", &Mesh::color_solid2pervert ) .def("color_from_mat", &Mesh::color_from_mat ) .def("translate_model_matrix", &Mesh::translate_model_matrix ) .def("transform_vertices_cpu", &Mesh::transform_vertices_cpu ) // .def("rotate_model_matrix", &Mesh::rotate_model_matrix ) // .def("rotate_model_matrix_local", py::overload_cast<const Eigen::Vector3d&, const float > (&Mesh::rotate_model_matrix_local) ) .def("apply_model_matrix_to_cpu", &Mesh::apply_model_matrix_to_cpu ) .def("scale_mesh", &Mesh::scale_mesh ) // .def("set_model_matrix", &Mesh::set_model_matrix ) // .def("model_matrix_as_xyz_and_quaternion", &Mesh::model_matrix_as_xyz_and_quaternion ) // .def("model_matrix_as_xyz_and_rpy", &Mesh::model_matrix_as_xyz_and_rpy ) // .def("premultiply_model_matrix", &Mesh::premultiply_model_matrix ) // .def("postmultiply_model_matrix", &Mesh::postmultiply_model_matrix ) .def("recalculate_normals", &Mesh::recalculate_normals ) .def("flip_normals", &Mesh::flip_normals ) .def("recalculate_min_max_height", &Mesh::recalculate_min_max_height ) .def("decimate", &Mesh::decimate ) .def("upsample", &Mesh::upsample ) .def("remove_marked_vertices", &Mesh::remove_marked_vertices ) .def("flip_winding", &Mesh::flip_winding ) .def("to_3D", &Mesh::to_3D ) .def("to_2D", &Mesh::to_2D ) .def("remove_vertices_at_zero", &Mesh::remove_vertices_at_zero ) .def("remove_duplicate_vertices", &Mesh::remove_duplicate_vertices ) .def("undo_remove_duplicate_vertices", &Mesh::undo_remove_duplicate_vertices ) .def("compute_tangents", &Mesh::compute_tangents, py::arg("tangent_length") = 1.0) #ifdef EASYPBR_WITH_PCL .def("estimate_normals_from_neighbourhood", &Mesh::estimate_normals_from_neighbourhood ) #endif .def("compute_distance_to_mesh", &Mesh::compute_distance_to_mesh ) .def("fix_oversplit_due_to_blender_uv", &Mesh::fix_oversplit_due_to_blender_uv ) // .def("compute_tangents", py::overload_cast<const float>(&Mesh::compute_tangents), py::arg("tangent_length") = 1.0) .def("create_grid", &Mesh::create_grid ) // .def("rotate_x_axis", &Mesh::rotate_x_axis ) // .def("rotate_y_axis", &Mesh::rotate_y_axis ) .def("random_subsample", &Mesh::random_subsample ) .def("normalize_size", &Mesh::normalize_size ) .def("normalize_position", &Mesh::normalize_position ) // .def("move_in_x", &Mesh::move_in_x ) // .def("move_in_y", &Mesh::move_in_y ) // .def("move_in_z", &Mesh::move_in_z ) .def("add_child", &Mesh::add_child ) .def("radius_search", &Mesh::radius_search ) .def("color_from_label_indices", &Mesh::color_from_label_indices ) .def("set_diffuse_tex", py::overload_cast<const std::string, const int, const bool> (&Mesh::set_diffuse_tex), py::arg().noconvert(), py::arg("subsample") = 1, py::arg("read_alpha") = false ) //https://github.com/pybind/pybind11/issues/876 .def("set_metalness_tex", py::overload_cast<const std::string, const int, const bool> (&Mesh::set_metalness_tex), py::arg().noconvert(), py::arg("subsample") = 1, py::arg("read_alpha") = false ) .def("set_roughness_tex", py::overload_cast<const std::string, const int, const bool> (&Mesh::set_roughness_tex), py::arg().noconvert(), py::arg("subsample") = 1, py::arg("read_alpha") = false ) .def("set_smoothness_tex", py::overload_cast<const std::string, const int, const bool> (&Mesh::set_smoothness_tex), py::arg().noconvert(), py::arg("subsample") = 1, py::arg("read_alpha") = false ) .def("set_normals_tex", py::overload_cast<const std::string, const int, const bool> (&Mesh::set_normals_tex), py::arg().noconvert(), py::arg("subsample") = 1, py::arg("read_alpha") = false ) .def("set_diffuse_tex", py::overload_cast<const cv::Mat&, const int > (&Mesh::set_diffuse_tex), py::arg().noconvert(), py::arg("subsample") = 1 ) .def("set_metalness_tex", py::overload_cast<const cv::Mat&, const int > (&Mesh::set_metalness_tex), py::arg().noconvert(), py::arg("subsample") = 1 ) .def("set_roughness_tex", py::overload_cast<const cv::Mat&, const int > (&Mesh::set_roughness_tex), py::arg().noconvert(), py::arg("subsample") = 1 ) .def("set_smoothness_tex", py::overload_cast<const cv::Mat&, const int > (&Mesh::set_smoothness_tex), py::arg().noconvert(), py::arg("subsample") = 1 ) .def("set_normals_tex", py::overload_cast<const cv::Mat&, const int > (&Mesh::set_normals_tex), py::arg().noconvert(), py::arg("subsample") = 1 ) ; //Recorder py::class_<Recorder, std::shared_ptr<Recorder>> (m, "Recorder") // .def(py::init<>()) .def("record", py::overload_cast<const std::string, const std::string >(&Recorder::record) ) .def("snapshot", py::overload_cast<const std::string, const std::string >(&Recorder::snapshot) ) .def("write_without_buffering", &Recorder::write_without_buffering ) .def("is_finished", &Recorder::is_finished ) .def("nr_images_recorded", &Recorder::nr_images_recorded ) ; //Profiler py::class_<radu::utils::Profiler_ns::Profiler> (m, "Profiler") .def_static("is_profiling_gpu", &radu::utils::Profiler_ns::is_profiling_gpu ) .def_static("set_profile_gpu", &radu::utils::Profiler_ns::set_profile_gpu ) .def_static("start", []( std::string name ) { TIME_START(name); }) // .def_static("start_and_sync_cuda", []( std::string name ) { TIME_START(name); }) .def_static("end", []( std::string name ) { TIME_END(name); }) // .def_static("end_and_sync_cuda", []( std::string name ) { Profiler_ns::sync_cuda(name); TIME_END(name); }) .def_static("pause", []( std::string name ) { TIME_PAUSE(name); }) .def_static("print_all_stats", &radu::utils::Profiler_ns::Profiler::print_all_stats) // .def_static("scope", []( std::string name ) { TIME_SCOPE(name); }) //DOESNT work because scoping in python doesnt work like that. Rather the scope will die as soon as this function is finished ; //Recorder py::class_<radu::utils::ColorMngr, std::shared_ptr<radu::utils::ColorMngr>> (m, "ColorMngr") .def(py::init<>()) .def("magma_color", &radu::utils::ColorMngr::magma_color ) .def("plasma_color", &radu::utils::ColorMngr::plasma_color ) .def("viridis_color", &radu::utils::ColorMngr::viridis_color ) .def("mat2color", &radu::utils::ColorMngr::mat2color ) ; //utilsgl EVERYTHING hre is in another submodule py::module gl = m.def_submodule("gl", "GL is a submodule of easypbr"); gl.def("intrinsics_to_opengl_proj", &intrinsics_to_opengl_proj ); gl.def("opengl_proj_to_intrinsics", &opengl_proj_to_intrinsics ); //texture2d everything in a new submodule py::class_<gl::Texture2D> (gl, "Texture2D") .def(py::init<>()) .def("upload_from_cv_mat", &gl::Texture2D::upload_from_cv_mat, py::arg().noconvert(), py::arg("flip_red_blue") = true, py::arg("store_as_normalized_vals") = true ) .def("download_to_cv_mat", &gl::Texture2D::download_to_cv_mat, py::arg("lvl") = 0, py::arg("denormalize") = false ) #ifdef EASYPBR_WITH_TORCH .def("enable_cuda_transfer", &gl::Texture2D::enable_cuda_transfer ) .def("disable_cuda_transfer", &gl::Texture2D::disable_cuda_transfer ) .def("from_tensor", &gl::Texture2D::from_tensor, py::arg().noconvert(), py::arg("flip_red_blue") = false, py::arg("store_as_normalized_vals") = true ) .def("to_tensor", &gl::Texture2D::to_tensor ) #endif ; py::class_<gl::Buf> (gl, "Buf") .def(py::init<>()) #ifdef EASYPBR_WITH_TORCH .def("set_target_array_buffer", &gl::Buf::set_target_array_buffer ) .def("set_target_element_array_buffer", &gl::Buf::set_target_element_array_buffer ) .def("enable_cuda_transfer", &gl::Buf::enable_cuda_transfer ) .def("disable_cuda_transfer", &gl::Buf::disable_cuda_transfer ) .def("from_tensor", &gl::Buf::from_tensor ) // .def("to_tensor", [](gl::Buf &buf, py::object dtype){ // torch::ScalarType type = torch::python::detail::py_object_to_dtype(dtype); // return buf.to_tensor(type); // } ) //from https://discuss.pytorch.org/t/how-to-pass-python-device-and-dtype-to-c/69577/6 .def("to_tensor", [](gl::Buf &buf, py::object dtype){ const torch::ScalarType type = torch::python::detail::py_object_to_dtype(dtype); if (type==torch::kFloat32){ return buf.to_tensor<float>(); }else if (type==torch::kInt32){ return buf.to_tensor<int>(); }else{ LOG(FATAL) << "The type of tensor you are asking for is not implemented in the PyBridge. You need to add another explicit template specialization for it in the pybridge and also at the end of the Buf.cxx file."; return buf.to_tensor<float>(); //this line will never actually be reached but it stops the compiler from complainng for the function not having a return value } // return buf.to_tensor< decltype(c10::impl::ScalarTypeToCPPType<type::t>()) >(); } ) //from https://discuss.pytorch.org/t/how-to-pass-python-device-and-dtype-to-c/69577/6 #endif ; } } //namespace easy_pbr
54.25876
247
0.647094
peerschuett
fa8ac1e2ee8a2d80a1d6a4ef735b7380e23b281b
10,219
hpp
C++
include/dutil/queue.hpp
dumheter/dutil
515f7190b458a875a4c56f4f9c7274e1ac36b429
[ "MIT" ]
null
null
null
include/dutil/queue.hpp
dumheter/dutil
515f7190b458a875a4c56f4f9c7274e1ac36b429
[ "MIT" ]
null
null
null
include/dutil/queue.hpp
dumheter/dutil
515f7190b458a875a4c56f4f9c7274e1ac36b429
[ "MIT" ]
null
null
null
/** * MIT License * * Copyright (c) 2019 Christoffer Gustafsson * * 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. */ #pragma once #include <condition_variable> #include <mutex> #include <vector> #include "types.hpp" namespace dutil { enum class QueueResult : u8 { kSuccess = 0, kFull, kEmpty }; constexpr bool kNoMutex = false; constexpr bool kUseMutex = true; // forward declaration for the iterator template <typename T, bool TUseMutex> class Queue; /** * Iterator class to enable for range loops. */ template <typename T, bool TUseMutex> class QueueIterator { public: QueueIterator(const Queue<T, TUseMutex>* queue, size_t pos) : pos_(pos), queue_(queue) {} bool operator!=(const QueueIterator& other) const; T operator*() const; const QueueIterator& operator++(); const QueueIterator& operator--(); private: size_t pos_; const Queue<T, TUseMutex>* queue_; }; /** * Queue implemented with a ring buffer using std::vector as container. * Will not resize when full. * * @tparam T The type the queue will hold * @tparam TUseMutex will decide if the class will be thread safe. */ template <typename T, bool TUseMutex = kUseMutex> class Queue { public: /** * TODO implementation detail leaking out to user below! * @param size Note, with a size of 256 you can store 255 elements. */ Queue(const size_t size = 256); // TODO remove copy assign and construct, and force user to call copy method Queue(const Queue& other); Queue& operator=(const Queue& other); Queue(Queue&& other) noexcept; Queue& operator=(Queue&& other) noexcept; /** * Insert @elem at the end of the queue. */ QueueResult Push(const T& elem); QueueResult Push(T&& elem); /** * Remove the first element in the queue and put it in @dataOut. */ QueueResult Pop(T& dataOut); /** * Is the queue empty? */ bool Empty() { if constexpr (TUseMutex) { std::lock_guard<std::mutex> lock(mutex_); return queue_position_.Empty(); } else { return queue_position_.Empty(); } } /** * Wait for queue to not be empty. * @note Noop if you don't set TUseMutex to kUseMutex. */ void Wait() { if constexpr (TUseMutex == kUseMutex) { std::lock_guard<std::mutex> lock(mutex_); cv_.wait(lock, [this] { return !Empty(); }); } else { // noop if you don't use mutex } } /** * How many elements are in the queue. */ size_t Size() { if constexpr (TUseMutex) { std::lock_guard<std::mutex> lock(mutex_); return queue_position_.GetSize(); } else { return queue_position_.GetSize(); } } /** * How many elements can fit in the queue. */ size_t Capacity() const { return queue_position_.total_size(); } /** * Raw access to the underlying container, used by iterator. */ T UnsafeGet(const size_t pos) const { return vector_[pos]; } /** * Iterator pointing to beginning / front of the queue. */ QueueIterator<T, TUseMutex> begin() const { const size_t front = queue_position_.front() + 1 < Capacity() ? queue_position_.front() + 1 : 0; return QueueIterator<T, TUseMutex>(this, front); } /** * Iterator pointing to one step beyond the end / back of the queue. */ QueueIterator<T, TUseMutex> end() const { const size_t back = queue_position_.back() + 1 < Capacity() ? queue_position_.back() + 1 : 0; return QueueIterator<T, TUseMutex>(this, back); } /** * Get the item in the front of the queue. */ T Front() const { return *begin(); } /** * Get the item in back of queue. * @pre Must not be empty queue. */ T Back() const { return *--end(); } private: class QueuePosition { public: /** * As of now, when setting total_size, you can store total_size-1 elements. */ QueuePosition(size_t total_size = 256) : front_(0), back_(0), total_size_(total_size) {} QueueResult AddBack() { const size_t tmp = back_; back_ = back_ + 1 < total_size_ ? back_ + 1 : 0; QueueResult res; if (back_ != front_) { res = QueueResult::kSuccess; } else { back_ = tmp; res = QueueResult::kFull; } return res; } QueueResult RemoveFront() { QueueResult res; if (front_ != back_) { front_ = front_ + 1 < total_size_ ? front_ + 1 : 0; res = QueueResult::kSuccess; } else { res = QueueResult::kEmpty; } return res; } size_t back() const { return back_; } size_t front() const { return front_; } bool Empty() const { return front_ == back_; } size_t GetSize() const { if (back_ >= front_) return back_ - front_; else return total_size_ - front_ + back_; } size_t total_size() const { return total_size_; } private: size_t front_; size_t back_; size_t total_size_; }; private: std::vector<T> vector_; std::mutex mutex_{}; std::condition_variable cv_{}; QueuePosition queue_position_; }; // ============================================================ // // Template Definition // ============================================================ // template <typename T, bool TUseMutex> Queue<T, TUseMutex>::Queue(size_t size) : vector_(size), queue_position_(size) {} template <typename T, bool TUseMutex> Queue<T, TUseMutex>::Queue(const Queue& other) : vector_(), queue_position_() { std::lock_guard<std::mutex> lock(mutex_); vector_ = other.vector_; queue_position_ = other.queue_position_; } template <typename T, bool TUseMutex> Queue<T, TUseMutex>& Queue<T, TUseMutex>::operator=(const Queue& other) { if (this != &other) { std::lock_guard<std::mutex> lock(mutex_); vector_ = other.vector_; queue_position_ = other.queue_position_; } return *this; } template <typename T, bool TUseMutex> Queue<T, TUseMutex>::Queue(Queue&& other) noexcept : vector_(), queue_position_(0) { std::lock_guard<std::mutex> lock(mutex_); vector_ = std::move(other.vector_); queue_position_ = std::move(other.queue_position_); } template <typename T, bool TUseMutex> Queue<T, TUseMutex>& Queue<T, TUseMutex>::operator=(Queue&& other) noexcept { if (this != &other) { std::lock_guard<std::mutex> lock(mutex_); vector_ = std::move(other.vector_); queue_position_ = std::move(other.queue_position_); } return *this; } template <typename T, bool TUseMutex> QueueResult Queue<T, TUseMutex>::Push(const T& elem) { if constexpr (TUseMutex == kUseMutex) { std::lock_guard<std::mutex> lock(mutex_); const QueueResult res = this->queue_position_.AddBack(); if (res == QueueResult::kSuccess) { vector_[this->queue_position_.back()] = elem; cv_.notify_one(); } return res; } else { const QueueResult res = this->queue_position_.AddBack(); if (res == QueueResult::kSuccess) { vector_[this->queue_position_.back()] = elem; } return res; } } template <typename T, bool TUseMutex> QueueResult Queue<T, TUseMutex>::Push(T&& elem) { if constexpr (TUseMutex == kUseMutex) { std::lock_guard<std::mutex> lock(mutex_); const QueueResult res = this->queue_position_.AddBack(); if (res == QueueResult::kSuccess) { vector_[this->queue_position_.back()] = std::move(elem); cv_.notify_one(); } return res; } else { const QueueResult res = this->queue_position_.AddBack(); if (res == QueueResult::kSuccess) { vector_[this->queue_position_.back()] = std::move(elem); } return res; } } template <typename T, bool TUseMutex> QueueResult Queue<T, TUseMutex>::Pop(T& dataOut) { QueueResult res; if constexpr (TUseMutex == kUseMutex) { std::lock_guard<std::mutex> lock(mutex_); if (!this->queue_position_.Empty()) { res = this->queue_position_.RemoveFront(); dataOut = std::move(vector_[queue_position_.front()]); } else { res = QueueResult::kEmpty; } } else { if (!this->queue_position_.Empty()) { res = this->queue_position_.RemoveFront(); dataOut = std::move(vector_[queue_position_.front()]); } else { res = QueueResult::kEmpty; } } return res; } // ============================================================ // // Template definition for QueueIterator // ============================================================ // template <typename T, bool TUseMutex> bool QueueIterator<T, TUseMutex>::operator!=(const QueueIterator& other) const { return pos_ != other.pos_; } template <typename T, bool TUseMutex> T QueueIterator<T, TUseMutex>::operator*() const { return queue_->UnsafeGet(pos_); } template <typename T, bool TUseMutex> const QueueIterator<T, TUseMutex>& QueueIterator<T, TUseMutex>::operator++() { pos_ = pos_ + 1 < queue_->Capacity() ? pos_ + 1 : 0; return *this; } template <typename T, bool TUseMutex> const QueueIterator<T, TUseMutex>& QueueIterator<T, TUseMutex>::operator--() { pos_ = pos_ - 1 >= 0 ? pos_ - 1 : queue_->Capacity(); return *this; } } // namespace dutil
27.693767
80
0.635091
dumheter
fa8bb56d9db2206305dacee9c0a6f4c1d4416e95
2,962
cpp
C++
ql/experimental/finitedifferences/squarerootprocessrndcalculator.cpp
sfondi/QuantLib
8a2449d2fb470a7d47a55d3e99c5dace749709c9
[ "BSD-3-Clause" ]
41
2016-03-19T02:31:54.000Z
2022-01-20T13:23:20.000Z
ql/experimental/finitedifferences/squarerootprocessrndcalculator.cpp
sfondi/QuantLib
8a2449d2fb470a7d47a55d3e99c5dace749709c9
[ "BSD-3-Clause" ]
1
2020-07-17T18:49:22.000Z
2020-07-17T18:49:22.000Z
ql/experimental/finitedifferences/squarerootprocessrndcalculator.cpp
sfondi/QuantLib
8a2449d2fb470a7d47a55d3e99c5dace749709c9
[ "BSD-3-Clause" ]
22
2016-03-17T14:14:36.000Z
2022-03-28T10:33:19.000Z
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (C) 2015 Johannes Goettker-Schnetmann Copyright (C) 2015 Klaus Spanderen This file is part of QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ QuantLib is free software: you can redistribute it and/or modify it under the terms of the QuantLib license. You should have received a copy of the license along with this program; if not, please email <quantlib-dev@lists.sf.net>. The license is also available online at <http://quantlib.org/license.shtml>. 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 license for more details. */ #include <ql/experimental/finitedifferences/squarerootprocessrndcalculator.hpp> #include <boost/math/distributions/non_central_chi_squared.hpp> namespace QuantLib { SquareRootProcessRNDCalculator::SquareRootProcessRNDCalculator( Real v0, Real kappa, Real theta, Real sigma) : v0_(v0), kappa_(kappa), theta_(theta), d_(4*kappa/(sigma*sigma)), df_(d_*theta) { } Real SquareRootProcessRNDCalculator::pdf(Real v, Time t) const { const Real e = std::exp(-kappa_*t); const Real k = d_/(1-e); const Real ncp = k*v0_*e; const boost::math::non_central_chi_squared_distribution<Real> dist(df_, ncp); return boost::math::pdf(dist, v*k) * k; } Real SquareRootProcessRNDCalculator::cdf(Real v, Time t) const { const Real e = std::exp(-kappa_*t); const Real k = d_/(1-e); const Real ncp = k*v0_*e; const boost::math::non_central_chi_squared_distribution<Real> dist(df_, ncp); return boost::math::cdf(dist, v*k); } Real SquareRootProcessRNDCalculator::invcdf(Real q, Time t) const { const Real e = std::exp(-kappa_*t); const Real k = d_/(1-e); const Real ncp = k*v0_*e; const boost::math::non_central_chi_squared_distribution<Real> dist(df_, ncp); return boost::math::quantile(dist, q) / k; } Real SquareRootProcessRNDCalculator::stationary_pdf(Real v) const { const Real alpha = 0.5*df_; const Real beta = alpha/theta_; return std::pow(beta, alpha)*std::pow(v, alpha-1) *std::exp(-beta*v-boost::math::lgamma(alpha)); } Real SquareRootProcessRNDCalculator::stationary_cdf(Real v) const { const Real alpha = 0.5*df_; const Real beta = alpha/theta_; return boost::math::gamma_p(alpha, beta*v); } Real SquareRootProcessRNDCalculator::stationary_invcdf(Real q) const { const Real alpha = 0.5*df_; const Real beta = alpha/theta_; return boost::math::gamma_p_inv(alpha, q)/beta; } }
33.280899
79
0.663403
sfondi
fa8be100156cf8a7360bf1d05477ff4e1eca2eca
3,985
cpp
C++
2. Implementation of Stack using linked list.cpp
student-entrepreneur/DATA-STRUCTURE
83c2306c4e744f9a579102679439ec419fa4ff6f
[ "Apache-2.0" ]
null
null
null
2. Implementation of Stack using linked list.cpp
student-entrepreneur/DATA-STRUCTURE
83c2306c4e744f9a579102679439ec419fa4ff6f
[ "Apache-2.0" ]
null
null
null
2. Implementation of Stack using linked list.cpp
student-entrepreneur/DATA-STRUCTURE
83c2306c4e744f9a579102679439ec419fa4ff6f
[ "Apache-2.0" ]
null
null
null
#include<iostream> using namespace std; class node { public: int key=0; int data=0; node * next=NULL; }; class linklist { public: node * head; linklist() { head = NULL; } linklist(node * n) { head = n; } node * isnode(int k) { node * temporary = NULL; node * ptr = head; while (ptr != NULL) { if (ptr -> key == k) { temporary = ptr; } ptr = ptr -> next; } return temporary; } void addnode(node * n) { if (isnode(n -> key) != NULL) { cout << "Node is existing already"<<endl; } else { if (head == NULL) { head = n; cout << "Node added successfully" << endl; } else { node * ptr = head; while (ptr -> next != NULL) { ptr = ptr -> next; } ptr -> next = n; cout << "Node added successfully" << endl; } } } void insert(int k, node * n) { node * ptr = isnode(k); if (ptr == NULL) { cout << "Node does not exist" << endl; } else { if (isnode(n -> key) != NULL) { cout << "Node is existing already"<<endl; } else { n -> next = ptr -> next; ptr -> next = n; cout << "Node is inserted successfully" << endl; } } } void deletenode(int k) { if (head == NULL) { cout << "List is Empty." << endl; } else if (head != NULL) { if (head -> key == k) { head = head -> next; cout << "NOde" << k << " deleted successfully" << endl; } else { node * temp = NULL; node * before = head; node * current = head -> next; while (current != NULL) { if (current -> key == k) { temp = current; current = NULL; } else { before = before -> next; current = current -> next; } } if (temp != NULL) { before -> next = temp -> next; cout << "NOde" << k << " deleted successfully" << endl; } else { cout << "NOde" << k << " does not exist" << endl; } } } } void print() { if (head == NULL) { cout << "Linked list is empty"; } else { cout << endl << "Singly Linked List elements : "; node * temporary = head; while (temporary != NULL) { cout << "(" << temporary -> key << "," << temporary -> data << ")\v "; temporary = temporary -> next; } } } }; int main() { linklist s; int option; int key1, k1, data1; std::cout<< "Programmed by AKSHAYA RAJ S A \n"; while (1) { cout << "\n Enter your choice" << endl; cout << "1. Add a Node" << endl; cout << "2. Insert" << endl; cout << "3. Delete a Node" << endl; cout << "4. Print" << endl; cout << "5. Exit" << endl; cin >> option; node * n1 = new node(); switch (option) { case 0: break; case 1: cout << "\nEnter position & data of the Node to be Added" << endl; cin >> key1; cin >> data1; n1 -> key = key1; n1 -> data = data1; s.addnode(n1); break; case 2: cout << "\nEnter position of existing Node after which you want to Insert this New node: " << endl; cin >> k1; cout << "Enter position & data of the New Node first: " << endl; cin >> key1; cin >> data1; n1 -> key = key1; n1 -> data = data1; s.insert(k1, n1); break; case 3: cout << "\nEnter position of the Node to be deleted: " << endl; cin >> k1; s.deletenode(k1); break; case 4: s.print(); break; case 5: exit(0); default: cout<<"Enter a valid option"; } } return 0; }
19.727723
106
0.433877
student-entrepreneur
fa90d569b1793b67335c35f5ad6b648540116d88
11,649
cxx
C++
src/system/system.cxx
RyanLeeHayes/BLaDE
2361149996621b026a717abc49588f41b0fab7b3
[ "MIT" ]
7
2021-08-09T16:14:06.000Z
2022-03-29T19:04:37.000Z
src/system/system.cxx
RyanLeeHayes/BLaDE
2361149996621b026a717abc49588f41b0fab7b3
[ "MIT" ]
null
null
null
src/system/system.cxx
RyanLeeHayes/BLaDE
2361149996621b026a717abc49588f41b0fab7b3
[ "MIT" ]
null
null
null
#include <omp.h> #include <map> #include <string> #include "system/system.h" #include "io/io.h" #include "io/variables.h" #include "io/control.h" #include "system/parameters.h" #include "system/structure.h" #include "system/selections.h" #include "msld/msld.h" #include "system/coordinates.h" #include "run/run.h" #include "rng/rng_cpu.h" #include "rng/rng_gpu.h" #include "system/potential.h" #include "system/state.h" #include "domdec/domdec.h" // Class constructors System::System() { fprintf(stdout,"Creating a copy of system\n"); verbose=1; variables=new Variables; parameters=NULL; structure=NULL; selections=NULL; msld=NULL; coordinates=NULL; run=NULL; rngCPU=new RngCPU; // rngGPU=new RngGPU; // Have to be careful to allocate and free for correct GPU rngGPU=NULL; potential=NULL; state=NULL; domdec=NULL; setup_parse_system(); } System::~System() { fprintf(stdout,"Destroying a copy of system\n"); if (variables) delete(variables); if (parameters) delete(parameters); if (structure) delete(structure); if (selections) delete(selections); if (msld) delete(msld); if (coordinates) delete(coordinates); if (run) delete(run); if (rngCPU) delete(rngCPU); if (rngGPU) delete(rngGPU); if (potential) delete(potential); if (state) delete(state); if (domdec) delete(domdec); } // Parsing functions void System::parse_system(char *line,char *token,System *system) { std::string name; // System already exists. name=token; if (system->parseSystem.count(name)==0) system->error(line,token,system); // So much for function pointers being elegant. // call the function pointed to by: system->parseSystem[name] // within the object: system // with arguments: (line,token,system) (system->*(system->parseSystem[name]))(line,token,system); } void System::setup_parse_system() { parseSystem[""]=&System::pass; helpSystem[""]="If you see this string, something went wrong.\n"; parseSystem["help"]=&System::help; helpSystem["help"]="?help [directive]> Prints general help, including a list of directives. If a directive is listed, this prints help on that specific directive.\n"; parseSystem["parameters"]=&System::parse_system_parameters; helpSystem["parameters"]="?parameters> Loads parameters for an MSLD simulation. Should generally be done before anything else\n"; parseSystem["structure"]=&System::parse_system_structure; helpSystem["structure"]="?structure> Sets up a structure/topology/bond-connectivity, either using a sequence and .rtf (CHARMM residue topology file) or using a .psf (CHARMM protein structure file). Should be done second, after parameters have been loaded.\n"; parseSystem["selection"]=&System::parse_system_selection; helpSystem["selection"]="?selection> Sets selections of atoms for use in various other commands, including structure (you may want to delete a selection of atoms) and msld (you need to indicate which atoms are in which groups).\n"; parseSystem["msld"]=&System::parse_system_msld; helpSystem["msld"]="?msld> Set up MSLD data structures. Determines which atoms are in which groups, how to scale their interactions, and so on. Should be done after calls of structure, because if the indices of atoms change after calls to msld, an error will occur.\n"; parseSystem["coordinates"]=&System::parse_system_coordinates; helpSystem["coordinates"]="?coordinates> Sets the initial conditions of the system, including starting spatial coordinates. Must be called after structure is complete, must be called before run.\n"; parseSystem["run"]=&System::parse_system_run; helpSystem["run"]="?run> Run a calculation, such as a dynamics simulation, on the system. Must have parameters, structure, msld, and coordinates set up first.\n"; parseSystem["stream"]=&System::parse_system_stream; helpSystem["stream"]="?stream [filename]> Read commands from filename until they are finished, and then return to this point in this script.\n"; parseSystem["arrest"]=&System::parse_system_arrest; helpSystem["arrest"]="?arrest [int]> Hang the process for int seconds so a debugger like gdb can be attached. Defaults to 30 seconds if no argument is given. For code development only\n"; parseSystem["variables"]=&System::parse_system_variables; helpSystem["variables"]="?variables> Used for storing tokens and their values, for later use in parsing commands. Access the value by surrounding the token name in {}. For example:\nvariables set token1 help variables\n{token1}\nwill print this help message.\n"; parseSystem["if"]=&System::parse_system_if; helpSystem["if"]="?if [conditional]\nelseif [conditional]\nelse\nendif> Used for conditional execution in script\n"; parseSystem["elseif"]=&System::parse_system_elseif; helpSystem["elseif"]="?if [conditional]\nelseif [conditional]\nelse\nendif> Used for conditional execution in script\n"; parseSystem["else"]=&System::parse_system_else; helpSystem["else"]="?if [conditional]\nelse\nendif> Used for conditional execution in script\n"; parseSystem["endif"]=&System::parse_system_endif; helpSystem["endif"]="?if [conditional]\nelseif [conditional]\nelse\nendif> Used for conditional execution in script\n"; parseSystem["while"]=&System::parse_system_while; helpSystem["while"]="?while [conditional]\nendwhile> Used for loops within script. To use a for loop, place initialization before while and increment operation before endwhile.\n"; parseSystem["endwhile"]=&System::parse_system_endwhile; helpSystem["endwhile"]="?while [conditional]\nendwhile> Used for loops within script. To use a for loop, place initialization before while and increment operation before endwhile.\n"; parseSystem["verbose"]=&System::parse_system_verbose; helpSystem["verbose"]="?verbose [int]> Set a verbose level for output. verbose=1 is default, verbose=0 is less output.\n"; } // MOVE void System::pass(char *line,char *token,System *system) { ; } void System::parse_system_parameters(char *line,char *token,System *system) { parse_parameters(line,system); } void System::parse_system_structure(char *line,char *token,System *system) { parse_structure(line,system); } void System::parse_system_selection(char *line,char *token,System *system) { parse_selection(line,system); } void System::parse_system_msld(char *line,char *token,System *system) { parse_msld(line,system); } void System::parse_system_coordinates(char *line,char *token,System *system) { parse_coordinates(line,system); } void System::parse_system_run(char *line,char *token,System *system) { parse_run(line,system); } void System::parse_system_stream(char *line,char *token,System *system) { io_nexta(line,token); interpretter(token,system); } void System::parse_system_arrest(char *line,char *token,System *system) { arrested_development(system,io_nexti(line,30)); } void System::parse_system_variables(char *line,char *token,System *system) { parse_variables(line,system); } void System::parse_system_if(char *line,char *token,System *system) { parse_if(line,system); } void System::parse_system_elseif(char *line,char *token,System *system) { parse_elseif(line,system); } void System::parse_system_else(char *line,char *token,System *system) { parse_else(line,system); } void System::parse_system_endif(char *line,char *token,System *system) { parse_endif(line,system); } void System::parse_system_while(char *line,char *token,System *system) { parse_while(line,system); } void System::parse_system_endwhile(char *line,char *token,System *system) { parse_endwhile(line,system); } void System::parse_system_verbose(char *line,char *token,System *system) { verbose=io_nexti(line); } // MOVE void System::help(char *line,char *token,System *system) { std::string name=io_nexts(line); if (name=="") { fprintf(stdout,"?> This program uses a script to allow you to set up and run alchemical molecular simulations. Each line of the script starts with a directive, followed by other subdirectives. Comments after ! characters are ignored. At any point in the script, you may put help after a directive or subdirective to get documentation on how to use it. Top level directives are listed at the end of this help section. Directives can be divided into directives that set up and manipulate the system, and directives that alter the control flow and allow you to script the set up.\n\nSystem manipulation directives:\nThe general work flow is to set up the potential energy function parameters with calls to parameters, then set up the atoms, bond connectivity, and other potential terms with calls to structure, then set up the msld alchemical treatment with calls to msld, then set up the initial conditions or starting structure with calls to state. After all of that you are ready to call run to calculate energy, minimize the structure, or run dynamics.\n\nScripting control directives:\nStream allows you to start execution of another script from this point in the current script. Set allows you to set internal variables which can be accessed in subsequent commands by enclosing the variable name in {}. (Variable names can also contain variables via nested {{}}). Functions (function/endfunction) can be defined for later use and called (call), if (if/elseif/else/endif) and while (while/endwhile) loops are also available. Some of these features may not yet be implemented, see the listing below for what's available.\n\nSeveral available directives are:\n"); for (std::map<std::string,std::string>::iterator ii=helpSystem.begin(); ii!=helpSystem.end(); ii++) { fprintf(stdout," %s",ii->first.c_str()); } fprintf(stdout,"\n"); } else if (helpSystem.count(token)==1) { fprintf(stdout,helpSystem[name].c_str()); } else { error(line,token,system); } } void System::error(char *line,char *token,System *system) { fatal(__FILE__,__LINE__,"Unrecognized token: %s\n",token); } System* init_system() { System *system; int id; int idCount=omp_get_max_threads(); // omp_get_num_threads(); void **message; // OMP int available; int notAvailable=cudaGetDeviceCount(&available); if (notAvailable==1) fatal(__FILE__,__LINE__,"No GPUs available\n"); if (available<omp_get_max_threads()) fatal(__FILE__,__LINE__,"Running with %d omp threads but only %d GPUs\n",omp_get_max_threads(),available); system=new System[idCount]; message=(void**)calloc(idCount,sizeof(void*)); for (id=0; id<idCount; id++) { system[id].id=id; system[id].idCount=idCount; system[id].message=message; cudaSetDevice(id); if (id!=0) { int accessible; cudaDeviceCanAccessPeer(&accessible, id, 0); fprintf(stdout,"Device %d %s access device %d directly\n",id,(accessible?"can":"cannot"),0); if (accessible) { cudaDeviceEnablePeerAccess(0,0); // host 0, required 0 } } system[id].rngGPU=new RngGPU; } return system; } void dest_system(System *system) { int id; int idCount=omp_get_max_threads(); // omp_get_num_threads(); free(system->message); for (id=0; id<idCount; id++) { cudaSetDevice(id); if (id!=0) { int accessible; cudaDeviceCanAccessPeer(&accessible, id, 0); if (accessible) { cudaDeviceDisablePeerAccess(0); // host 0, have to disable on free, otherwise an error is thrown on reallocation } } delete(system[id].rngGPU); system[id].rngGPU=NULL; } delete[] system; } System* blade_init_system() { return init_system(); } void blade_dest_system(System *system) { dest_system(system); } void blade_set_device() { cudaSetDevice(omp_get_thread_num()); }
39.222222
1,667
0.738776
RyanLeeHayes
fa90fc9804c2833ceb0cf282fab2109ad530142b
3,295
hpp
C++
include/System/Security/Cryptography/X509Certificates/X509Helper2_MyNativeHelper.hpp
darknight1050/BeatSaber-Quest-Codegen
a6eeecc3f0e8f6079630f9a9a72b3121ac7b2032
[ "Unlicense" ]
null
null
null
include/System/Security/Cryptography/X509Certificates/X509Helper2_MyNativeHelper.hpp
darknight1050/BeatSaber-Quest-Codegen
a6eeecc3f0e8f6079630f9a9a72b3121ac7b2032
[ "Unlicense" ]
null
null
null
include/System/Security/Cryptography/X509Certificates/X509Helper2_MyNativeHelper.hpp
darknight1050/BeatSaber-Quest-Codegen
a6eeecc3f0e8f6079630f9a9a72b3121ac7b2032
[ "Unlicense" ]
null
null
null
// Autogenerated from CppHeaderCreator // Created by Sc2ad // ========================================================================= #pragma once // Begin includes #include "extern/beatsaber-hook/shared/utils/typedefs.h" // Including type: System.Security.Cryptography.X509Certificates.X509Helper2 #include "System/Security/Cryptography/X509Certificates/X509Helper2.hpp" // Including type: System.Security.Cryptography.X509Certificates.INativeCertificateHelper #include "System/Security/Cryptography/X509Certificates/INativeCertificateHelper.hpp" #include "extern/beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp" #include "extern/beatsaber-hook/shared/utils/il2cpp-utils-properties.hpp" #include "extern/beatsaber-hook/shared/utils/il2cpp-utils-fields.hpp" #include "extern/beatsaber-hook/shared/utils/utils.h" // Completed includes // Begin forward declares // Forward declaring namespace: System::Security::Cryptography::X509Certificates namespace System::Security::Cryptography::X509Certificates { // Forward declaring type: X509CertificateImpl class X509CertificateImpl; // Forward declaring type: X509Certificate class X509Certificate; } // Completed forward declares // Type namespace: System.Security.Cryptography.X509Certificates namespace System::Security::Cryptography::X509Certificates { // Size: 0x10 #pragma pack(push, 1) // Autogenerated type: System.Security.Cryptography.X509Certificates.X509Helper2/MyNativeHelper class X509Helper2::MyNativeHelper : public ::Il2CppObject/*, public System::Security::Cryptography::X509Certificates::INativeCertificateHelper*/ { public: // Creating value type constructor for type: MyNativeHelper MyNativeHelper() noexcept {} // Creating interface conversion operator: operator System::Security::Cryptography::X509Certificates::INativeCertificateHelper operator System::Security::Cryptography::X509Certificates::INativeCertificateHelper() noexcept { return *reinterpret_cast<System::Security::Cryptography::X509Certificates::INativeCertificateHelper*>(this); } // public System.Security.Cryptography.X509Certificates.X509CertificateImpl Import(System.Security.Cryptography.X509Certificates.X509Certificate cert) // Offset: 0x183A488 System::Security::Cryptography::X509Certificates::X509CertificateImpl* Import(System::Security::Cryptography::X509Certificates::X509Certificate* cert); // public System.Void .ctor() // Offset: 0x183A3F0 // Implemented from: System.Object // Base method: System.Void Object::.ctor() template<::il2cpp_utils::CreationType creationType = ::il2cpp_utils::CreationType::Temporary> static X509Helper2::MyNativeHelper* New_ctor() { static auto ___internal__logger = ::Logger::get().WithContext("System::Security::Cryptography::X509Certificates::X509Helper2::MyNativeHelper::.ctor"); return THROW_UNLESS((::il2cpp_utils::New<X509Helper2::MyNativeHelper*, creationType>())); } }; // System.Security.Cryptography.X509Certificates.X509Helper2/MyNativeHelper #pragma pack(pop) } DEFINE_IL2CPP_ARG_TYPE(System::Security::Cryptography::X509Certificates::X509Helper2::MyNativeHelper*, "System.Security.Cryptography.X509Certificates", "X509Helper2/MyNativeHelper");
61.018519
183
0.764795
darknight1050
fa9396375e746383efe6221cd7b7cb4e766278e2
9,844
cpp
C++
Javelin/Tools/jasm/main.cpp
jthlim/JavelinPattern
8add264f88ac620de109ddf797f7431779bbd9ea
[ "BSD-3-Clause" ]
10
2016-04-06T01:24:00.000Z
2021-11-16T10:16:51.000Z
Javelin/Tools/jasm/main.cpp
jthlim/JavelinPattern
8add264f88ac620de109ddf797f7431779bbd9ea
[ "BSD-3-Clause" ]
1
2016-05-06T05:38:58.000Z
2016-05-09T16:42:43.000Z
Javelin/Tools/jasm/main.cpp
jthlim/JavelinPattern
8add264f88ac620de109ddf797f7431779bbd9ea
[ "BSD-3-Clause" ]
null
null
null
//============================================================================ #include "Javelin/Tools/jasm/AssemblerException.h" #include "Javelin/Tools/jasm/CommandLine.h" #include "Javelin/Tools/jasm/File.h" #include "Javelin/Tools/jasm/Log.h" #include "Javelin/Tools/jasm/Preprocessor.h" #include "Javelin/Tools/jasm/SourceFileSegments.h" #include "Javelin/Tools/jasm/arm64/Assembler.h" #include "Javelin/Tools/jasm/riscv/Assembler.h" #include "Javelin/Tools/jasm/x64/Assembler.h" #include <unistd.h> //============================================================================ using namespace Javelin::Assembler; //============================================================================ class Main { public: Main(int argc, const char** argv) : commandLine(argc, argv) { } int Run(); private: CommandLine commandLine; SourceFileSegments fileSegments; FILE* CreateOutputFile(); void ReadInputFile(); void PreprocessFileSegments(); void ProcessFileSegments(FILE *outputFile); }; FILE* Main::CreateOutputFile() { if(!commandLine.GetOutputFilename()) { return stdout; } else { FILE *outputFile = fopen(commandLine.GetOutputFilename(), "wt"); if(!outputFile) { Log::Error("Unable to open output file: %s", commandLine.GetOutputFilename()); exit(2); } return outputFile; } } // Reads input file and handles .include void Main::ReadInputFile() { File file(commandLine.GetInputFilename()); if(!file.IsValid()) { Log::Error("Unable top open input file: %s", commandLine.GetInputFilename()); exit(1); } fileSegments.AddSegmentsFromFile(file); if(Log::IsVerboseEnabled()) { Log::Verbose("File Segments"); fileSegments.DumpSegments(); } } // Handles .define and .macro void Main::PreprocessFileSegments() { Preprocessor preprocessor; SourceFileSegments preprocessedFileSegments; for(CodeSegment *codeSegment : fileSegments) { try { switch(codeSegment->contentType) { case CodeSegment::ContentType::Assembler: preprocessor.Preprocess(preprocessedFileSegments, *codeSegment); break; case CodeSegment::ContentType::AssemblerTypeChange: case CodeSegment::ContentType::Literal: preprocessedFileSegments.push_back(new CodeSegment(*codeSegment)); break; } } catch(AssemblerException &ex) { ex.PopulateLocationIfNecessary(codeSegment->GetStartingLine(), codeSegment->GetStartingFileIndex()); for(const auto &it : ex) Log::Error("%s", it.GetLogString(fileSegments.GetFilenameList()).c_str()); } } if(Log::IsVerboseEnabled()) { Log::Verbose("Preprocessed Segments"); preprocessedFileSegments.DumpSegments(); Log::Verbose("Preprocessed Tokens"); preprocessedFileSegments.DumpTokens(); } preprocessedFileSegments.AdoptFileNameList(fileSegments); fileSegments = std::move(preprocessedFileSegments); } void Main::ProcessFileSegments(FILE *outputFile) { int expectedFileIndex = -1; for(CodeSegment *codeSegment : fileSegments) { try { switch(codeSegment->contentType) { case CodeSegment::ContentType::AssemblerTypeChange: for(const CodeLine &line : codeSegment->contents) { AssemblerType type(line.line); // This check is because comment lines can be merged with AssemblerTypeChange. if (type.IsValid()) { commandLine.SetAssemblerType(type); } } break; case CodeSegment::ContentType::Assembler: { if(Log::IsVerboseEnabled()) { Log::Verbose("Preprocessed\n"); codeSegment->Dump(); } int fileIndex = codeSegment->GetStartingFileIndex(); int lineNumber = codeSegment->GetStartingLine(); if(fileIndex != expectedFileIndex) { fprintf(outputFile, "#line %d \"%s\"\n", lineNumber, fileSegments.GetFilenameList()[fileIndex].c_str()); expectedFileIndex = fileIndex; } else { fprintf(outputFile, "#line %d\n", lineNumber); } switch(commandLine.GetAssemblerType()) { case AssemblerType::Unknown: Log::Error("Internal error - unknown AssemblerType"); break; case AssemblerType::Arm64: { arm64::Assembler assembler; assembler.AssembleSegment(*codeSegment, fileSegments.GetFilenameList()); if(Log::IsVerboseEnabled()) assembler.Dump(); assembler.Write(outputFile, lineNumber, &expectedFileIndex, fileSegments.GetFilenameList()); } break; case AssemblerType::RiscV: switch (commandLine.GetRiscVCMode()) { case RiscVCMode::Maybe: { riscv::Assembler assembler(false); assembler.AssembleSegment(*codeSegment, fileSegments.GetFilenameList()); if(Log::IsVerboseEnabled()) assembler.Dump(); riscv::Assembler compressedAssembler(true); compressedAssembler.AssembleSegment(*codeSegment, fileSegments.GetFilenameList()); if(Log::IsVerboseEnabled()) compressedAssembler.Dump(); if (!assembler.IsEquivalentByteCode(compressedAssembler)) { fprintf(outputFile, "#line %d\n", codeSegment->GetStartingLine()); fprintf(outputFile, "if (Javelin::Assembler::CanUseCompressedInstructions()) {\n"); fprintf(outputFile, "#line %d\n", codeSegment->GetStartingLine()); compressedAssembler.Write(outputFile, lineNumber, &expectedFileIndex, fileSegments.GetFilenameList()); fprintf(outputFile, "#line %d\n", codeSegment->GetStartingLine()); fprintf(outputFile, "} else {\n"); fprintf(outputFile, "#line %d\n", codeSegment->GetStartingLine()); assembler.Write(outputFile, lineNumber, &expectedFileIndex, fileSegments.GetFilenameList()); fprintf(outputFile, "#line %d\n", codeSegment->GetStartingLine()); fprintf(outputFile, "}\n"); } else { assembler.Write(outputFile, lineNumber, &expectedFileIndex, fileSegments.GetFilenameList()); } } break; case RiscVCMode::Always: { riscv::Assembler assembler(true); assembler.AssembleSegment(*codeSegment, fileSegments.GetFilenameList()); if(Log::IsVerboseEnabled()) assembler.Dump(); assembler.Write(outputFile, lineNumber, &expectedFileIndex, fileSegments.GetFilenameList()); } break; case RiscVCMode::Never: { riscv::Assembler assembler(false); assembler.AssembleSegment(*codeSegment, fileSegments.GetFilenameList()); if(Log::IsVerboseEnabled()) assembler.Dump(); assembler.Write(outputFile, lineNumber, &expectedFileIndex, fileSegments.GetFilenameList()); } break; } break; case AssemblerType::X64: { x64::Assembler assembler; assembler.AssembleSegment(*codeSegment, fileSegments.GetFilenameList()); if(Log::IsVerboseEnabled()) assembler.Dump(); assembler.Write(outputFile, lineNumber, &expectedFileIndex, fileSegments.GetFilenameList()); } break; } } break; case CodeSegment::ContentType::Literal: int expectedLineNumber = -1; for(const auto& s : codeSegment->contents) { if(s.fileIndex != expectedFileIndex || s.lineNumber != expectedLineNumber) { if(s.fileIndex != expectedFileIndex) { fprintf(outputFile, "#line %d \"%s\"\n", s.lineNumber, fileSegments.GetFilenameList()[s.fileIndex].c_str()); expectedFileIndex = s.fileIndex; } else { fprintf(outputFile, "#line %d\n", s.lineNumber); } expectedLineNumber = s.lineNumber + 1; } else ++expectedLineNumber; fprintf(outputFile, "%s\n", s.line.c_str()); // clang seems to get line numbers wrong when some preprocessor commands are issued. // Force a #line after a preprocessor: if(!s.line.empty() && s.line[0] == '#') expectedLineNumber = -1; } break; } } catch(AssemblerException &ex) { ex.PopulateLocationIfNecessary(codeSegment->GetStartingLine(), codeSegment->GetStartingFileIndex()); for(const auto &it : ex) Log::Error("%s", it.GetLogString(fileSegments.GetFilenameList()).c_str()); } } } int Main::Run() { FILE *outputFile = CreateOutputFile(); ReadInputFile(); PreprocessFileSegments(); ProcessFileSegments(outputFile); if(outputFile != stdout) fclose(outputFile); if(Log::GetNumberOfErrors() > 0) { unlink(commandLine.GetOutputFilename()); return 1; } return 0; } //============================================================================ int main(int argc, const char** argv) { Main main(argc, argv); return main.Run(); } //============================================================================
34.180556
138
0.568874
jthlim
b705d0deb22c4473098b9399959cd3b42e93c208
598
hpp
C++
FamilyTree2.0/FamilyTreeQtGui/AddPersonDialog.hpp
wampirat/FamilyTree
ee6edb8f9bd6afaed6014af21a39d3eb09bd638c
[ "MIT" ]
null
null
null
FamilyTree2.0/FamilyTreeQtGui/AddPersonDialog.hpp
wampirat/FamilyTree
ee6edb8f9bd6afaed6014af21a39d3eb09bd638c
[ "MIT" ]
null
null
null
FamilyTree2.0/FamilyTreeQtGui/AddPersonDialog.hpp
wampirat/FamilyTree
ee6edb8f9bd6afaed6014af21a39d3eb09bd638c
[ "MIT" ]
null
null
null
#ifndef ADDPERSONDIALOG_HPP #define ADDPERSONDIALOG_HPP #include "Person.hpp" #include <QDialog> namespace Ui { class AddPersonDialog; } class AddPersonDialog : public QDialog { Q_OBJECT public: explicit AddPersonDialog(QWidget *parent = 0); ~AddPersonDialog(); Person getPerson() const; bool isPersonCreated() const; private slots: void on_diedCheckBox_toggled(bool checked); void on_buttonBox_accepted(); private: Ui::AddPersonDialog *ui; Person person; bool personCreated = false; }; #endif // ADDPERSONDIALOG_HPP
17.588235
51
0.690635
wampirat
b707cf2582d638fcad2175f9b3858d35af4fc4cd
28,347
cpp
C++
maillage3d.cpp
MedMoute/EF-Solver
aa79a0b21b08016f66277ec2cba686776b83f0e3
[ "MIT" ]
null
null
null
maillage3d.cpp
MedMoute/EF-Solver
aa79a0b21b08016f66277ec2cba686776b83f0e3
[ "MIT" ]
null
null
null
maillage3d.cpp
MedMoute/EF-Solver
aa79a0b21b08016f66277ec2cba686776b83f0e3
[ "MIT" ]
1
2021-08-12T14:10:34.000Z
2021-08-12T14:10:34.000Z
#include "maillage3D.h" #include "utils.h" #include <chrono> #include <QString> #include <QDateTime> #include <Qt3DRender/QMesh> Maillage3D::Maillage3D(ifstream& fd) { nodes = new map<int,R3> ; boundary_nodes = new map<int,R3>; partitions = new vector<int>; edges = new map<int,pair<int,int>> ; faces = new map<int,tuple<int,int,int>> ; faces_bord = new map<int,tuple<int,int,int>>; elements = new map<int,tuple<int,int,int,int>>; elements_partition = new map<int,int> ; neighbors = new map<int,set<int>*>; neighbors_faces = new map<int,set<int>*>; neighbors_elements = new map<int,set<int>*>; boundary_neighbors = new map<int,set<int>*>; neighbors_interface = new map<int,pair<int,int>>; faces_bord_partitions = new map<int,int>; triangles_interfaces =new map<int,pair<int,int>> ; triangles_interfaces_nodes = new map<int,tuple<int,int,int>> ; // POUR LES FICHIERS VERSION 2.2+ SEULEMENT string line; //dump is a string to empty the line data after we've extracted the data from line. // on lit dans le fichier fd if(fd.is_open() ) { // on lit les lignes une par une et on avise en fonction des mots cle while ( fd.good() ) { getline (fd,line); // on regarde si on a un mot cle if( line[0] == '$' ) { if( line.compare("$MeshFormat")==0 ) { // je lis le format mais je n'en fais rien getline(fd,line) ; // je lis le mot cle de fin getline(fd,line) ; if( ! line.compare("$EndMeshFormat")==0 ) { cout << "Probleme de lecture du fichier maillage" << endl ; cout << "Mot cle MeshFormat non suivi de EndMeshFormat" << endl ; abort() ; } } else if( line.compare("$Nodes")==0 ) { // lecture du nombre de noeuds fd >> n_nodes; // on lit les coords for (int i = 0; i< n_nodes ; i++) { // variable dummy pour le numero de noeud int idx; float x,y,z; fd >> idx >> x >> y>>z ; fd.ignore(numeric_limits<streamsize>::max(), '\n');//ignore data until next line break nodes->insert(vertexR3(idx,R3(x,y,z))); if(i%10000==0) { cout<<"["<<int(i)*100/n_nodes<<"%]"<<"Analysing node #"<<i<<"/"<<n_nodes<<endl; } } cout<<"Node Analysis finished"<<endl; util::print_separator(); getline(fd,line) ; // on lit le mot cle de fin if( ! line.compare("$EndNodes")==0 ) { cout << "Probleme de lecture du fichier maillage" << endl ; cout << "Mot cle Nodes non suivi de EndNodes" << endl ; abort() ; } } else if( line.compare("$Elements")==0 ) { // on lit le nb d'elements fd >> n_elems; // on passe a la ligne pour la suite getline(fd,line) ; for( int i=0; i<n_elems ; i++) { // on ne sais pas combien il y a de parametres sur chaque ligne : on lit ligne par ligne getline(fd,line) ; // on compte les espaces pour savoir combien on a de parametres int nspace=0; for(unsigned int j=0; j!=line.size(); ++j) nspace+=( line.at(j)==' '); int ntmp = nspace+1 ; int* tmp = new int[ntmp] ; // on met les entiers dans les cases size_t spos ; size_t isize ; size_t sdeb = 0 ; int ind = 0 ; do { spos = line.find(' ', sdeb) ; isize = spos - sdeb ; istringstream(line.substr(sdeb, isize)) >> tmp[ind] ; ind ++; sdeb = spos+1 ; } while (spos!=string::npos ) ; // on a tous les entiers dans tmp // on remplit les membres de maillage int nb_sommet(util::type2nnodes(tmp[1])); // nb de sommets pour cet element if (nb_sommet==2)//l'element est un segment { edges->insert(edgeR3(tmp[0],pair<int,int>(tmp[ntmp-2],tmp[ntmp-1]))); } else if(nb_sommet==3)//l'element est un triangle { faces->insert(faceR3(tmp[0],tuple<int,int,int>(tmp[ntmp-3],tmp[ntmp-2],tmp[ntmp-1]))); //Remplissage de faces_bord_partitions int j; int n_interf_proches=0; for (j=0;j<ntmp;j++) { if (tmp[j]<0) { n_interf_proches++; } } if (n_interf_proches ==0)//L'element traité n'est pas sur une interface, il est donc sur le bord du domaine { faces_bord_partitions->insert(pair<int,int>(tmp[0],tmp[ntmp-4])); faces_bord->insert(faceR3(tmp[0],tuple<int,int,int>(tmp[ntmp-3],tmp[ntmp-2],tmp[ntmp-1]))); //On profite des information actuellement disponibles pour remplir la map des boundary_nodes. int k; for (k=1;k<=3;k++) { map<int,R3>::iterator nodes_it=nodes->find(tmp[ntmp-k]); if(nodes_it!=nodes->end()) { boundary_nodes->insert(pair<int,R3>(nodes_it->first,nodes_it->second)); } } } //remplissage neighbor elements for(j=1;j<=3;j++) { int idx = tmp[ntmp-j]; map<int,set<int>*>::iterator it_sets; it_sets =neighbors_faces->find(idx); set<int>* idx_neigh; if (it_sets!=neighbors_faces->end())//check if the neighor set already exists {//If yes fetch it idx_neigh = it_sets->second; } else {//Else add the previously created set to the map of neigbours idx_neigh=new set<int>; neighbors_faces->insert(pair<int,set<int>*>(idx,idx_neigh)); } //Then add the element to the set corresponding to the node idx_neigh->insert(tmp[0]); } } else if(nb_sommet==4)//l'element est un tetraedre { elements->insert(elementR3(tmp[0],tuple<int,int,int,int>(tmp[ntmp-4],tmp[ntmp-3],tmp[ntmp-2],tmp[ntmp-1]))); //remplissage neighbor elements int j; for(j=1;j<=4;j++) { int idx = tmp[ntmp-j]; map<int,set<int>*>::iterator it_sets; it_sets =neighbors_elements->find(idx); set<int>* idx_neigh; if (it_sets!=neighbors_elements->end())//check if the neighor set already exists {//If yes fetch it idx_neigh = neighbors_elements->find(idx)->second; } else {//Else add the previously created set to the map of neigbours idx_neigh=new set<int>; neighbors_elements->insert(pair<int,set<int>*>(idx,idx_neigh)); } //Then add the element to the set corresponding to the node idx_neigh->insert(tmp[0]); } //Remplissage de voisins interface // Supposition effectuée: // Les données négatives dans tmp correspondent aux partitions // dont l'element est à proximité, qui ne SONT PAS la partition de l'element. int n_part_proches=0; for (j=0;j<ntmp;j++) { if (tmp[j]<0) { n_part_proches++; } } //Ajout de l'information de la partition de l'element elements_partition->insert(pair<int,int>(tmp[0],tmp[ntmp-nb_sommet-n_part_proches-1])); //Insertions dans neigbors_interface for (j=0;j<ntmp;j++) { if (tmp[j]<0) { neighbors_interface->insert(pair<int,pair<int,int>>(tmp[0],pair<int,int>(tmp[ntmp-nb_sommet-n_part_proches-1],-1*tmp[j]))); } } //on ajoute la partition a la liste partitions->push_back(tmp[ntmp-nb_sommet-n_part_proches-1]); } delete [] tmp ; if(i%10000==0) { cout<<"["<<int(i)*100/n_elems<<"%]"<<"Analysing element #"<<i<<"/"<<n_elems<<endl; } } cout<<"Element Analysis finished"<<endl; util::print_separator(); getline(fd,line) ; if( ! line.compare("$EndElements")==0 ) { cout << "Probleme de lecture du fichier maillage" << endl ; cout << "Mot cle Nodes non suivi de EndElements" << endl ; } } } } } //Traitement des voisinages de noeuds map<int,tuple<int,int,int,int>>::iterator it; for (it=elements->begin(); it!=elements->end(); ++it) { int idx1 = get<0>(it->second); int idx2 = get<1>(it->second); int idx3 = get<2>(it->second); int idx4 = get<3>(it->second); map<int,set<int>*>::iterator it_sets; it_sets =neighbors->find(idx1); set<int>* idx1_neigh; if (it_sets!=neighbors->end())//check if the neighor set already exists {//If yes fetch it idx1_neigh = neighbors->find(idx1)->second; } else {//Else add the previously created set to the map of neigbours idx1_neigh=new set<int>; neighbors->insert(pair<int,set<int>*>(idx1,idx1_neigh)); } //Then add the neighbors to the set idx1_neigh->insert(idx2); idx1_neigh->insert(idx3); idx1_neigh->insert(idx4); //Adding the node itself for it to be considered in the Matrix Construction idx1_neigh->insert(idx1); //Do the same for the other nodes of the element it_sets =neighbors->find(idx2); set<int>* idx2_neigh; if (it_sets!=neighbors->end()) {idx2_neigh = neighbors->find(idx2)->second;} else {idx2_neigh= new set<int>;neighbors->insert(pair<int,set<int>*>(idx2,idx2_neigh));} idx2_neigh->insert(idx3); idx2_neigh->insert(idx1); idx2_neigh->insert(idx4); idx2_neigh->insert(idx2); it_sets =neighbors->find(idx3); set<int>* idx3_neigh; if (it_sets!=neighbors->end()) {idx3_neigh = neighbors->find(idx3)->second;} else {idx3_neigh=new set<int>;neighbors->insert(pair<int,set<int>*>(idx3,idx3_neigh));} idx3_neigh->insert(idx2); idx3_neigh->insert(idx1); idx3_neigh->insert(idx4); idx3_neigh->insert(idx3); it_sets =neighbors->find(idx4); set<int>* idx4_neigh; if (it_sets!=neighbors->end()) {idx4_neigh = neighbors->find(idx4)->second;} else {idx4_neigh=new set<int>;neighbors->insert(pair<int,set<int>*>(idx4,idx4_neigh));} idx4_neigh->insert(idx1); idx4_neigh->insert(idx2); idx4_neigh->insert(idx3); idx4_neigh->insert(idx4); } //Traitement des voisinages le long des triangles du bord du domaine map<int,tuple<int,int,int>>::iterator it_b; for (it_b=faces_bord->begin(); it_b!=faces_bord->end(); ++it_b) { int idx1 = get<0>(it_b->second); int idx2 = get<1>(it_b->second); int idx3 = get<2>(it_b->second); map<int,set<int>*>::iterator it_sets; it_sets =boundary_neighbors->find(idx1); set<int>* idx1_neigh; if (it_sets!=boundary_neighbors->end())//check if the neighor set already exists {//If yes fetch it idx1_neigh = boundary_neighbors->find(idx1)->second; } else {//Else add the previously created set to the map of neigbours idx1_neigh=new set<int>; boundary_neighbors->insert(pair<int,set<int>*>(idx1,idx1_neigh)); } //Then add the neighbors to the set idx1_neigh->insert(idx2); idx1_neigh->insert(idx3); //Do the same for the other nodes of the element it_sets =boundary_neighbors->find(idx2); set<int>* idx2_neigh; if (it_sets!=boundary_neighbors->end()) {idx2_neigh = boundary_neighbors->find(idx2)->second;} else {idx2_neigh = new set<int>;boundary_neighbors->insert(pair<int,set<int>*>(idx2,idx2_neigh));} idx2_neigh->insert(idx3); idx2_neigh->insert(idx1); it_sets =boundary_neighbors->find(idx3); set<int>* idx3_neigh=new set<int>; if (it_sets!=boundary_neighbors->end()) {idx3_neigh = boundary_neighbors->find(idx3)->second;} else {idx3_neigh=new set<int>;boundary_neighbors->insert(pair<int,set<int>*>(idx3,idx3_neigh));} idx3_neigh->insert(idx2); idx3_neigh->insert(idx1); } //Traitement du vecteur partitions (suppresion des doublons) vector< int >::iterator r , w ; set< int > tmpset ; for( r = partitions->begin() , w = partitions->begin() ; r != partitions->end() ; ++r ) { if( tmpset.insert( *r ).second ) { *w++ = *r ; } } partitions->erase( w , partitions->end() ); //On ajoute le traitement des interfaces et la création des structures de triangles posés sur les interfaces if (partitions->size()>1) CreateInterfaceTriangles(); } int Maillage3D::GetPartitionSize( int _part) { //TODO int res=0; return res; } void Maillage3D::CreateInterfaceTriangles() { cout<<"Creating Interfaces between partitions. This step can take a while..."<<endl; int i,j; int part_i,part_j; int elem_i,elem_j; tuple<int,int,int,int> nodes_i,nodes_j; map<int,tuple<int,int,int,int>>::iterator it_nodes_i,it_nodes_j; //Debug for CPU time auto start_time = chrono::system_clock::now(); auto elapsed_seconds_common = chrono::duration<float>(start_time-start_time).count(); int commonTriCount=0; int neigh_i_size=0; int neigh_j_size=0; for (i=0;i<partitions->size();i++) { part_i=partitions->at(i); for (j=0;j<i;j++) { part_j=partitions->at(j); if (part_i!=part_j) { map<int,pair<int,int>>::iterator it_i; map<int,pair<int,int>>::iterator it_j; //Parcours des éléments à proximité d'une interface et recherche de l'interface en cours for (it_i = neighbors_interface->begin(); it_i != neighbors_interface->end(); ++it_i ) if (it_i->second == pair<int,int>(part_i,part_j)) {//Parcours des elements de la partition i à proximité de j elem_i=it_i->first; //recuperation des noeuds de l'elem de i en cours de traitement it_nodes_i=elements->find(elem_i); neigh_i_size++; if (it_nodes_i!=elements->end()) { nodes_i=it_nodes_i->second; } for (it_j = neighbors_interface->begin(); it_j != neighbors_interface->end(); ++it_j ) if (it_j->second == pair<int,int>(part_j,part_i)) {//Parcours des elements de la partition j à proximité de i elem_j=it_j->first; //recuperation des noeuds de l'elem de j en cours de traitemetn it_nodes_j=elements->find(elem_j); neigh_j_size++; if (it_nodes_j!=elements->end()) { nodes_j=it_nodes_j->second; pair<bool,tuple<int,int,int>> Tri; auto start_time_common = chrono::system_clock::now(); Tri = CommonTriangle(nodes_i,nodes_j); auto end_time_common = chrono::system_clock::now(); elapsed_seconds_common += chrono::duration<float>(end_time_common-start_time_common).count(); commonTriCount++; if(Tri.first==1) { //cout<<get<0>(Tri.second)<<"-"<<get<1>(Tri.second)<<"-"<<get<2>(Tri.second)<<endl; triangles_interfaces->insert(pair<int,pair<int,int>>(triangles_interfaces->size()+1,pair<int,int>(part_i,part_j))); triangles_interfaces_nodes->insert(pair<int,tuple<int,int,int>>(triangles_interfaces_nodes->size()+1,tuple<int,int,int>(Tri.second))); } } } } } } cout<<endl; } auto end_time = chrono::system_clock::now(); auto elapsed_seconds = chrono::duration<float>(end_time-start_time).count(); cout<<"Traitement et extractions des interfaces effectue en "<<elapsed_seconds<<"s."<<endl; cout<<commonTriCount<<" passes de commonTriangle effectuees en "<<elapsed_seconds_common<<"s."<<endl; cout<< "Duree moy. de commonTriangle: "<<elapsed_seconds_common/commonTriCount<<"s."<<endl; cout<<"Loop 1 size : "<< neigh_i_size<<" --- Loop 2 size : "<<neigh_j_size/neigh_i_size<<endl; } pair<bool,tuple<int,int,int>> Maillage3D::CommonTriangle(tuple<int,int,int,int> elem_i,tuple<int,int,int,int> elem_j) { tuple<int,int,int> a{-1,-1,-1}; int i_1=get<0>(elem_i); int i_2=get<1>(elem_i); int i_3=get<2>(elem_i); int i_4=get<3>(elem_i); int j_1=get<0>(elem_j); int j_2=get<1>(elem_j); int j_3=get<2>(elem_j); int j_4=get<3>(elem_j); vector<int> elem_i_s{i_1,i_2,i_3,i_4}; sort(elem_i_s.begin(),elem_i_s.end()); vector<int> elem_j_s{j_1,j_2,j_3,j_4}; sort(elem_j_s.begin(),elem_j_s.end()); int i_s_1=elem_i_s.at(0); int i_s_2=elem_i_s.at(1); int i_s_3=elem_i_s.at(2); int i_s_4=elem_i_s.at(3); int j_s_1=elem_j_s.at(0); int j_s_2=elem_j_s.at(1); int j_s_3=elem_j_s.at(2); int j_s_4=elem_j_s.at(3); //Debug output of commonTriangle //cout<<"TEST "<<i_s_1<<"-"<<i_s_2<<"-"<<i_s_3<<"-"<<i_s_4<<" // " <<j_s_1<<"-"<<j_s_2<<"-"<<j_s_3<<"-"<<j_s_4<<endl; //There are 14 permutation cases possible for 3 in 4 for sorted sets if (i_s_1==j_s_1 && i_s_2==j_s_2 && i_s_3==j_s_3)// Cas |||o //placeholder { return pair<bool,tuple<int,int,int>>(true,tuple<int,int,int>(i_s_1,i_s_2,i_s_3)); } else if (i_s_1==j_s_1 && i_s_2==j_s_2 && i_s_4==j_s_4)// Cas ||o| //placeholder { return pair<bool,tuple<int,int,int>>(true,tuple<int,int,int>(i_s_1,i_s_2,i_s_4)); } else if (i_s_1==j_s_1 && i_s_3==j_s_3 && i_s_4==j_s_4)//cas |o|| //placeholder { return pair<bool,tuple<int,int,int>>(true,tuple<int,int,int>(i_s_1,i_s_3,i_s_4)); } else if (i_s_2==j_s_2 && i_s_3==j_s_3 && i_s_4==j_s_4)// cas o||| //placeholder { return pair<bool,tuple<int,int,int>>(true,tuple<int,int,int>(i_s_2,i_s_2,i_s_4)); } else if (i_s_1==j_s_1 && i_s_2==j_s_2 && i_s_4==j_s_3)//cas ||/ //placeholder { return pair<bool,tuple<int,int,int>>(true,tuple<int,int,int>(i_s_1,i_s_2,i_s_4)); } else if (i_s_1==j_s_1 && i_s_2==j_s_2 && i_s_3==j_s_4)//cas ||\ //placeholder { return pair<bool,tuple<int,int,int>>(true,tuple<int,int,int>(i_s_1,i_s_2,i_s_3)); } else if (i_s_2==j_s_1 && i_s_3==j_s_3 && i_s_4==j_s_4)//cas /|| //placeholder { return pair<bool,tuple<int,int,int>>(true,tuple<int,int,int>(i_s_2,i_s_3,i_s_4)); } else if (i_s_1==j_s_2 && i_s_3==j_s_3 && i_s_4==j_s_4)//cas \|| //placeholder { return pair<bool,tuple<int,int,int>>(true,tuple<int,int,int>(i_s_1,i_s_3,i_s_4)); } else if (i_s_1==j_s_1 && i_s_2==j_s_3 && i_s_4==j_s_4)//cas |\| //placeholder { return pair<bool,tuple<int,int,int>>(true,tuple<int,int,int>(i_s_1,i_s_2,i_s_4)); } else if (i_s_1==j_s_1 && i_s_3==j_s_2 && i_s_4==j_s_4)// cas |/| //placeholder { return pair<bool,tuple<int,int,int>>(true,tuple<int,int,int>(i_s_1,i_s_3,i_s_4)); } else if (i_s_1==j_s_1 && i_s_3==j_s_2 && i_s_4==j_s_3)// cas |// //placeholder { return pair<bool,tuple<int,int,int>>(true,tuple<int,int,int>(i_s_1,i_s_3,i_s_4)); } else if (i_s_1==j_s_1 && i_s_2==j_s_3 && i_s_3==j_s_4)// cas | \ \ //placeholder { return pair<bool,tuple<int,int,int>>(true,tuple<int,int,int>(i_s_1,i_s_2,i_s_3)); } else if (i_s_1==j_s_2 && i_s_2==j_s_3 && i_s_4==j_s_4)//cas \\| //placeholder { return pair<bool,tuple<int,int,int>>(true,tuple<int,int,int>(i_s_1,i_s_2,i_s_4)); } else if (i_s_2==j_s_1 && i_s_3==j_s_2 && i_s_4==j_s_4)//cas //| //placeholder { return pair<bool,tuple<int,int,int>>(true,tuple<int,int,int>(i_s_2,i_s_3,i_s_4)); } else { return pair<bool,tuple<int,int,int>>(false,a); } } void Maillage3D::DisplayBoundaryElements() { util::print_separator(); cout<<"Elements situes sur le bord du domaine : "<<endl; cout<<faces_bord_partitions->size()<<" elements sur le bord du maillage"<<endl; } void Maillage3D::DisplayInterfacesElements() { util::print_separator(); cout<<"Elements a proximite des interfaces : "<<endl; cout<<neighbors_interface->size()<<" elements proches d'une interface dans le maillage"<<endl; int i,j; int part_i,part_j; for (i=0;i<partitions->size();i++) { part_i=partitions->at(i); for (j=0;j<partitions->size();j++) { part_j=partitions->at(j); if (part_i!=part_j) { map<int,pair<int,int>>::iterator it; cout<<"Interface "<<part_i<<"/"<<part_j<<":"<<endl; //Parcours des éléments à proximité d'une interface et recherche de l'interface en cours for (it = neighbors_interface->begin(); it != neighbors_interface->end(); ++it ) if (it->second == pair<int,int>(part_i,part_j)) { cout<<it->first<<" -"; } } } cout<<endl; } util::print_separator(); } void Maillage3D::DisplayInterfacesTriangles() { util::print_separator(); cout<<"Triangles poses sur des interfaces : "<<endl; cout<<triangles_interfaces->size()<<" triangles poses sur les interfaces dans le maillage"<<endl; int i,j; int part_i,part_j; for (i=0;i<partitions->size();i++) { part_i=partitions->at(i); for (j=0;j<partitions->size();j++) { part_j=partitions->at(j); if (part_i!=part_j) { map<int,pair<int,int>>::iterator it; cout<<"Interface "<<part_i<<"/"<<part_j<<":"<<endl; //Parcours des éléments à proximité d'une interface et recherche de l'interface en cours for (it = triangles_interfaces->begin(); it != triangles_interfaces->end(); ++it ) if (it->second == pair<int,int>(part_i,part_j)) { cout<<it->first<<" -"; } } } cout<<endl; } util::print_separator(); } void Maillage3D::DisplayBasicData() { util::print_separator(); cout<<"Le maillage contient :"<<endl<<"* "<<this->GetNodesSize()<<"nodes"<<endl; cout<<"* "<<this->GetEdgesSize() <<" edges"<<endl; cout<<"* "<<this->GetFacesSize() <<" faces"<<endl; cout<<"* "<<this->GetElementsSize() <<" elements"<<endl; cout<<"On a trouve "<<triangles_interfaces->size()<<" triangles poses sur des interfaces"<<endl; } int Maillage3D::ExportMeshAsOBJFile(string filepath, bool verbose) { //Debug >Output verbose=0; util::print_separator(); cout<<"Exporting Mesh File as "<<filepath<<"."; std::ofstream FILE; FILE.open(filepath.c_str(), std::ios::out); if (FILE.fail()) { std::cout<<"Erreur lors de l'ouverture de FILE"<<std::endl; return 1; } else // Working out FILE : dumping output { FILE<<"#File Generated on "<<QDateTime::currentDateTime().toString().toStdString()<<" by EF-Solver.MeshToObj"<<endl; if (verbose) cout<<"#File Generated on "<<QDateTime::currentDateTime().toString().toStdString()<<" by EF-Solver.MeshToObj"<<endl; map<int,R3>::iterator node_it; map<int,tuple<int,int,int>>::iterator face_it; for (node_it=GetBoundaryNodesMap()->begin();node_it!=GetBoundaryNodesMap()->end();++node_it) { FILE<<"v "; FILE<<(*node_it).second.X_()<<" "<<(*node_it).second.Y_()<<" "<<(*node_it).second.Z_()<<endl; if (verbose) { cout<<"v "; cout<<(*node_it).second.X_()<<" "<<(*node_it).second.Y_()<<" "<<(*node_it).second.Z_()<<endl; } } for(face_it=GetBoundaryFacesMap()->begin();face_it!=GetBoundaryFacesMap()->end();++face_it) { FILE<<"f "; FILE<<std::get<0>((*face_it).second)<<" "<<std::get<1>((*face_it).second)<<" "<<std::get<2>((*face_it).second)<<endl; if (verbose) { cout<<"f "; cout<<std::get<0>((*face_it).second)<<" "<<std::get<1>((*face_it).second)<<" "<<std::get<2>((*face_it).second)<<endl; } } FILE.close(); } return 0; } Maillage3D::~Maillage3D() {}
40.151558
174
0.496913
MedMoute
b70bd4ad11e928c293e1b963d4909cb88658011e
1,754
cpp
C++
problems/kickstart/2018/E/milk-tea/code.cpp
brunodccarvalho/competitive
4177c439174fbe749293b9da3445ce7303bd23c2
[ "MIT" ]
7
2020-10-15T22:37:10.000Z
2022-02-26T17:23:49.000Z
problems/kickstart/2018/E/milk-tea/code.cpp
brunodccarvalho/competitive
4177c439174fbe749293b9da3445ce7303bd23c2
[ "MIT" ]
null
null
null
problems/kickstart/2018/E/milk-tea/code.cpp
brunodccarvalho/competitive
4177c439174fbe749293b9da3445ce7303bd23c2
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> using namespace std; // ***** using Mask = bitset<100>; struct CacheMask { Mask mask; int complaints = 0; }; bool operator<(const CacheMask &lhs, const CacheMask &rhs) { int L = lhs.complaints, R = rhs.complaints; return L < R; } auto solve() { int N, M, P; cin >> N >> M >> P >> ws; vector<Mask> prefs(N); vector<Mask> bans(M); for (int i = 0; i < N; i++) { string strpref; getline(cin, strpref); prefs[i] = Mask(strpref); } for (int i = 0; i < M; i++) { string strban; getline(cin, strban); bans[i] = Mask(strban); } vector<int> bits(P, 0); for (int i = 0; i < N; i++) { for (int b = 0; b < P; b++) { bits[b] += prefs[i][b]; } } vector<CacheMask> milks; // find M + 1 best milks milks.push_back({{}, 0}); for (int b = 0; b < P; b++) { milks[0].complaints += bits[b]; } for (int b = 0; b < P; b++) { int S = milks.size(); milks.resize(2 * S); for (int i = 0; i < S; i++) { milks[i + S] = milks[i]; milks[i].mask[b] = true; milks[i].complaints += N - 2 * bits[b]; } sort(milks.begin(), milks.end()); milks.resize(min(2 * S, M + 1)); } int S = milks.size(); for (int i = 0; i < S; i++) { if (find(begin(bans), end(bans), milks[i].mask) == end(bans)) { return milks[i].complaints; } } __builtin_unreachable(); } // ***** int main() { unsigned T; cin >> T >> ws; for (unsigned t = 1; t <= T; ++t) { auto solution = solve(); cout << "Case #" << t << ": " << solution << '\n'; } return 0; }
22.202532
71
0.45325
brunodccarvalho
b70fd573659f9ad736f1e071b3b6a85986cf777e
1,091
hpp
C++
BW/Loadouts/civ_europe.hpp
ltac/ltmf-campus-martius.stratis
54ae06c5bed06edd86e30f7098e4c94ff3a24a44
[ "Unlicense" ]
null
null
null
BW/Loadouts/civ_europe.hpp
ltac/ltmf-campus-martius.stratis
54ae06c5bed06edd86e30f7098e4c94ff3a24a44
[ "Unlicense" ]
null
null
null
BW/Loadouts/civ_europe.hpp
ltac/ltmf-campus-martius.stratis
54ae06c5bed06edd86e30f7098e4c94ff3a24a44
[ "Unlicense" ]
null
null
null
class CIV_F { class C_man_1 { uniform[] = {"U_C_Poloshirt_blue","U_C_Poloshirt_burgundy","U_C_Poloshirt_stripped","U_C_Poloshirt_tricolour","U_C_Poloshirt_salmon","U_C_Poloshirt_redwhite"}; /// randomized vest[] = {}; /// randomized headgear[] = {}; /// randomized backpack[] = {}; /// randomized backpackItems[] = {}; weapons[] = {}; /// randomized launchers[] = {}; /// randomized handguns[] = {}; /// randomized magazines[] = {}; items[] = {"ACE_fieldDressing:3"}; linkedItems[] = {"ItemMap","ItemCompass","ItemWatch"}; attachments[] = {}; }; class C_journalist_F: C_man_1 { uniform[] = {"U_C_Journalist"}; /// randomized vest[] = {"V_Press_F"}; /// randomized headgear[] = {"H_Cap_press"}; /// randomized }; class CEO: C_man_1 { uniform[] = {"U_Marshal"}; /// randomized headgear[] = {"H_Hat_brown"}; items[] += {}; }; class C_man_hunter_1_F: C_man_1 { uniform[] = {"U_C_HunterBody_grn"}; /// randomized headgear[] = {"H_Booniehat_grn"}; /// randomized weapons[] = {}; magazines[] = {}; backpack[] = {"B_OutdoorPack_blk"}; }; };
33.060606
177
0.618698
ltac
b7163b532d21a2a910163bb7709112ebc87fb6c9
1,377
cpp
C++
Borg/src/Drawing/Color.cpp
bromix/Borg
ecce187e01c9da8bd85ecc4c0a318d7a2b17431d
[ "MIT" ]
null
null
null
Borg/src/Drawing/Color.cpp
bromix/Borg
ecce187e01c9da8bd85ecc4c0a318d7a2b17431d
[ "MIT" ]
null
null
null
Borg/src/Drawing/Color.cpp
bromix/Borg
ecce187e01c9da8bd85ecc4c0a318d7a2b17431d
[ "MIT" ]
null
null
null
#include "Borg/Drawing/Color.h" namespace Borg::Drawing { uint8_t Color::A() const { return m_A; } uint8_t Color::R() const { return m_R; } uint8_t Color::G() const { return m_G; } uint8_t Color::B() const { return m_B; } uint32_t Color::ToArgb() const { return (m_A << 24) + (m_R << 16) + (m_G << 8) + m_B; } uint32_t Color::ToBgr() const { return (m_R) | (m_G << 8) | (m_B << 16); } Color Color::FromArgb(uint32_t argb) { Color color; color.m_A = (argb & 0xFF000000) >> 24; color.m_R = (argb & 0x00FF0000) >> 16; color.m_G = (argb & 0x0000FF00) >> 8; color.m_B = (argb & 0x000000FF); return color; } Color Color::FromArgb(uint8_t r, uint8_t g, uint8_t b) { Color color; color.m_A = 255; color.m_R = r; color.m_G = g; color.m_B = b; return color; } Color Color::Red = Color::FromArgb(0xFFFF0000); Color Color::Green = Color::FromArgb(0xFF008000); Color Color::Blue = Color::FromArgb(0xFF0000FF); Color Color::Black = Color::FromArgb(0xFF000000); Color Color::White = Color::FromArgb(0xFFFFFFFF); Color Color::Lime = Color::FromArgb(0xFF00FF00); Color Color::Fuchsia = Color::FromArgb(0xFFFF00FF); }
21.857143
60
0.543936
bromix
b727c69608602672d808d773abcf1185012dde47
14,208
cpp
C++
export/release/windows/obj/src/Achievements.cpp
TheSlithyGamer4evr/Friend-Trouble-Source
a540ec9cf4cf3033e0c340e5e4f50d647b94d4a3
[ "Apache-2.0" ]
null
null
null
export/release/windows/obj/src/Achievements.cpp
TheSlithyGamer4evr/Friend-Trouble-Source
a540ec9cf4cf3033e0c340e5e4f50d647b94d4a3
[ "Apache-2.0" ]
null
null
null
export/release/windows/obj/src/Achievements.cpp
TheSlithyGamer4evr/Friend-Trouble-Source
a540ec9cf4cf3033e0c340e5e4f50d647b94d4a3
[ "Apache-2.0" ]
null
null
null
#include <hxcpp.h> #ifndef INCLUDED_Achievements #include <Achievements.h> #endif #ifndef INCLUDED_Paths #include <Paths.h> #endif #ifndef INCLUDED_flixel_FlxBasic #include <flixel/FlxBasic.h> #endif #ifndef INCLUDED_flixel_FlxG #include <flixel/FlxG.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_util_FlxSave #include <flixel/util/FlxSave.h> #endif #ifndef INCLUDED_flixel_util_IFlxDestroyable #include <flixel/util/IFlxDestroyable.h> #endif #ifndef INCLUDED_haxe_IMap #include <haxe/IMap.h> #endif #ifndef INCLUDED_haxe_ds_StringMap #include <haxe/ds/StringMap.h> #endif HX_LOCAL_STACK_FRAME(_hx_pos_51d0672471f6b710_34_unlockAchievement,"Achievements","unlockAchievement",0xddbd5e61,"Achievements.unlockAchievement","Achievements.hx",34,0xf249f7fa) HX_LOCAL_STACK_FRAME(_hx_pos_51d0672471f6b710_40_isAchievementUnlocked,"Achievements","isAchievementUnlocked",0x1e700b3e,"Achievements.isAchievementUnlocked","Achievements.hx",40,0xf249f7fa) HX_LOCAL_STACK_FRAME(_hx_pos_51d0672471f6b710_47_getAchievementIndex,"Achievements","getAchievementIndex",0x4a8ffcaf,"Achievements.getAchievementIndex","Achievements.hx",47,0xf249f7fa) HX_LOCAL_STACK_FRAME(_hx_pos_51d0672471f6b710_57_loadAchievements,"Achievements","loadAchievements",0x7629cad4,"Achievements.loadAchievements","Achievements.hx",57,0xf249f7fa) HX_LOCAL_STACK_FRAME(_hx_pos_51d0672471f6b710_13_boot,"Achievements","boot",0x8eb5af9c,"Achievements.boot","Achievements.hx",13,0xf249f7fa) HX_LOCAL_STACK_FRAME(_hx_pos_51d0672471f6b710_31_boot,"Achievements","boot",0x8eb5af9c,"Achievements.boot","Achievements.hx",31,0xf249f7fa) HX_LOCAL_STACK_FRAME(_hx_pos_51d0672471f6b710_33_boot,"Achievements","boot",0x8eb5af9c,"Achievements.boot","Achievements.hx",33,0xf249f7fa) void Achievements_obj::__construct() { } Dynamic Achievements_obj::__CreateEmpty() { return new Achievements_obj; } void *Achievements_obj::_hx_vtable = 0; Dynamic Achievements_obj::__Create(::hx::DynamicArray inArgs) { ::hx::ObjectPtr< Achievements_obj > _hx_result = new Achievements_obj(); _hx_result->__construct(); return _hx_result; } bool Achievements_obj::_hx_isInstanceOf(int inClassId) { return inClassId==(int)0x00000001 || inClassId==(int)0x375f4004; } ::cpp::VirtualArray Achievements_obj::achievementsStuff; ::haxe::ds::StringMap Achievements_obj::achievementsMap; int Achievements_obj::henchmenDeath; void Achievements_obj::unlockAchievement(::String name){ HX_STACKFRAME(&_hx_pos_51d0672471f6b710_34_unlockAchievement) HXLINE( 36) ::Achievements_obj::achievementsMap->set(name,true); HXLINE( 37) ::flixel::_hx_system::frontEnds::SoundFrontEnd _hx_tmp = ::flixel::FlxG_obj::sound; HXDLIN( 37) _hx_tmp->play(::Paths_obj::sound(HX_("confirmMenu",bf,8e,fe,3c),null()),((Float)0.7),null(),null(),null(),null()); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(Achievements_obj,unlockAchievement,(void)) bool Achievements_obj::isAchievementUnlocked(::String name){ HX_STACKFRAME(&_hx_pos_51d0672471f6b710_40_isAchievementUnlocked) HXLINE( 41) bool _hx_tmp; HXDLIN( 41) if (::Achievements_obj::achievementsMap->exists(name)) { HXLINE( 41) _hx_tmp = ::Achievements_obj::achievementsMap->get_bool(name); } else { HXLINE( 41) _hx_tmp = false; } HXDLIN( 41) if (_hx_tmp) { HXLINE( 42) return true; } HXLINE( 44) return false; } STATIC_HX_DEFINE_DYNAMIC_FUNC1(Achievements_obj,isAchievementUnlocked,return ) int Achievements_obj::getAchievementIndex(::String name){ HX_STACKFRAME(&_hx_pos_51d0672471f6b710_47_getAchievementIndex) HXLINE( 48) { HXLINE( 48) int _g = 0; HXDLIN( 48) int _g1 = ::Achievements_obj::achievementsStuff->get_length(); HXDLIN( 48) while((_g < _g1)){ HXLINE( 48) _g = (_g + 1); HXDLIN( 48) int i = (_g - 1); HXLINE( 49) if (::hx::IsEq( ::Achievements_obj::achievementsStuff->__get(i)->__GetItem(2),name )) { HXLINE( 50) return i; } } } HXLINE( 53) return -1; } STATIC_HX_DEFINE_DYNAMIC_FUNC1(Achievements_obj,getAchievementIndex,return ) void Achievements_obj::loadAchievements(){ HX_STACKFRAME(&_hx_pos_51d0672471f6b710_57_loadAchievements) HXDLIN( 57) if (::hx::IsNotNull( ::flixel::FlxG_obj::save->data )) { HXLINE( 58) if (::hx::IsNotNull( ::flixel::FlxG_obj::save->data->__Field(HX_("achievementsMap",d8,6f,d5,91),::hx::paccDynamic) )) { HXLINE( 59) ::Achievements_obj::achievementsMap = ( ( ::haxe::ds::StringMap)(::flixel::FlxG_obj::save->data->__Field(HX_("achievementsMap",d8,6f,d5,91),::hx::paccDynamic)) ); } HXLINE( 61) if (::hx::IsNotNull( ::flixel::FlxG_obj::save->data->__Field(HX_("achievementsUnlocked",67,55,27,1c),::hx::paccDynamic) )) { HXLINE( 63) ::Array< ::String > savedStuff = ( (::Array< ::String >)(::flixel::FlxG_obj::save->data->__Field(HX_("achievementsUnlocked",67,55,27,1c),::hx::paccDynamic)) ); HXLINE( 64) { HXLINE( 64) int _g = 0; HXDLIN( 64) int _g1 = savedStuff->length; HXDLIN( 64) while((_g < _g1)){ HXLINE( 64) _g = (_g + 1); HXDLIN( 64) int i = (_g - 1); HXLINE( 65) ::Achievements_obj::achievementsMap->set(savedStuff->__get(i),true); } } } HXLINE( 68) bool _hx_tmp; HXDLIN( 68) if ((::Achievements_obj::henchmenDeath == 0)) { HXLINE( 68) _hx_tmp = ::hx::IsNotNull( ::flixel::FlxG_obj::save->data->__Field(HX_("henchmenDeath",f4,76,2a,dd),::hx::paccDynamic) ); } else { HXLINE( 68) _hx_tmp = false; } HXDLIN( 68) if (_hx_tmp) { HXLINE( 69) ::Achievements_obj::henchmenDeath = ( (int)(::flixel::FlxG_obj::save->data->__Field(HX_("henchmenDeath",f4,76,2a,dd),::hx::paccDynamic)) ); } } } STATIC_HX_DEFINE_DYNAMIC_FUNC0(Achievements_obj,loadAchievements,(void)) Achievements_obj::Achievements_obj() { } bool Achievements_obj::__GetStatic(const ::String &inName, Dynamic &outValue, ::hx::PropertyAccess inCallProp) { switch(inName.length) { case 13: if (HX_FIELD_EQ(inName,"henchmenDeath") ) { outValue = ( henchmenDeath ); return true; } break; case 15: if (HX_FIELD_EQ(inName,"achievementsMap") ) { outValue = ( achievementsMap ); return true; } break; case 16: if (HX_FIELD_EQ(inName,"loadAchievements") ) { outValue = loadAchievements_dyn(); return true; } break; case 17: if (HX_FIELD_EQ(inName,"achievementsStuff") ) { outValue = ( achievementsStuff ); return true; } if (HX_FIELD_EQ(inName,"unlockAchievement") ) { outValue = unlockAchievement_dyn(); return true; } break; case 19: if (HX_FIELD_EQ(inName,"getAchievementIndex") ) { outValue = getAchievementIndex_dyn(); return true; } break; case 21: if (HX_FIELD_EQ(inName,"isAchievementUnlocked") ) { outValue = isAchievementUnlocked_dyn(); return true; } } return false; } bool Achievements_obj::__SetStatic(const ::String &inName,Dynamic &ioValue,::hx::PropertyAccess inCallProp) { switch(inName.length) { case 13: if (HX_FIELD_EQ(inName,"henchmenDeath") ) { henchmenDeath=ioValue.Cast< int >(); return true; } break; case 15: if (HX_FIELD_EQ(inName,"achievementsMap") ) { achievementsMap=ioValue.Cast< ::haxe::ds::StringMap >(); return true; } break; case 17: if (HX_FIELD_EQ(inName,"achievementsStuff") ) { achievementsStuff=ioValue.Cast< ::cpp::VirtualArray >(); return true; } } return false; } #ifdef HXCPP_SCRIPTABLE static ::hx::StorageInfo *Achievements_obj_sMemberStorageInfo = 0; static ::hx::StaticInfo Achievements_obj_sStaticStorageInfo[] = { {::hx::fsObject /* ::cpp::VirtualArray */ ,(void *) &Achievements_obj::achievementsStuff,HX_("achievementsStuff",30,c3,ed,46)}, {::hx::fsObject /* ::haxe::ds::StringMap */ ,(void *) &Achievements_obj::achievementsMap,HX_("achievementsMap",d8,6f,d5,91)}, {::hx::fsInt,(void *) &Achievements_obj::henchmenDeath,HX_("henchmenDeath",f4,76,2a,dd)}, { ::hx::fsUnknown, 0, null()} }; #endif static void Achievements_obj_sMarkStatics(HX_MARK_PARAMS) { HX_MARK_MEMBER_NAME(Achievements_obj::achievementsStuff,"achievementsStuff"); HX_MARK_MEMBER_NAME(Achievements_obj::achievementsMap,"achievementsMap"); HX_MARK_MEMBER_NAME(Achievements_obj::henchmenDeath,"henchmenDeath"); }; #ifdef HXCPP_VISIT_ALLOCS static void Achievements_obj_sVisitStatics(HX_VISIT_PARAMS) { HX_VISIT_MEMBER_NAME(Achievements_obj::achievementsStuff,"achievementsStuff"); HX_VISIT_MEMBER_NAME(Achievements_obj::achievementsMap,"achievementsMap"); HX_VISIT_MEMBER_NAME(Achievements_obj::henchmenDeath,"henchmenDeath"); }; #endif ::hx::Class Achievements_obj::__mClass; static ::String Achievements_obj_sStaticFields[] = { HX_("achievementsStuff",30,c3,ed,46), HX_("achievementsMap",d8,6f,d5,91), HX_("henchmenDeath",f4,76,2a,dd), HX_("unlockAchievement",0b,e4,d1,6a), HX_("isAchievementUnlocked",e8,ad,c9,f2), HX_("getAchievementIndex",d9,c0,10,aa), HX_("loadAchievements",6a,28,c7,f2), ::String(null()) }; void Achievements_obj::__register() { Achievements_obj _hx_dummy; Achievements_obj::_hx_vtable = *(void **)&_hx_dummy; ::hx::Static(__mClass) = new ::hx::Class_obj(); __mClass->mName = HX_("Achievements",44,ed,7d,4e); __mClass->mSuper = &super::__SGetClass(); __mClass->mConstructEmpty = &__CreateEmpty; __mClass->mConstructArgs = &__Create; __mClass->mGetStaticField = &Achievements_obj::__GetStatic; __mClass->mSetStaticField = &Achievements_obj::__SetStatic; __mClass->mMarkFunc = Achievements_obj_sMarkStatics; __mClass->mStatics = ::hx::Class_obj::dupFunctions(Achievements_obj_sStaticFields); __mClass->mMembers = ::hx::Class_obj::dupFunctions(0 /* sMemberFields */); __mClass->mCanCast = ::hx::TCanCast< Achievements_obj >; #ifdef HXCPP_VISIT_ALLOCS __mClass->mVisitFunc = Achievements_obj_sVisitStatics; #endif #ifdef HXCPP_SCRIPTABLE __mClass->mMemberStorageInfo = Achievements_obj_sMemberStorageInfo; #endif #ifdef HXCPP_SCRIPTABLE __mClass->mStaticStorageInfo = Achievements_obj_sStaticStorageInfo; #endif ::hx::_hx_RegisterClass(__mClass->mName, __mClass); } void Achievements_obj::__boot() { { HX_STACKFRAME(&_hx_pos_51d0672471f6b710_13_boot) HXDLIN( 13) achievementsStuff = ::cpp::VirtualArray_obj::__new(16)->init(0,::cpp::VirtualArray_obj::__new(4)->init(0,HX_("Freaky on a Friday Night",ad,12,d0,d9))->init(1,HX_("Play on a Friday... Night.",1b,3d,4b,6e))->init(2,HX_("friday_night_play",9b,1f,4e,c7))->init(3,true))->init(1,::cpp::VirtualArray_obj::__new(4)->init(0,HX_("She Calls Me Daddy Too",43,38,20,2e))->init(1,HX_("Beat Week 1 on Hard with no Misses.",3a,80,c0,14))->init(2,HX_("week1_nomiss",3f,c5,3b,fe))->init(3,false))->init(2,::cpp::VirtualArray_obj::__new(4)->init(0,HX_("No More Tricks",6c,b7,d5,1c))->init(1,HX_("Beat Week 2 on Hard with no Misses.",3b,bb,c7,1d))->init(2,HX_("week2_nomiss",5e,37,6e,37))->init(3,false))->init(3,::cpp::VirtualArray_obj::__new(4)->init(0,HX_("Call Me The Hitman",fc,32,c3,c7))->init(1,HX_("Beat Week 3 on Hard with no Misses.",3c,f6,ce,26))->init(2,HX_("week3_nomiss",7d,a9,a0,70))->init(3,false))->init(4,::cpp::VirtualArray_obj::__new(4)->init(0,HX_("Lady Killer",a1,5f,9f,79))->init(1,HX_("Beat Week 4 on Hard with no Misses.",3d,31,d6,2f))->init(2,HX_("week4_nomiss",9c,1b,d3,a9))->init(3,false))->init(5,::cpp::VirtualArray_obj::__new(4)->init(0,HX_("Missless Christmas",f7,6d,cc,37))->init(1,HX_("Beat Week 5 on Hard with no Misses.",3e,6c,dd,38))->init(2,HX_("week5_nomiss",bb,8d,05,e3))->init(3,false))->init(6,::cpp::VirtualArray_obj::__new(4)->init(0,HX_("Highscore!!",70,79,53,b1))->init(1,HX_("Beat Week 6 on Hard with no Misses.",3f,a7,e4,41))->init(2,HX_("week6_nomiss",da,ff,37,1c))->init(3,false))->init(7,::cpp::VirtualArray_obj::__new(4)->init(0,HX_("You'll Pay For That...",a0,91,89,56))->init(1,HX_("Beat Week 7 on Hard with no Misses.",40,e2,eb,4a))->init(2,HX_("week7_nomiss",f9,71,6a,55))->init(3,true))->init(8,::cpp::VirtualArray_obj::__new(4)->init(0,HX_("What a Funkin' Disaster!",9b,9a,f3,3d))->init(1,HX_("Complete a Song with a rating lower than 20%.",b8,88,a7,a1))->init(2,HX_("ur_bad",a3,4f,85,aa))->init(3,false))->init(9,::cpp::VirtualArray_obj::__new(4)->init(0,HX_("Perfectionist",2f,2d,d8,1a))->init(1,HX_("Complete a Song with a rating of 100%.",60,20,3e,99))->init(2,HX_("ur_good",9f,19,79,8d))->init(3,false))->init(10,::cpp::VirtualArray_obj::__new(4)->init(0,HX_("Roadkill Enthusiast",16,f9,a7,f4))->init(1,HX_("Watch the Henchmen die over 100 times.",23,f4,28,c4))->init(2,HX_("roadkill_enthusiast",15,e2,55,56))->init(3,false))->init(11,::cpp::VirtualArray_obj::__new(4)->init(0,HX_("Oversinging Much...?",7f,24,1b,aa))->init(1,HX_("Hold down a note for 10 seconds.",47,92,e2,c6))->init(2,HX_("oversinging",1f,13,8f,78))->init(3,false))->init(12,::cpp::VirtualArray_obj::__new(4)->init(0,HX_("Hyperactive",12,ed,1a,97))->init(1,HX_("Finish a Song without going Idle.",3d,4e,8d,8b))->init(2,HX_("hype",46,63,1a,45))->init(3,false))->init(13,::cpp::VirtualArray_obj::__new(4)->init(0,HX_("Just the Two of Us",f0,46,92,7c))->init(1,HX_("Finish a Song pressing only two keys.",34,0f,a6,8a))->init(2,HX_("two_keys",c7,f4,0a,9b))->init(3,false))->init(14,::cpp::VirtualArray_obj::__new(4)->init(0,HX_("Toaster Gamer",b4,2b,0d,33))->init(1,HX_("Have you tried to run the game on a toaster?",97,b9,bf,ff))->init(2,HX_("toastie",43,0c,91,5f))->init(3,false))->init(15,::cpp::VirtualArray_obj::__new(4)->init(0,HX_("Debugger",41,e0,9c,6a))->init(1,HX_("Beat the \"Test\" Stage from the Chart Editor.",15,c5,9f,4a))->init(2,HX_("debugger",21,24,eb,90))->init(3,true)); } { HX_GC_STACKFRAME(&_hx_pos_51d0672471f6b710_31_boot) HXDLIN( 31) achievementsMap = ::haxe::ds::StringMap_obj::__alloc( HX_CTX ); } { HX_STACKFRAME(&_hx_pos_51d0672471f6b710_33_boot) HXDLIN( 33) henchmenDeath = 0; } }
51.665455
3,413
0.716005
TheSlithyGamer4evr
b7283a34460df9d442864fe0cb0786fac046508f
884
cpp
C++
project2D/KeyboardForce.cpp
Krian0/ArtificialI
215aa409441af15dfaf1783dcb44392dc2178887
[ "MIT" ]
null
null
null
project2D/KeyboardForce.cpp
Krian0/ArtificialI
215aa409441af15dfaf1783dcb44392dc2178887
[ "MIT" ]
null
null
null
project2D/KeyboardForce.cpp
Krian0/ArtificialI
215aa409441af15dfaf1783dcb44392dc2178887
[ "MIT" ]
null
null
null
#include "KeyboardForce.h" #include "input.h" KeyboardForce::KeyboardForce() { m_weight = 1.00; } KeyboardForce::~KeyboardForce() { } Vector2 KeyboardForce::GetForce(Agent* An_Agent) { aie::Input* input = aie::Input::getInstance(); bool up = false, down = false, left = false, right = false; //Detect pressed direction keys if (input->isKeyDown(aie::INPUT_KEY_UP)) up = true; if (input->isKeyDown(aie::INPUT_KEY_DOWN)) down = true; if (input->isKeyDown(aie::INPUT_KEY_LEFT)) left = true; if (input->isKeyDown(aie::INPUT_KEY_RIGHT)) right = true; //Add corresponding direction value to movement vector Vector2 Force(0, 0); if (up == true && down == false) Force.y = 100; if (down == true && up == false) Force.y = -100; if (left == true && right == false) Force.x = -100; if (right == true && left == false) Force.x = 100; return Force; }
17.68
60
0.653846
Krian0
b72b21834a8858514383464e3055dce1e45e23f9
6,970
cpp
C++
designer/lib/shared/csshighlighter.cpp
liyuzhao/QWidgetDemo
a056894da7b7385e37a523ea4825cea48c82d297
[ "MulanPSL-1.0" ]
3,095
2019-10-11T03:00:33.000Z
2022-03-31T08:15:13.000Z
designer/lib/shared/csshighlighter.cpp
liyuzhao/QWidgetDemo
a056894da7b7385e37a523ea4825cea48c82d297
[ "MulanPSL-1.0" ]
28
2019-11-12T07:24:06.000Z
2022-02-28T02:04:48.000Z
designer/lib/shared/csshighlighter.cpp
liyuzhao/QWidgetDemo
a056894da7b7385e37a523ea4825cea48c82d297
[ "MulanPSL-1.0" ]
1,023
2019-10-09T12:54:07.000Z
2022-03-30T04:02:07.000Z
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #include "csshighlighter_p.h" QT_BEGIN_NAMESPACE namespace qdesigner_internal { CssHighlighter::CssHighlighter(QTextDocument *document) : QSyntaxHighlighter(document) { } void CssHighlighter::highlightBlock(const QString& text) { enum Token { ALNUM, LBRACE, RBRACE, COLON, SEMICOLON, COMMA, QUOTE, SLASH, STAR }; static const int transitions[10][9] = { { Selector, Property, Selector, Pseudo, Property, Selector, Quote, MaybeComment, Selector }, // Selector { Property, Property, Selector, Value, Property, Property, Quote, MaybeComment, Property }, // Property { Value, Property, Selector, Value, Property, Value, Quote, MaybeComment, Value }, // Value { Pseudo1, Property, Selector, Pseudo2, Selector, Selector, Quote, MaybeComment, Pseudo }, // Pseudo { Pseudo1, Property, Selector, Pseudo, Selector, Selector, Quote, MaybeComment, Pseudo1 }, // Pseudo1 { Pseudo2, Property, Selector, Pseudo, Selector, Selector, Quote, MaybeComment, Pseudo2 }, // Pseudo2 { Quote, Quote, Quote, Quote, Quote, Quote, -1, Quote, Quote }, // Quote { -1, -1, -1, -1, -1, -1, -1, -1, Comment }, // MaybeComment { Comment, Comment, Comment, Comment, Comment, Comment, Comment, Comment, MaybeCommentEnd }, // Comment { Comment, Comment, Comment, Comment, Comment, Comment, Comment, -1, MaybeCommentEnd } // MaybeCommentEnd }; int lastIndex = 0; bool lastWasSlash = false; int state = previousBlockState(), save_state; if (state == -1) { // As long as the text is empty, leave the state undetermined if (text.isEmpty()) { setCurrentBlockState(-1); return; } // The initial state is based on the precense of a : and the absense of a {. // This is because Qt style sheets support both a full stylesheet as well as // an inline form with just properties. state = save_state = (text.indexOf(QLatin1Char(':')) > -1 && text.indexOf(QLatin1Char('{')) == -1) ? Property : Selector; } else { save_state = state>>16; state &= 0x00ff; } if (state == MaybeCommentEnd) { state = Comment; } else if (state == MaybeComment) { state = save_state; } for (int i = 0; i < text.length(); i++) { int token = ALNUM; const QChar c = text.at(i); const char a = c.toAscii(); if (state == Quote) { if (a == '\\') { lastWasSlash = true; } else { if (a == '\"' && !lastWasSlash) { token = QUOTE; } lastWasSlash = false; } } else { switch (a) { case '{': token = LBRACE; break; case '}': token = RBRACE; break; case ':': token = COLON; break; case ';': token = SEMICOLON; break; case ',': token = COMMA; break; case '\"': token = QUOTE; break; case '/': token = SLASH; break; case '*': token = STAR; break; default: break; } } int new_state = transitions[state][token]; if (new_state != state) { bool include_token = new_state == MaybeCommentEnd || (state == MaybeCommentEnd && new_state!= Comment) || state == Quote; highlight(text, lastIndex, i-lastIndex+include_token, state); if (new_state == Comment) { lastIndex = i-1; // include the slash and star } else { lastIndex = i + ((token == ALNUM || new_state == Quote) ? 0 : 1); } } if (new_state == -1) { state = save_state; } else if (state <= Pseudo2) { save_state = state; state = new_state; } else { state = new_state; } } highlight(text, lastIndex, text.length() - lastIndex, state); setCurrentBlockState(state + (save_state<<16)); } void CssHighlighter::highlight(const QString &text, int start, int length, int state) { if (start >= text.length() || length <= 0) return; QTextCharFormat format; switch (state) { case Selector: setFormat(start, length, Qt::darkRed); break; case Property: setFormat(start, length, Qt::blue); break; case Value: setFormat(start, length, Qt::black); break; case Pseudo1: setFormat(start, length, Qt::darkRed); break; case Pseudo2: setFormat(start, length, Qt::darkRed); break; case Quote: setFormat(start, length, Qt::darkMagenta); break; case Comment: case MaybeCommentEnd: format.setForeground(Qt::darkGreen); setFormat(start, length, format); break; default: break; } } } // namespace qdesigner_internal QT_END_NAMESPACE
36.878307
115
0.592396
liyuzhao
b72dd8f80bde2090209a50df6a9d09f540dc4ffd
271
cpp
C++
oadr/oadr/manager/transport/ITransport.cpp
beroset/OpenADR-VEN-Library
16546464fe1dc714a126474aaadf75483ec9cbc6
[ "Apache-2.0" ]
12
2016-09-21T19:07:13.000Z
2021-12-13T06:17:36.000Z
oadr/oadr/manager/transport/ITransport.cpp
beroset/OpenADR-VEN-Library
16546464fe1dc714a126474aaadf75483ec9cbc6
[ "Apache-2.0" ]
3
2020-11-09T08:25:40.000Z
2021-04-12T10:49:39.000Z
oadr/oadr/manager/transport/ITransport.cpp
beroset/OpenADR-VEN-Library
16546464fe1dc714a126474aaadf75483ec9cbc6
[ "Apache-2.0" ]
12
2018-06-10T10:52:56.000Z
2020-12-08T15:47:13.000Z
/* * ITransport.cpp * * Created on: Jul 8, 2015 * Author: dupes */ #include "../../manager/transport/ITransport.h" ITransport::ITransport() { // TODO Auto-generated constructor stub } ITransport::~ITransport() { // TODO Auto-generated destructor stub }
12.904762
47
0.656827
beroset
b72e852d27c7190b28b880eb50239372264817c4
6,866
cpp
C++
src/roi_api.cpp
rockchip-linux/ipcweb-backend
1885a61babe060c16a84c172712146d4206361df
[ "BSD-3-Clause" ]
1
2021-09-16T02:56:35.000Z
2021-09-16T02:56:35.000Z
src/roi_api.cpp
rockchip-linux/ipcweb-backend
1885a61babe060c16a84c172712146d4206361df
[ "BSD-3-Clause" ]
1
2021-07-08T03:34:02.000Z
2021-07-08T03:34:02.000Z
src/roi_api.cpp
rockchip-linux/ipcweb-backend
1885a61babe060c16a84c172712146d4206361df
[ "BSD-3-Clause" ]
2
2021-08-24T05:38:18.000Z
2021-09-16T02:56:39.000Z
// Copyright 2019 Fuzhou Rockchip Electronics Co., Ltd. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "roi_api.h" #include <dbserver.h> #include <mediaserver.h> namespace rockchip { namespace cgi { nlohmann::json roi_all_info_get(void) { nlohmann::json roi_all_info; char *str = dbserver_media_get((char *)TABLE_NORMALIZED_SCREEN_SIZE); nlohmann::json normalized_screen_size = nlohmann::json::parse(str).at("jData").at(0); normalized_screen_size.erase("id"); str = dbserver_media_get((char *)TABLE_ROI); nlohmann::json roi_list = nlohmann::json::parse(str).at("jData"); for (auto &x : nlohmann::json::iterator_wrapper(roi_list)) { x.value().erase("id"); } roi_all_info.emplace("normalizedScreenSize", normalized_screen_size); roi_all_info.emplace("ROIRegionList", roi_list); return roi_all_info; } nlohmann::json roi_channel_get(std::string stream_type) { char *str; std::string stream_type_db; nlohmann::json roi_channel; nlohmann::json roi_list; str = dbserver_media_get((char *)TABLE_ROI); roi_list = nlohmann::json::parse(str).at("jData"); if (!stream_type.compare("main-stream")) stream_type_db = "mainStream"; else if (!stream_type.compare("sub-stream")) stream_type_db = "subStream"; else if (!stream_type.compare("third-stream")) stream_type_db = "thirdStream"; for (auto &x : nlohmann::json::iterator_wrapper(roi_list)) { std::string actual_type = x.value().at("sStreamType"); if (!actual_type.compare(stream_type_db)) roi_channel.push_back(x.value()); } return roi_channel; } nlohmann::json roi_specific_get(std::string stream_type, int roi_id) { nlohmann::json roi_channel; nlohmann::json roi_specific; nlohmann::json stream_enable_config; int roi_enable_num = 0; int stream_enable_num; roi_channel = roi_channel_get(stream_type); for (auto &x : nlohmann::json::iterator_wrapper(roi_channel)) { int actual_id = x.value().at("iROIId"); if (actual_id == roi_id) roi_specific = x.value(); } // Check the stream enable state char *config = new char[255]; for (auto &x : nlohmann::json::iterator_wrapper(roi_channel)) { int roi_enbale = x.value().at("iROIEnabled"); roi_enable_num += roi_enbale; } if (roi_enable_num == 0) { // if this channel all roi enable is 0, that all stream enable should 0 stream_enable_num = 0; } else { // if this channel have one roi enable is 1, that all stream enable should 1 stream_enable_num = 1; } stream_enable_config.emplace("iStreamEnabled", stream_enable_num); strcpy(config, stream_enable_config.dump().c_str()); for (auto &x : nlohmann::json::iterator_wrapper(roi_channel)) { int table_id = x.value().at("id"); dbserver_media_set((char *)TABLE_ROI, config, table_id); } delete[] config; return roi_specific; } void roi_specific_set(nlohmann::json roi_config, std::string stream_type, int roi_id) { int table_id; int stream_id; char *config = new char[255]; std::string stream_type_db; nlohmann::json old_roi_specific; nlohmann::json roi_channel = roi_channel_get(stream_type); // Prohibit modification roi_config.erase("sStreamType"); roi_config.erase("iStreamEnabled"); if (!stream_type.compare("main-stream")) { stream_type_db = "mainStream"; stream_id = 0; } else if (!stream_type.compare("sub-stream")) { stream_type_db = "subStream"; stream_id = 1; } else if (!stream_type.compare("third-stream")) { stream_type_db = "thirdStream"; stream_id = 2; } roi_config.emplace("sStreamType", stream_type_db); old_roi_specific = roi_specific_get(stream_type, roi_id); table_id = old_roi_specific.at("id"); strcpy(config, roi_config.dump().c_str()); dbserver_media_set((char *)TABLE_ROI, config, table_id); mediaserver_set((char *)TABLE_ROI, stream_id, config); delete[] config; } void ROIApiHandler::handler(const HttpRequest &Req, HttpResponse &Resp) { std::string path_api_resource; std::string path_channel_resource; std::string path_specific_resource; char *str; nlohmann::json content; #ifdef ENABLE_JWT int user_level = Req.UserLevel; #endif /* Get Path Information */ int pos_first = Req.PathInfo.find_first_of("/"); path_api_resource = Req.PathInfo.substr(pos_first + 1, Req.PathInfo.size()); pos_first = path_api_resource.find_first_of("/"); if (pos_first != -1) { path_channel_resource = path_api_resource.substr(pos_first + 1, path_api_resource.size()); pos_first = path_channel_resource.find_first_of("/"); if (pos_first != -1) { path_specific_resource = path_channel_resource.substr( pos_first + 1, path_channel_resource.size()); } } if (Req.Method == "GET") { if (path_channel_resource.empty()) { // path is roi content = roi_all_info_get(); } else { if (path_specific_resource.empty()) { // path example is roi/main-stream content = roi_channel_get(path_channel_resource); for (auto &x : nlohmann::json::iterator_wrapper(content)) { x.value().erase("id"); } } else { // path example is roi/main-stream/1 int roi_id = stoi(path_specific_resource); int pos = path_channel_resource.find_first_of("/"); std::string stream_type = path_channel_resource.substr(0, pos); content = roi_specific_get(stream_type, roi_id); content.erase("id"); } } Resp.setHeader(HttpStatus::kOk, "OK"); Resp.setApiData(content); } else if ((Req.Method == "POST") || (Req.Method == "PUT")) { if (path_channel_resource.empty()) { // path is roi Resp.setErrorResponse(HttpStatus::kNotImplemented, "Not Implemented"); } else { #ifdef ENABLE_JWT if (user_level > 1) { Resp.setErrorResponse(HttpStatus::kUnauthorized, "Unauthorized"); return; } #endif if (path_specific_resource.empty()) { // path example is roi/main-stream Resp.setErrorResponse(HttpStatus::kNotImplemented, "Not Implemented"); } else { // path example is roi/main-stream/1 nlohmann::json roi_config = Req.PostObject; /* must be json::object */ int roi_id = stoi(path_specific_resource); int pos = path_channel_resource.find_first_of("/"); std::string stream_type = path_channel_resource.substr(0, pos); /* Set */ if (!roi_config.empty()) roi_specific_set(roi_config, stream_type, roi_id); /* Get new info */ content = roi_specific_get(stream_type, roi_id); Resp.setHeader(HttpStatus::kOk, "OK"); Resp.setApiData(content); } } } else { Resp.setErrorResponse(HttpStatus::kNotImplemented, "Not Implemented"); } } } // namespace cgi } // namespace rockchip
33.990099
80
0.684969
rockchip-linux
b72f4b5a974a2bc1c9028d76dc9b8fe838f7af96
407
hpp
C++
torricelly-lang/include/gasp/torricelly/torricelly.hpp
sanelli/gasp
108700e8739534e9c152d7c8e2f1308917cf8611
[ "MIT" ]
null
null
null
torricelly-lang/include/gasp/torricelly/torricelly.hpp
sanelli/gasp
108700e8739534e9c152d7c8e2f1308917cf8611
[ "MIT" ]
null
null
null
torricelly-lang/include/gasp/torricelly/torricelly.hpp
sanelli/gasp
108700e8739534e9c152d7c8e2f1308917cf8611
[ "MIT" ]
null
null
null
#pragma once #include <gasp/torricelly/impl/torricelly_module.hpp> #include <gasp/torricelly/impl/torricelly_type.hpp> #include <gasp/torricelly/impl/torricelly_subroutine.hpp> #include <gasp/torricelly/impl/torricelly_instruction_code.hpp> #include <gasp/torricelly/impl/torricelly_instruction.hpp> #include <gasp/torricelly/impl/torricelly_value.hpp> #include <gasp/torricelly/impl/torricelly_error.hpp>
40.7
63
0.835381
sanelli
b7336641b782a356e4bce5268a7f5e0e31999d29
5,870
cc
C++
examples/reversi/player.cc
kongaraju/antkorp
3453d543d659e3420d5bc4b536016bb1d097d7ec
[ "CC-BY-3.0", "Apache-2.0" ]
1
2016-01-02T14:39:07.000Z
2016-01-02T14:39:07.000Z
examples/reversi/player.cc
kongaraju/antkorp
3453d543d659e3420d5bc4b536016bb1d097d7ec
[ "CC-BY-3.0", "Apache-2.0" ]
4
2019-12-20T06:13:24.000Z
2021-07-03T16:28:18.000Z
examples/reversi/player.cc
kongaraju/antkorp
3453d543d659e3420d5bc4b536016bb1d097d7ec
[ "CC-BY-3.0", "Apache-2.0" ]
2
2015-09-17T16:40:10.000Z
2016-11-17T15:56:42.000Z
#include "common.hh" #include "board.hh" #include "player.hh" #include "svclib.hh" extern mongo::DBClientConnection conn; typedef boost::intrusive::set<Player, compare<std::greater<Player>>> playerListT; playerListT playerList; extern service *svc; Player::Player(int id, int clnt, std::string loginid, std::string name) : _id(0), _conn(clnt), _loginid(loginid), gatePass(false), _canMove(false), _name(name), _homeCount(0), _gamesPlayed(0), _gamesWon(0), _score(0) { playerList.push_back(*this); mongo::BSONObj _o = conn.findOne("reversi.players", QUERY("loginid"<< loginid)); if (!_o.isEmpty()) _load(_o); else{ std::cerr<<"\nPlayer info missing in database, New player i guess."; _save(); } return; } Player::~Player() { playerList.erase(playerListT::s_iterator_to(*this)); return; } int Player::getId() { return _id; } std::string Player::getLoginId() { return _loginid; } //get the filexfer object from the filedescriptor Player* getPlayer(int id) { playerListT::iterator itr; for(itr = playerList.begin(); itr != playerList.end(); itr++) if(itr->getId() == id) return &(*itr); return NULL; } Player* getPlayer(std::string login) { playerListT::iterator itr; for(itr = playerList.begin(); itr != playerList.end(); itr++) if(itr->getLoginId() == login) return &(*itr); return NULL; } int Player::getConn() { return _conn; } void Player::setBoardId(int boardid) { _boardId = boardid; return; } int Player::getBoardId() { return _boardId; } std::string Player::getName() { return _name; } void Player::setName(std::string name) { _name.assign(name); return; } void Player::_load(mongo::BSONObj &dbObj) { _gamesPlayed = dbObj["played"].number(); _gamesWon = dbObj["won"].number(); _score = dbObj["score"].number(); return; } void Player::_save() { mongo::BSONObjBuilder obld; obld.append("loginid", _loginid); obld.append("played", _gamesPlayed); obld.append("won", _gamesWon); obld.append("score", _score); conn.update("reversi.players", QUERY("loginid"<<_loginid), obld.obj(), true); std::string error = conn.getLastError(); if (error.size()) std::cerr<<"\nError doing update : "<<error; return; } void sendNewBoardEvent(Board *b) { playerListT::iterator itr; for(itr = playerList.begin(); itr != playerList.end(); itr++){ int clnt = (*itr).getConn(); std::string event("event"), eventtype("new_board"); tupl tv[] = { {"mesgtype", event}, {"eventtype", eventtype}, {"boardid", b->getId()}, {"boardname", b->getName()}, {"player1", b->getPlayer1LoginId()}, {"player2", b->getPlayer2LoginId()}, }; JSONNode eventNode(JSON_NODE); putJsonVal(tv, sizeof(tv)/sizeof(tupl), eventNode); string rollStart = eventNode.write_formatted(); string newBoardEvent = eventNode.write_formatted(); svc->sendToClient(clnt, -1, nonconst(newBoardEvent.c_str()), newBoardEvent.length()); } } void universalBroadcast(const char *buf, size_t bufSize) { playerListT::iterator itr; for(itr = playerList.begin(); itr != playerList.end(); itr++){ int clnt = (*itr).getConn(); if (clnt) svc->sendToClient(clnt, -1, nonconst(buf), bufSize); } return; } void broadcastBoardDeleteEvent(int boardid) { std::string event("event"), eventtype("board_deleted"); tupl tv[] = { {"mesgtype", event}, {"eventtype", eventtype}, {"boardid", boardid}, }; JSONNode eventNode(JSON_NODE); putJsonVal(tv, sizeof(tv)/sizeof(tupl), eventNode); string boardDeleteEvent = eventNode.write_formatted(); universalBroadcast(boardDeleteEvent.c_str(), boardDeleteEvent.length()); return; } //hunt the player with the given client connection and delete him. //the client has closed the connection or he is not reachable. //send all the remaining players a player logged out event. extern int boardCount; void kickPlayerOut(int client) { playerListT::iterator itr; Player *p = NULL; for(itr = playerList.begin(); itr != playerList.end(); itr++){ if(client == (*itr).getConn()){ Board *b = getBoard((*itr).getBoardId()); if(b){ b->playerLeave(*itr); p = &(*itr); //delete the board if he is the last player. if(b->getCurrentPlayerCount() == 0){ broadcastBoardDeleteEvent(b->getId()); boardCount--; delete b; } p->setBoardId(0); }else{ p = &(*itr); if(p){ std::string event("event"), eventtype("player_logout"); tupl tv[] = { {"mesgtype", event}, {"eventtype", eventtype}, {"loginid", p->getLoginId()} }; JSONNode eventNode(JSON_NODE); putJsonVal(tv, sizeof(tv)/sizeof(tupl), eventNode); string playerLogoutEvent = eventNode.write_formatted(); universalBroadcast(nonconst(playerLogoutEvent.c_str()), playerLogoutEvent.length()); } break; } } } if(p) delete p; return; } //send a sequence of player login events. void sendPlayerList(int client) { playerListT::iterator itr; uint32_t count = 200; for(itr = playerList.begin(); (itr != playerList.end()) && count && ((*itr).getConn() != client); itr++, count--){ std::string event("event"), eventtype("player_login"); tupl tv[] = { {"mesgtype", event}, {"eventtype", eventtype}, {"loginid", (*itr).getLoginId()}, }; JSONNode eventNode(JSON_NODE); putJsonVal(tv, sizeof(tv)/sizeof(tupl), eventNode); string playerLoginEvent = eventNode.write_formatted(); svc->sendToClient(client, -1, nonconst(playerLoginEvent.c_str()), playerLoginEvent.length()); } return; }
23.574297
118
0.62402
kongaraju
b73575cd83567036a9827a1ca85cd7b49a58a8bf
6,035
cpp
C++
src/datamodel_file.cpp
jfouche/bbm
6713e1003fe2c7c5ffaa6536457d71314c0382fe
[ "MIT" ]
null
null
null
src/datamodel_file.cpp
jfouche/bbm
6713e1003fe2c7c5ffaa6536457d71314c0382fe
[ "MIT" ]
null
null
null
src/datamodel_file.cpp
jfouche/bbm
6713e1003fe2c7c5ffaa6536457d71314c0382fe
[ "MIT" ]
null
null
null
#include "datamodel_file.h" #include "json_utils.hpp" #include <map> static const char* KEY_PROJECT_ARRAY = "projects"; static const char* KEY_PROJECT_NAME = "name"; static const char* KEY_PROJECT_LIST_BB = "building_blocks"; static const char* KEY_BB_ARRAY = "building_blocks"; static const char* KEY_BB_NAME = "name"; static const char* KEY_BB_REF = "ref"; static const char* KEY_BB_ID = "id"; static const char* KEY_BB_MATURITY = "maturity"; static const char* KEY_BB_INFO = "info"; static const char* KEY_BB_CHILDREN = "children"; struct projectIndexValue : public json::key_value { projectIndexValue(const QJsonValue& value) : json::key_value("project index", value) {} }; struct bbIndexValue : public json::key_value { bbIndexValue(const QJsonValue& value) : json::key_value("bb index", value) {} }; QString MaturityToString(BuildingBlock::Maturity m) { switch (m) { case BuildingBlock::Maturity::A : return "A"; case BuildingBlock::Maturity::B : return "B"; case BuildingBlock::Maturity::C : return "C"; case BuildingBlock::Maturity::D : return "D"; case BuildingBlock::Maturity::E : return "E"; case BuildingBlock::Maturity::F : return "F"; } throw std::invalid_argument("Bad maturity"); } namespace json { template<> BuildingBlock::Maturity as(const key_value& pair) { QString s=as<QString>(pair); if (s == "A") return BuildingBlock::Maturity::A; if (s == "B") return BuildingBlock::Maturity::B; if (s == "C") return BuildingBlock::Maturity::C; if (s == "D") return BuildingBlock::Maturity::D; if (s == "E") return BuildingBlock::Maturity::E; if (s == "F") return BuildingBlock::Maturity::F; throw invalid_type_exception(KEY_BB_MATURITY); } } class JsonWriter { public: JsonWriter(const DataModel& model); void write(QJsonObject& jsonObj) const; private: void write(const Project* project, QJsonObject& jsonObj) const; void write(const BuildingBlock* project, QJsonObject& jsonObj) const; private: const DataModel& m_model; std::map<const BuildingBlock*, int> m_bbMap; }; class JsonReader { public: JsonReader(DataModel& model); void read(const QJsonObject& jsonObj); private: void read(Project* project, const QJsonObject& jsonObj); void read(BuildingBlock* project, const QJsonObject& jsonObj); private: DataModel& m_model; std::map<int, BuildingBlock*> m_bbHash; std::map<BuildingBlock*, std::vector<int>> m_bbChildren; }; JsonReader::JsonReader(DataModel& model) : m_model(model) { } void JsonReader::read(Project* project, const QJsonObject& jsonObj) { project->setName(json::as<QString>(jsonObj, KEY_PROJECT_NAME)); for (auto value : json::as<QJsonArray>(jsonObj, KEY_PROJECT_LIST_BB)) { int id = json::as<int>(value); project->add(m_bbHash[id]); } } void JsonReader::read(BuildingBlock* bb, const QJsonObject& jsonObj) { bb->setName(json::as<QString>(jsonObj, KEY_BB_NAME)); bb->setRef(json::as<QString>(jsonObj, KEY_BB_REF)); bb->setMaturity(json::as<BuildingBlock::Maturity>(jsonObj, KEY_BB_MATURITY)); bb->setInfo(json::as<QString>(jsonObj, KEY_BB_INFO)); int id = json::as<int>(jsonObj, KEY_BB_ID); m_bbHash[id] = bb; for (auto value : json::as<QJsonArray>(jsonObj, KEY_BB_CHILDREN)) { m_bbChildren[bb].push_back(json::as<int>(value)); } } void JsonReader::read(const QJsonObject& jsonObj) { // read BB first, because project needs BB id to be retrieved for (auto value : json::as<QJsonArray>(jsonObj, KEY_BB_ARRAY)) { QJsonObject bbObj = json::as<QJsonObject>(bbIndexValue(value)); auto bb = m_model.addBuildingBlock(); read(bb, bbObj); } // link BB children to BB for (const auto& kv: m_bbChildren) { BuildingBlock* bb = kv.first; for (int id : kv.second) { auto it = m_bbHash.find(id); if (it->first) { bb->add(it->second); } } } // Read projects for (auto value : json::as<QJsonArray>(jsonObj, KEY_PROJECT_ARRAY)) { QJsonObject projObj = json::as<QJsonObject>(projectIndexValue(value)); auto project = m_model.addProject(); read(project, projObj); } } JsonWriter::JsonWriter(const DataModel& model) : m_model(model) { int id = 1; for (const BuildingBlock* bb : m_model.buildingBlocks()) { m_bbMap[bb] = id++; } } void JsonWriter::write(const Project* project, QJsonObject& obj) const { obj[KEY_PROJECT_NAME] = project->name(); QJsonArray listBb; for (const BuildingBlock* bb : project->buildingBlocks()) { listBb.append( QJsonValue(m_bbMap.at(bb))); } obj[KEY_PROJECT_LIST_BB] = listBb; } void JsonWriter::write(const BuildingBlock* bb, QJsonObject& obj) const { obj[KEY_BB_NAME] = bb->name(); obj[KEY_BB_REF] = bb->ref(); obj[KEY_BB_ID] = m_bbMap.at(bb); obj[KEY_BB_MATURITY] = MaturityToString(bb->maturity()); obj[KEY_BB_INFO] = bb->info(); QJsonArray children; for (const BuildingBlock* childBb : bb->children()) { children.append( QJsonValue(m_bbMap.at(childBb))); } obj[KEY_BB_CHILDREN] = children; } void JsonWriter::write(QJsonObject& jsonObj) const { // Write projects QJsonArray projects; for (const Project* project : m_model.projects()) { QJsonObject projectObj; write(project, projectObj); projects.append(projectObj); } jsonObj[KEY_PROJECT_ARRAY] = projects; // Write BB QJsonArray buildingblocks; for (const BuildingBlock* bb : m_model.buildingBlocks()) { QJsonObject bbObj; write(bb, bbObj); buildingblocks.append(bbObj); } jsonObj[KEY_BB_ARRAY] = buildingblocks; } void read(DataModel& data, const QJsonObject& jsonObj) { JsonReader reader(data); reader.read(jsonObj); } void write(const DataModel& model, QJsonObject& obj) { JsonWriter jsonWriter(model); jsonWriter.write(obj); }
28.200935
81
0.668268
jfouche
b7360e43997491005f53357c7822e0a9527551c9
1,197
hh
C++
multicast/pimcontrol.hh
kohler/click-packages
cec70da7cf460548ef08f1ddad6924db29d5c0c5
[ "MIT" ]
13
2015-02-26T23:12:09.000Z
2021-04-18T04:37:12.000Z
multicast/pimcontrol.hh
kohoumas/click-packages
6bb5c4ba286e5dbc74efd1708921d530425691f6
[ "MIT" ]
null
null
null
multicast/pimcontrol.hh
kohoumas/click-packages
6bb5c4ba286e5dbc74efd1708921d530425691f6
[ "MIT" ]
7
2015-08-25T09:29:41.000Z
2021-04-18T04:37:13.000Z
#ifndef PIM_CONTROL_HH #define PIM_CONTROL_HH #include "pimforwardingtable.hh" #include "protocoldefinitions.hh" #include <click/timer.hh> #include <click/element.hh> /* =c PIMControl(PIMForwardingTable) =s IPv4 Multicast =d Handles the PIM protocol, i.e. generation of Hello-messages and detection of connected PIM routers. This management information is needed for PIMForwardingTable. =e PIMControl("pimft") -> rt; =a IPMulticastTable, PIM, IGMP, PIMForwardingTable, IPMulticastEtherEncap, FixPIMSource */ class PIMControl : public Element { public: PIMControl(); ~PIMControl(); bool source_connected; PIMForwardingTable *PIMTable; const char *class_name() const { return "PIMControl"; } const char *port_count() const { return "0/2"; } const char *processing() const { return "h/hh"; } int configure(Vector<String> &, ErrorHandler *); int initialize(ErrorHandler *); void join(IPAddress, IPAddress); void prune(IPAddress, IPAddress); void generatejoin(IPAddress, IPAddress, bool); void run_timer(Timer *); void generate_hello(); bool noPIMreceivers(IPAddress, IPAddress); bool noIGMPreceivers(IPAddress, IPAddress); Timer _timer; }; #endif
22.584906
99
0.74269
kohler
b73bbaf81a8547dcbdf6a1a4c70530405d67b61f
6,475
cpp
C++
Activities/Menu.cpp
Derjik/Outpost
93a419df75c1a17c1ffa30b0b9061bb3dfd7ce57
[ "0BSD" ]
1
2018-10-26T08:48:07.000Z
2018-10-26T08:48:07.000Z
Activities/Menu.cpp
Derjik/Outpost
93a419df75c1a17c1ffa30b0b9061bb3dfd7ce57
[ "0BSD" ]
null
null
null
Activities/Menu.cpp
Derjik/Outpost
93a419df75c1a17c1ffa30b0b9061bb3dfd7ce57
[ "0BSD" ]
null
null
null
#include "Menu.hpp" #include "Global.hpp" #include "TextDebug.hpp" #include "GameControllerDebug.hpp" #include "Tank.hpp" #include <VBN/WindowManager.hpp> #include <VBN/EngineUpdate.hpp> #include <VBN/Platform.hpp> #include <VBN/Mixer.hpp> /* ----------------- FACTORY ----------------- */ std::shared_ptr<GameContext> Menu::Factory::createMenu( std::shared_ptr<Platform> platform) { std::shared_ptr<Menu::Model> model( new Menu::Model); std::shared_ptr<Menu::Controller> menuController( new Menu::Controller(platform, model)); return Global::Factory::createGlobal( platform, model, std::make_shared<Menu::View>(platform, model), nullptr, menuController, menuController, nullptr, nullptr); } /* ------------------ MODEL ------------------ */ Menu::Model::Model(void) : _menuEntries{ Menu::Model::Item::APP_1, Menu::Model::Item::APP_2, Menu::Model::Item::APP_3, Menu::Model::Item::APP_4, Menu::Model::Item::EXIT}, _currentSelection(0), _backgroundColor{0, 0, 0, 255}, _textColor{192, 192, 192, 255}, _selectionColor{0, 0, 150, 255}, _ascend(true) {} Menu::Model::Item Menu::Model::getCurrentSelection(void) { return _menuEntries.at(_currentSelection); } void Menu::Model::setCurrentSelection(unsigned int const selection) { _currentSelection = selection; } void Menu::Model::cycleUp(void) { _currentSelection = (_currentSelection - 1); if (_currentSelection >= NB_MENU_ENTRIES) _currentSelection = NB_MENU_ENTRIES - 1; } void Menu::Model::cycleDown(void) { _currentSelection = (_currentSelection + 1) % NB_MENU_ENTRIES; } void Menu::Model::cycleTo(Item const app) { _currentSelection = app; } void Menu::Model::elapse(Uint32 const gameTicks, std::shared_ptr<EngineUpdate> engineUpdate) { if (_ascend && _selectionColor.b < 200) { _selectionColor.b += 4; if (_selectionColor.b >= 200) _ascend = false; } else if (!_ascend && _selectionColor.b > 50) { _selectionColor.b -= 4; if (_selectionColor.b <= 50) _ascend = true; } } SDL_Color Menu::Model::getBackgroundColor(void) { return _backgroundColor; } SDL_Color Menu::Model::getTextColor(void) { return _textColor; } SDL_Color Menu::Model::getSelectionColor(void) { return _selectionColor; } /* ------------------ CONTROLLER ------------------ */ Menu::Controller::Controller( std::shared_ptr<Platform> platform, std::shared_ptr<Model> model) : _platform(platform), _model(model) {} void Menu::Controller::performAction(std::shared_ptr<EngineUpdate> engineUpdate) { switch(_model->getCurrentSelection()) { case Model::APP_1: engineUpdate->pushGameContext( Tank::Factory::createGameControllerDebug( _platform)); break; case Model::APP_2: engineUpdate->pushGameContext( GameControllerDebug::Factory::createGameControllerDebug( _platform)); break; case Model::APP_3: engineUpdate->pushGameContext( TextDebug::Factory::createTextDebug( _platform)); break; case Model::APP_4: break; case Model::EXIT: engineUpdate->popGameContext(); break; } } void Menu::Controller::quickExit(std::shared_ptr<EngineUpdate> engineUpdate) { _model->setCurrentSelection(Model::EXIT); performAction(engineUpdate); } void Menu::Controller::handleEvent(SDL_Event const & event, std::shared_ptr<EngineUpdate> engineUpdate) { switch(event.type) { case SDL_KEYDOWN: switch(event.key.keysym.sym) { case SDLK_UP: _model->cycleUp(); _platform->getMixer()->playEffect("drum"); break; case SDLK_DOWN: _model->cycleDown(); _platform->getMixer()->playEffect("drum"); break; case SDLK_RETURN: performAction(engineUpdate); break; case SDLK_ESCAPE: quickExit(engineUpdate); break; case SDLK_a: _model->cycleTo(Model::APP_1); break; case SDLK_b: _model->cycleTo(Model::APP_2); break; case SDLK_c: _model->cycleTo(Model::APP_3); break; case SDLK_d: _model->cycleTo(Model::APP_4); break; case SDLK_m: _platform->getMixer()->playMusic("ftl"); break; } break; case SDL_CONTROLLERBUTTONDOWN: switch (event.cbutton.button) { case SDL_CONTROLLER_BUTTON_DPAD_DOWN: _model->cycleDown(); _platform->getMixer()->playEffect("drum"); break; case SDL_CONTROLLER_BUTTON_DPAD_UP: _model->cycleUp(); _platform->getMixer()->playEffect("drum"); break; case SDL_CONTROLLER_BUTTON_A: performAction(engineUpdate); break; case SDL_CONTROLLER_BUTTON_BACK: quickExit(engineUpdate); break; } break; } } /* ------------------ VIEW ------------------ */ Menu::View::View(std::shared_ptr<Platform> platform, std::shared_ptr<Model> model) : _model(model), _platform(platform) {} void Menu::View::display(void) { WindowManager * windowManager(nullptr); Window * mainWindow(nullptr); Renderer * renderer(nullptr); windowManager = _platform->getWindowManager(); if (windowManager) mainWindow = windowManager->getWindowByName("mainWindow"); if (mainWindow) renderer = mainWindow->getRenderer(); if (!renderer) return; /* Clear draw area with blue */ renderer->setDrawColor(_model->getBackgroundColor()); renderer->fill(); /* Print menu name */ renderer->printText( "Main Menu", "courier", 20, _model->getTextColor(), {0, 0, 200, 64}); SDL_Rect menuItems[NB_MENU_ENTRIES]; menuItems[0] = { 220, 100, 600, 32 }; menuItems[1] = { 220, 140, 600, 32 }; menuItems[2] = { 220, 180, 600, 32 }; menuItems[3] = { 220, 220, 600, 32 }; menuItems[4] = { 220, 260, 600, 32 }; /* Print menu items */ mainWindow->getRenderer()->printText( "A - New Game", "courier", 20, _model->getTextColor(), menuItems[0]); mainWindow->getRenderer()->printText( "B - Game Controller Debug", "courier", 20, _model->getTextColor(), menuItems[1]); mainWindow->getRenderer()->printText( "C - Text Display Debug", "courier", 20, _model->getTextColor(), menuItems[2]); mainWindow->getRenderer()->printText( "D - <EMPTY>", "courier", 20, _model->getTextColor(), menuItems[3]); mainWindow->getRenderer()->printText( "Esc - Exit", "courier", 20, _model->getTextColor(), menuItems[4]); /* Highlight selection */ renderer->setDrawColor( _model->getSelectionColor().r, _model->getSelectionColor().g, _model->getSelectionColor().b, _model->getSelectionColor().a); SDL_Rect r(menuItems[_model->getCurrentSelection()]); renderer->drawRect(r); }
21.728188
80
0.672896
Derjik
b73bdbb98c78bd10ca60bee705ff945fe874cf4b
248
hpp
C++
src/misc/common/print/set.hpp
Pachicobue/AlgoLib
346f2208e9e93ef3c7e03c1b3ad525bc08be6d2e
[ "Unlicense" ]
4
2018-04-01T18:41:16.000Z
2019-08-11T11:45:47.000Z
src/misc/common/print/set.hpp
pachicobue/algolib
8acbce5c49cdfada7d187e7acab25a5c6a2f7fc5
[ "Unlicense" ]
null
null
null
src/misc/common/print/set.hpp
pachicobue/algolib
8acbce5c49cdfada7d187e7acab25a5c6a2f7fc5
[ "Unlicense" ]
1
2018-04-08T11:38:22.000Z
2018-04-08T11:38:22.000Z
#pragma once #include <iostream> #include <set> template<typename... Ts> std::ostream& operator<<(std::ostream& os, const std::set<Ts...>& vs) { os << "["; for (const auto& v : vs) { os << v << ","; } return (os << "]" << std::endl); }
22.545455
69
0.53629
Pachicobue
b73d7a961bca939034829c19f387edcf82e16a89
86
hpp
C++
src/boost_local_function_aux__preprocessor_traits_decl_sign__any_bind_type.hpp
miathedev/BoostForArduino
919621dcd0c157094bed4df752b583ba6ea6409e
[ "BSL-1.0" ]
10
2018-03-17T00:58:42.000Z
2021-07-06T02:48:49.000Z
src/boost_local_function_aux__preprocessor_traits_decl_sign__any_bind_type.hpp
miathedev/BoostForArduino
919621dcd0c157094bed4df752b583ba6ea6409e
[ "BSL-1.0" ]
2
2021-03-26T15:17:35.000Z
2021-05-20T23:55:08.000Z
src/boost_local_function_aux__preprocessor_traits_decl_sign__any_bind_type.hpp
miathedev/BoostForArduino
919621dcd0c157094bed4df752b583ba6ea6409e
[ "BSL-1.0" ]
4
2019-05-28T21:06:37.000Z
2021-07-06T03:06:52.000Z
#include <boost/local_function/aux_/preprocessor/traits/decl_sign_/any_bind_type.hpp>
43
85
0.860465
miathedev
b7413f5996daf56ffef26ec3b5d4385e217eb197
2,238
hpp
C++
general/src/MessengerConfig.hpp
mrpPhys/Isis
0322a660e75f13605b0e6fc9688b0ca99b72999d
[ "MIT" ]
null
null
null
general/src/MessengerConfig.hpp
mrpPhys/Isis
0322a660e75f13605b0e6fc9688b0ca99b72999d
[ "MIT" ]
null
null
null
general/src/MessengerConfig.hpp
mrpPhys/Isis
0322a660e75f13605b0e6fc9688b0ca99b72999d
[ "MIT" ]
null
null
null
//////////////////////////////////////////////////////////// // // General package // // --------------------------------------------------------- // // AUTHOR: Miguel Ramos Pernas // e-mail: miguel.ramos.pernas@cern.ch // // Last update: 19/10/2017 // // --------------------------------------------------------- // // Description: // // Provides variables and functions to format the output // of any program. This configuration is used by the class // Messenger. The colors and styles are based on the ANSI // escape code format. // // --------------------------------------------------------- //////////////////////////////////////////////////////////// #ifndef MESSENGER_CONFIG_HPP #define MESSENGER_CONFIG_HPP #include <cstdio> #include <string> #include <unistd.h> //_______________________________________________________________________________ namespace isis { namespace ANSIFormat { // Colors to format the output enum Colors { aBlack, aRed, aGreen, aYellow, aBlue, aMagenta, aCyan, aWhite, aNoColor }; // Styles to format the output enum Styles { aNormal, aBold, aFaint, aItalic, aUnderline, aNoStyle }; // GLOBAL variable storing whether the error output can be printed in color extern const bool ColoredStdErr; // GLOBAL variable storing whether the usual output can be printed in color extern const bool ColoredStdOut; // GLOBAL color for the error messages extern int ErrorColor; // GLOBAL prefix for the error messages extern std::string ErrorPrefix; // GLOBAL color for the information messages extern int InfoColor; // GLOBAL prefix for the error messages extern std::string InfoPrefix; // GLOBAL prefix for the messages extern std::string MsgPrefix; // GLOBAL color for the warning messages extern int WarningColor; // GLOBAL prefix for the error messages extern std::string WarningPrefix; } // Message codes enum MsgCode { Msg, Info, Warning, Error }; // Function to check whether color must be applied or not bool applyColor( const std::ostream &os ); // Function to replace < endl > for the class isis::Messenger std::ostream& endMsgLine( std::ostream &os ); } #endif
26.642857
92
0.61126
mrpPhys
b7435023bbb3575c6fcba08114b502d8c8338945
602
cpp
C++
src/hello.cpp
wangyoucao577/hello-sdk-sample
293d959661c986d6ec197e9ba05dc3c0bd7c99c8
[ "MIT" ]
null
null
null
src/hello.cpp
wangyoucao577/hello-sdk-sample
293d959661c986d6ec197e9ba05dc3c0bd7c99c8
[ "MIT" ]
null
null
null
src/hello.cpp
wangyoucao577/hello-sdk-sample
293d959661c986d6ec197e9ba05dc3c0bd7c99c8
[ "MIT" ]
null
null
null
#include "hello.h" #include "Poco/MD5Engine.h" #include "Poco/DigestStream.h" #include <iostream> #ifndef HELLO_SDK_VERSION #define HELLO_SDK_VERSION "unknown" #endif void hello(){ std::cout << "hello sdk version: " << HELLO_SDK_VERSION << std::endl; #ifdef NDEBUG std::cout << "Hello World Release!" <<std::endl; #else std::cout << "Hello World Debug!" <<std::endl; #endif Poco::MD5Engine md5; Poco::DigestOutputStream ds(md5); ds << "abcdefghijklmnopqrstuvwxyz"; ds.close(); std::cout << Poco::DigestEngine::digestToHex(md5.digest()) << std::endl; }
22.296296
76
0.654485
wangyoucao577
b743940eaad0e430f364df042a69c359c6654ea6
5,053
cpp
C++
ogsr_engine/xrGame/ai/monsters/poltergeist/poltergeist_ability.cpp
WladTriTopora/OGSR-Engine
b532f222a11ccbce5f95668b09277778a615f217
[ "Apache-2.0" ]
null
null
null
ogsr_engine/xrGame/ai/monsters/poltergeist/poltergeist_ability.cpp
WladTriTopora/OGSR-Engine
b532f222a11ccbce5f95668b09277778a615f217
[ "Apache-2.0" ]
null
null
null
ogsr_engine/xrGame/ai/monsters/poltergeist/poltergeist_ability.cpp
WladTriTopora/OGSR-Engine
b532f222a11ccbce5f95668b09277778a615f217
[ "Apache-2.0" ]
null
null
null
#include "stdafx.h" #include "poltergeist.h" #include "../../../PhysicsShell.h" #include "../../../level.h" #include "../../../material_manager.h" #include "../../../level_debug.h" CPolterSpecialAbility::CPolterSpecialAbility(CPoltergeist *polter) { m_object = polter; m_particles_object = 0; m_particles_object_electro = 0; } CPolterSpecialAbility::~CPolterSpecialAbility() { CParticlesObject::Destroy (m_particles_object); CParticlesObject::Destroy (m_particles_object_electro); } void CPolterSpecialAbility::load(LPCSTR section) { m_particles_hidden = pSettings->r_string(section,"Particles_Hidden"); m_particles_damage = pSettings->r_string(section,"Particles_Damage"); m_particles_death = pSettings->r_string(section,"Particles_Death"); m_particles_idle = pSettings->r_string(section,"Particles_Idle"); m_sound_base.create (pSettings->r_string(section,"Sound_Idle"), st_Effect, SOUND_TYPE_MONSTER_TALKING); m_last_hit_frame = 0; } void CPolterSpecialAbility::update_schedule() { if ( m_object->g_Alive() && m_object->is_hidden() ) { if (!m_sound_base._feedback()) m_sound_base.play_at_pos(m_object, m_object->Position()); else m_sound_base.set_position(m_object->Position()); } } void CPolterSpecialAbility::on_hide() { VERIFY(m_particles_object == 0); if (!m_object->g_Alive()) return; m_particles_object = m_object->PlayParticles (m_particles_hidden, m_object->Position(),Fvector().set(0.0f,0.1f,0.0f), false); m_particles_object_electro = m_object->PlayParticles (m_particles_idle, m_object->Position(),Fvector().set(0.0f,0.1f,0.0f), false); } void CPolterSpecialAbility::on_show() { if (m_particles_object) CParticlesObject::Destroy(m_particles_object); if (m_particles_object_electro) CParticlesObject::Destroy(m_particles_object_electro); m_sound_base.stop(); } void CPolterSpecialAbility::update_frame() { if (m_particles_object) m_particles_object->SetXFORM (m_object->XFORM()); if (m_particles_object_electro) m_particles_object_electro->SetXFORM(m_object->XFORM()); } void CPolterSpecialAbility::on_die() { Fvector particles_position = m_object->m_current_position; particles_position.y += m_object->target_height; m_object->PlayParticles (m_particles_death, particles_position, Fvector().set(0.0f,1.0f,0.0f), TRUE, FALSE); CParticlesObject::Destroy (m_particles_object_electro); CParticlesObject::Destroy (m_particles_object); m_sound_base.stop(); } void CPolterSpecialAbility::on_hit(SHit* pHDS) { if (m_object->g_Alive() && (pHDS->hit_type == ALife::eHitTypeFireWound) && (Device.dwFrame != m_last_hit_frame)) { if(BI_NONE != pHDS->bone()) { //вычислить координаты попадания CKinematics* V = smart_cast<CKinematics*>(m_object->Visual()); Fvector start_pos = pHDS->bone_space_position(); Fmatrix& m_bone = V->LL_GetBoneInstance(pHDS->bone()).mTransform; m_bone.transform_tiny (start_pos); m_object->XFORM().transform_tiny (start_pos); m_object->PlayParticles(m_particles_damage, start_pos, Fvector().set(0.f,1.f,0.f)); } } m_last_hit_frame = Device.dwFrame; } ////////////////////////////////////////////////////////////////////////// // Other ////////////////////////////////////////////////////////////////////////// #define IMPULSE 10.f #define IMPULSE_RADIUS 5.f #define TRACE_DISTANCE 10.f #define TRACE_ATTEMPT_COUNT 3 void CPoltergeist::PhysicalImpulse (const Fvector &position) { m_nearest.clear_not_free (); Level().ObjectSpace.GetNearest (m_nearest,position, IMPULSE_RADIUS, NULL); //xr_vector<CObject*> &m_nearest = Level().ObjectSpace.q_nearest; if (m_nearest.empty()) return; u32 index = Random.randI (m_nearest.size()); CPhysicsShellHolder *obj = smart_cast<CPhysicsShellHolder *>(m_nearest[index]); if (!obj || !obj->m_pPhysicsShell) return; Fvector dir; dir.sub(obj->Position(), position); dir.normalize(); CPhysicsElement* E=obj->m_pPhysicsShell->get_ElementByStoreOrder(u16(Random.randI(obj->m_pPhysicsShell->get_ElementsNumber()))); //E->applyImpulse(dir,IMPULSE * obj->m_pPhysicsShell->getMass()); E->applyImpulse(dir,IMPULSE * E->getMass()); } void CPoltergeist::StrangeSounds(const Fvector &position) { if (m_strange_sound._feedback()) return; for (u32 i = 0; i < TRACE_ATTEMPT_COUNT; i++) { Fvector dir; dir.random_dir(); collide::rq_result l_rq; if (Level().ObjectSpace.RayPick(position, dir, TRACE_DISTANCE, collide::rqtStatic, l_rq, NULL)) { if (l_rq.range < TRACE_DISTANCE) { // Получить пару материалов CDB::TRI* pTri = Level().ObjectSpace.GetStaticTris() + l_rq.element; SGameMtlPair* mtl_pair = GMLib.GetMaterialPair(material().self_material_idx(),pTri->material); if (!mtl_pair) continue; // Играть звук if (!mtl_pair->CollideSounds.empty()) { CLONE_MTL_SOUND(m_strange_sound, mtl_pair, CollideSounds); Fvector pos; pos.mad(position, dir, ((l_rq.range - 0.1f > 0) ? l_rq.range - 0.1f : l_rq.range)); m_strange_sound.play_at_pos(this,pos); return; } } } } }
31.58125
132
0.711261
WladTriTopora
b7474102b9088050a328888b42d8c22cbf8c1787
444
cpp
C++
owner1/ServantDesignPattern/src/Boss1.cpp
neupane11/OOP-sneupane
a5819cce2f4f662c377167ef687569b276c30e46
[ "MIT" ]
null
null
null
owner1/ServantDesignPattern/src/Boss1.cpp
neupane11/OOP-sneupane
a5819cce2f4f662c377167ef687569b276c30e46
[ "MIT" ]
null
null
null
owner1/ServantDesignPattern/src/Boss1.cpp
neupane11/OOP-sneupane
a5819cce2f4f662c377167ef687569b276c30e46
[ "MIT" ]
null
null
null
#include <string> #include <iostream> //#include <Queen.h> #include "../include/Boss1.h" void Boss1::getFed(){ isHungry=false; } void Boss1::getDrink(){ isDrunk=true; } void Boss1::receiveCompliments(){ complimentReceived=true; } void Boss1::changeMood(){ if(complimentReceived && isDrunk && !isHungry){ isHappy=true; //cout<<"Boss1 is happy"<<endl; } } bool Boss1::getMood(){ return isHappy; }
17.76
51
0.630631
neupane11
b74be2fac41a19e72d8a25ec475a1d13931b5e1a
7,832
cpp
C++
api_search/parse_source_files.cpp
langrange/functionlib
823b095eae81e3e0b8ce9b81c4d170b047927f82
[ "BSL-1.0" ]
null
null
null
api_search/parse_source_files.cpp
langrange/functionlib
823b095eae81e3e0b8ce9b81c4d170b047927f82
[ "BSL-1.0" ]
null
null
null
api_search/parse_source_files.cpp
langrange/functionlib
823b095eae81e3e0b8ce9b81c4d170b047927f82
[ "BSL-1.0" ]
null
null
null
// Copyright Tobias Hermann 2015. // https://github.com/Dobiasd/FunctionalPlus // 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 "fplus/fplus.hpp" #include <fstream> #include <iostream> #include <string> #include <vector> const std::string api_search_type_key = "API search type: "; const std::string comment_token = "// "; const auto is_comment = fplus::bind_1st_of_2( fplus::is_prefix_of<std::string>, comment_token); struct function_help { std::string name; std::string signature; std::string documentation; std::string declaration; }; std::string get_function_help_name(const function_help& f) { return f.name; } std::string get_function_help_signature(const function_help& f) { return f.signature; } std::string get_function_help_documentation(const function_help& f) { return f.documentation; } std::string get_function_help_declaration(const function_help& f) { return f.declaration; } std::ostream & operator<<(std::ostream &os, const function_help& f) { return os << "Name: " << f.name << "\n" << "Type: " << f.signature << "\n" << "Doc: " << f.documentation << "\n" << "Decl: " << f.declaration; } function_help lines_to_function_help(const std::vector<std::string>& lines) { const auto trim_line = fplus::bind_1st_of_2( fplus::trim_token_left<std::string>, comment_token); const auto trim_type_line = fplus::bind_1st_of_2( fplus::trim_token_left<std::string>, api_search_type_key); const auto trim_lines = fplus::bind_1st_of_2( fplus::transform<decltype(trim_line), std::vector<std::string>>, trim_line); const auto search_type = trim_type_line(trim_line(lines[0])); const auto doc_and_decl = fplus::span(is_comment, fplus::tail(lines)); const auto doc_and_decl_trimmed = fplus::transform_pair( trim_lines, trim_lines, doc_and_decl); auto name_and_type = fplus::split_by_token(std::string(" : "), false, search_type); assert(name_and_type.size() == 2); return { name_and_type[0], name_and_type[1], fplus::join(std::string("\n"), doc_and_decl_trimmed.first), fplus::join(std::string("\n"), doc_and_decl_trimmed.second) }; } bool begins_with_curly_open(const std::string& line) { return (!line.empty() && line.front() == '{'); }; const auto no_curly_open = fplus::logical_not(begins_with_curly_open); std::vector<function_help> parse_code_file(const std::string& code_file) { using namespace std; typedef vector<string> strings; const auto lines = fplus::read_text_file_lines(code_file, true)(); const auto is_search_type = fplus::bind_1st_of_2( fplus::is_infix_of<string>, api_search_type_key); const auto functions_lines = fplus::split_by_keep_separators( is_search_type, lines); if (functions_lines.size() < 2) return {}; const auto get_non_impl_lines = fplus::bind_1st_of_2( fplus::take_while<strings, decltype(no_curly_open)>, no_curly_open); const auto functions_docs = fplus::transform( get_non_impl_lines, fplus::tail(functions_lines)); return fplus::transform(lines_to_function_help, functions_docs); } std::vector<function_help> get_broken_function_helps( const std::vector<function_help>& helps) { auto help_is_ok = [](const function_help& help) { return !help.name.empty() && !help.signature.empty() && !help.declaration.empty() && !help.documentation.empty(); }; return fplus::drop_if(help_is_ok, helps); } std::string functions_to_elm_code(const std::vector<function_help> functions) { auto escape_backslashes = [](const std::string& str) -> std::string { return fplus::replace_tokens( std::string("\\"), std::string("\\\\"), str); }; auto escape_quotation_marks = [](const std::string& str) -> std::string { return fplus::replace_tokens( std::string("\""), std::string("\\\""), str); }; auto escape_newlines = [](const std::string& str) { return fplus::replace_tokens( std::string("\n"), std::string("\\n"), str); }; auto escape_special_characters = fplus::compose( escape_backslashes, escape_quotation_marks, escape_newlines); auto show_function = [&](const function_help& f) -> std::string { std::string str; str += std::string("{ name = \"") + f.name + "\""; str += std::string(", signature = \"") + f.signature + "\""; str += std::string(", documentation = \"") + escape_special_characters(f.documentation) + "\""; str += std::string(", declaration = \"") + escape_special_characters(f.declaration) + "\" }"; return str; }; auto function_strings = fplus::transform(show_function, functions); std::string result; result += "module Database exposing (..)\n\n\n"; result += "type alias Function =\n"; result += " { name : String\n"; result += " , signature : String\n"; result += " , documentation : String\n"; result += " , declaration : String\n"; result += " }\n\n\n"; result += "functions : List Function\n"; result += "functions =\n"; result += " [ "; result += fplus::join(std::string("\n , "), function_strings); result += "\n ]"; return result; } void print_duplicates(const std::vector<std::string>& strs) { const auto occurences = fplus::count_occurrences(strs); typedef decltype(occurences)::value_type pair; const std::vector<std::string> allowed_dups = {"and_then_maybe", "and_then_result", "compose", "show"}; const auto dups = fplus::keep_if([&](const pair& p) -> bool { return p.second > 1 && !fplus::is_elem_of(p.first, allowed_dups); }, fplus::map_to_pairs(occurences)); if (!dups.empty()) { std::cerr << "Duplicates!\n"; std::cerr << fplus::show_cont(dups) << std::endl; } std::cout << "---" << std::endl; } int main (int argc, char *argv[]) { if (argc != 2) { std::cerr << "Provide code file via command line." << std::endl; return 1; } const auto functions = fplus::sort_on(get_function_help_name, parse_code_file(std::string(argv[1]))); const auto broken = get_broken_function_helps(functions); std::cout << "broken:" << std::endl; if (fplus::is_not_empty(broken)) { std::cout << fplus::show_cont_with_frame_and_newlines( "\n-----\n", "[", "]", get_broken_function_helps(functions), 0) << std::endl; return 1; } std::cout << "---" << std::endl; using fplus::transform; std::cout << "duplicate help names:" << std::endl; print_duplicates(transform(get_function_help_name, functions)); //print_duplicates(transform(get_function_help_signature, functions)); std::cout << "duplicate help documentations:" << std::endl; print_duplicates(transform(get_function_help_documentation, functions)); std::cout << "duplicate help declarations:" << std::endl; print_duplicates(transform(get_function_help_declaration, functions)); auto output = functions_to_elm_code(functions); std::string out_file = "frontend/src/Database.elm"; if (fplus::write_text_file(out_file, output)()) { std::cout << out_file << " written." << std::endl; } else { std::cerr << "Error: Unable to write " << out_file << std::endl; } }
34.052174
77
0.622702
langrange
b74f2369cd213368280f21f041c52a4d839292e5
2,340
cpp
C++
src/_leetcode/leet_931.cpp
turesnake/leetPractice
a87b9b90eb8016038d7e5d3ad8e50e4ceb54d69b
[ "MIT" ]
null
null
null
src/_leetcode/leet_931.cpp
turesnake/leetPractice
a87b9b90eb8016038d7e5d3ad8e50e4ceb54d69b
[ "MIT" ]
null
null
null
src/_leetcode/leet_931.cpp
turesnake/leetPractice
a87b9b90eb8016038d7e5d3ad8e50e4ceb54d69b
[ "MIT" ]
null
null
null
/* * ====================== leet_931.cpp ========================== * -- tpr -- * CREATE -- 2020.05.23 * MODIFY -- * ---------------------------------------------------------- * 931. 下降路径最小和 */ #include "innLeet.h" namespace leet_931 {//~ // 26.6%, 100% int uniquePathsWithObstacles( std::vector<std::vector<int>>& obstacleGrid){ int H = static_cast<int>(obstacleGrid.size()); int W = static_cast<int>(obstacleGrid.at(0).size()); std::vector<int> dp1 ( W, 0 ); std::vector<int> dp2 ( W, 0 ); auto *fst = &dp1; auto *lst = &dp2; //-- fst->at(0) = (obstacleGrid.at(0).at(0)==1) ? 0 : 1; for( int i=1; i<W; i++ ){ fst->at(i) = (obstacleGrid.at(0).at(i)==1) ? 0 : fst->at(i-1); } /* cout <<"dp1:"<< endl; for( int i : dp1 ){ cout << i << ", "; } cout << endl; */ for( int j=1; j<H; j++ ){ for( int i=0; i<W; i++ ){ if( obstacleGrid.at(j).at(i)==1 ){ lst->at(i) = 0; }else{ lst->at(i) = (i==0) ? fst->at(i) : fst->at(i)+lst->at(i-1); } } std::swap(fst,lst); } return fst->back(); } // H,W: [1,100] // elem: [-100,100] 有负数 int minFallingPathSum( std::vector<std::vector<int>>& A){ int H = static_cast<int>(A.size()); int W = static_cast<int>(A.at(0).size()); std::vector<int> dp1 ( A.back().begin(), A.back().end() ); std::vector<int> dp2 ( W, 0 ); auto *fst = &dp1; // 这次倒序遍历,fst 指向更下的一行 auto *lst = &dp2; for( int j=H-2; j>=0; j-- ){// 倒序遍历层 for( int i=0; i<W; i++ ){ int l = (i==0) ? INT_MAX : fst->at(i-1); int m = fst->at(i); int r = (i==W-1) ? INT_MAX : fst->at(i+1); lst->at(i) = std::min(std::min(l,m),r) + A.at(j).at(i); } std::swap(fst,lst); } int mmin {INT_MAX}; for( int i : *fst ){ mmin = std::min(mmin,i); } return mmin; } //=========================================================// void main_(){ std::vector<std::vector<int>> v { {3} }; cout << minFallingPathSum(v) << endl; debug::log( "\n~~~~ leet: 931 :end ~~~~\n" ); } }//~
24.123711
75
0.394017
turesnake
b755ac69b89a9aca7b049baff3125ac2da069a3b
2,316
cpp
C++
fred2/prefsdlg.cpp
trgswe/fs2open.github.com
a159eba0cebca911ad14a118412fddfe5be8e9f8
[ "Unlicense" ]
307
2015-04-10T13:27:32.000Z
2022-03-21T03:30:38.000Z
fred2/prefsdlg.cpp
trgswe/fs2open.github.com
a159eba0cebca911ad14a118412fddfe5be8e9f8
[ "Unlicense" ]
2,231
2015-04-27T10:47:35.000Z
2022-03-31T19:22:37.000Z
fred2/prefsdlg.cpp
trgswe/fs2open.github.com
a159eba0cebca911ad14a118412fddfe5be8e9f8
[ "Unlicense" ]
282
2015-01-05T12:16:57.000Z
2022-03-28T04:45:11.000Z
/* * Copyright (C) Volition, Inc. 1999. All rights reserved. * * All source code herein is the property of Volition, Inc. You may not sell * or otherwise commercially exploit the source or things you created based on the * source. * */ #include "stdafx.h" #include "FRED.h" #include "PrefsDlg.h" #include "FREDDoc.h" #include "FREDView.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CPrefsDlg dialog CPrefsDlg::CPrefsDlg(CWnd* pParent /*=NULL*/) : CDialog(CPrefsDlg::IDD, pParent) { //{{AFX_DATA_INIT(CPrefsDlg) m_ConfirmDeleting = TRUE; m_ShowCapitalShips = TRUE; m_ShowElevations = TRUE; m_ShowFighters = TRUE; m_ShowGrid = TRUE; m_ShowMiscObjects = TRUE; m_ShowPlanets = TRUE; m_ShowWaypoints = TRUE; m_ShowStarfield = FALSE; //}}AFX_DATA_INIT } extern int Show_stars; void CPrefsDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CPrefsDlg) DDX_Check(pDX, ID_CONFIRM_DELETING, m_ConfirmDeleting); DDX_Check(pDX, ID_SHOW_CAPITALSHIPS, m_ShowCapitalShips); DDX_Check(pDX, ID_SHOW_ELEVATIONS, m_ShowElevations); DDX_Check(pDX, ID_SHOW_FIGHTERS, m_ShowFighters); DDX_Check(pDX, ID_SHOW_GRID, m_ShowGrid); DDX_Check(pDX, ID_SHOW_MISCOBJECTS, m_ShowMiscObjects); DDX_Check(pDX, ID_SHOW_PLANETS, m_ShowPlanets); DDX_Check(pDX, ID_SHOW_WAYPOINTS, m_ShowWaypoints); DDX_Check(pDX, IDC_PREF_STARFIELD, m_ShowStarfield); //}}AFX_DATA_MAP Show_stars = m_ShowStarfield; // CFREDView::SetViewParms(m_ConfirmDeleting); } BEGIN_MESSAGE_MAP(CPrefsDlg, CDialog) //{{AFX_MSG_MAP(CPrefsDlg) ON_BN_CLICKED(IDC_SAVE_DEFAULT_PREFS, OnSaveDefaultPrefs) ON_WM_CLOSE() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CPrefsDlg message handlers void CPrefsDlg::OnSaveDefaultPrefs() { // Put code to save user prefs here. m_ConfirmDeleting = 1; } void CPrefsDlg::OnClose() { // MessageBeep((WORD) -1); CDialog::OnClose(); } BOOL CPrefsDlg::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) { // MessageBeep((WORD) -1); return CDialog::Create(IDD, pParentWnd); }
24.125
157
0.704231
trgswe
b759d19a0701aa3acc8b1f3235f79f929c20977c
876
cpp
C++
cpp/161-170/One Edit Distance.cpp
KaiyuWei/leetcode
fd61f5df60cfc7086f7e85774704bacacb4aaa5c
[ "MIT" ]
150
2015-04-04T06:53:49.000Z
2022-03-21T13:32:08.000Z
cpp/161-170/One Edit Distance.cpp
yizhu1012/leetcode
d6fa443a8517956f1fcc149c8c4f42c0ad93a4a7
[ "MIT" ]
1
2015-04-13T15:15:40.000Z
2015-04-21T20:23:16.000Z
cpp/161-170/One Edit Distance.cpp
yizhu1012/leetcode
d6fa443a8517956f1fcc149c8c4f42c0ad93a4a7
[ "MIT" ]
64
2015-06-30T08:00:07.000Z
2022-01-01T16:44:14.000Z
class Solution { public: bool isOneEditDistance(string s, string t) { if (abs((int)s.length() - (int)t.length()) >= 2) return false; if (s == t) return false; if (s.length() == t.length()) { int diff(0); for (int i = 0;i < s.length();i++) { if (s[i] != t[i]) diff++; if (diff >= 2) return false; } return true; } if (s.length() > t.length()) return isOneEditDistance(t, s); int i(0), j(0); while (i < s.length() && j < t.length()) { if (s[i] == t[j]){ i++; j++; } else { j++; } } if (i == s.length() && j == t.length()) return true; if (j == i) return true; return false; } };
25.764706
70
0.365297
KaiyuWei
b75ef2fd45eaed88c14eca5eb766d4ac6271aaf1
43
cpp
C++
master/core/third/RCF/src/SF/SerializeDynamicArray.cpp
importlib/klib
a59837857689d0e60d3df6d2ebd12c3160efa794
[ "MIT" ]
4
2017-12-04T08:22:48.000Z
2019-10-26T21:44:59.000Z
master/core/third/RCF/src/SF/SerializeDynamicArray.cpp
isuhao/klib
a59837857689d0e60d3df6d2ebd12c3160efa794
[ "MIT" ]
null
null
null
master/core/third/RCF/src/SF/SerializeDynamicArray.cpp
isuhao/klib
a59837857689d0e60d3df6d2ebd12c3160efa794
[ "MIT" ]
4
2017-12-04T08:22:49.000Z
2018-12-27T03:20:31.000Z
#include <SF/SerializeDynamicArray.hpp>
14.333333
40
0.767442
importlib
b766232233cad9111cf57cab43edbfc468580696
4,088
cpp
C++
CastleDoctrine/gameSource/GalleryArchive.cpp
PhilipLudington/CastleDoctrine
443f2b6b0215a6d71515c8887c99b4322965622e
[ "Unlicense" ]
1
2020-01-16T00:07:11.000Z
2020-01-16T00:07:11.000Z
CastleDoctrine/gameSource/GalleryArchive.cpp
PhilipLudington/CastleDoctrine
443f2b6b0215a6d71515c8887c99b4322965622e
[ "Unlicense" ]
null
null
null
CastleDoctrine/gameSource/GalleryArchive.cpp
PhilipLudington/CastleDoctrine
443f2b6b0215a6d71515c8887c99b4322965622e
[ "Unlicense" ]
2
2019-09-17T12:08:20.000Z
2020-09-26T00:54:48.000Z
#include "GalleryArchive.h" #include "galleryObjects.h" #include "minorGems/util/stringUtils.h" GalleryArchive::GalleryArchive( Font *inDisplayFont, double inX, double inY ) : PageComponent( inX, inY ), mSelectedIndex( -1 ), mSlot( inDisplayFont, 0, 0, 1/32.0 ), mUpButton( "up.tga", -1.3125, .75, 1/16.0 ), mDownButton( "down.tga", -1.3125, -.75, 1/16.0 ) { addComponent( &mUpButton ); addComponent( &mDownButton ); mUpButton.addActionListener( this ); mDownButton.addActionListener( this ); addComponent( &mSlot ); mSlot.addActionListener( this ); clearObjects(); } GalleryArchive::~GalleryArchive() { } void GalleryArchive::actionPerformed( GUIComponent *inTarget ) { char change = false; if( inTarget == &mUpButton ) { mSelectedIndex --; if( mSelectedIndex < 0 ) { mSelectedIndex = mObjectList.size() - 1; } change = true; } else if( inTarget == &mDownButton ) { mSelectedIndex ++; if( mSelectedIndex > mObjectList.size() - 1 ) { mSelectedIndex = 0; } change = true; } else if( inTarget == &mSlot ) { int id = mSlot.getObject(); if( id != -1 ) { fireActionPerformed( this ); } } if( change ) { triggerToolTip(); mSlot.setObject( *( mObjectList.getElement( mSelectedIndex ) ) ); } } void GalleryArchive::clearObjects() { mObjectList.deleteAll(); mSelectedIndex = -1; mSlot.setObject( -1 ); mUpButton.setVisible( false ); mDownButton.setVisible( false ); } void GalleryArchive::addObject( int inObjectID ) { mObjectList.push_back( inObjectID ); mSelectedIndex = mObjectList.size() - 1; mSlot.setObject( inObjectID ); if( mObjectList.size() > 1 ) { mUpButton.setVisible( true ); mDownButton.setVisible( true ); } } int GalleryArchive::swapSelectedObject( int inReplacementObjectID ) { if( mSelectedIndex != -1 ) { int *object = mObjectList.getElement( mSelectedIndex ); int oldID = *object; *object = inReplacementObjectID; mSlot.setObject( inReplacementObjectID ); triggerToolTip(); return oldID; } else { return -1; } } int GalleryArchive::getObjectCount() { return mObjectList.size(); } char *GalleryArchive::getContentsString() { if( mObjectList.size() == 0 ) { return stringDuplicate( "#" ); } SimpleVector<char *> parts; // hold selected object and keep it to add at end of list // this allows selected object to be remembered server-side // (the last object added, from the end of the list, ends up selected // when loaded from the server later) for( int i=0; i<mObjectList.size(); i++ ) { if( mSelectedIndex != i ) { int id = *( mObjectList.getElement( i ) ); parts.push_back( autoSprintf( "%d", id ) ); } } if( mSelectedIndex != -1 ) { int id = *( mObjectList.getElement( mSelectedIndex ) ); parts.push_back( autoSprintf( "%d", id ) ); } char **partsArray = parts.getElementArray(); char *fullString = join( partsArray, parts.size(), "#" ); for( int i=0; i<parts.size(); i++ ) { delete [] partsArray[i]; } delete [] partsArray; return fullString; } char GalleryArchive::isVisible() { if( mObjectList.size() == 0 ) { return false; } return true; } void GalleryArchive::triggerToolTip() { if( mSelectedIndex != -1 ) { setToolTip( getGalleryObjectDescription( *( mObjectList.getElement( mSelectedIndex ) ) ) ); } }
21.181347
78
0.540117
PhilipLudington
b76e21843ae703b4f5bf75fdc12489ad3ed301c3
564
hpp
C++
source/circle.hpp
tonradev/programmiersprachen-aufgabenblatt-2
2f45807b748a692fa3a98901ee6d072e60e36ee8
[ "MIT" ]
null
null
null
source/circle.hpp
tonradev/programmiersprachen-aufgabenblatt-2
2f45807b748a692fa3a98901ee6d072e60e36ee8
[ "MIT" ]
null
null
null
source/circle.hpp
tonradev/programmiersprachen-aufgabenblatt-2
2f45807b748a692fa3a98901ee6d072e60e36ee8
[ "MIT" ]
null
null
null
#ifndef CIRCLE_HPP #define CIRCLE_HPP #include "vec2.hpp" #include "color.hpp" #include "window.hpp" class Circle { public: Circle() = default; Circle(Vec2 const& center, float radius, Color const& color); float circumference() const; float thickness() const; void draw(Window const& target, float thickness); bool is_inside(Vec2 const& point) const; private: Vec2 center_{0,0}; float radius_{1.0f}; Color color_{0.5,0.5,0.5}; float thickness_{1.0f}; }; #endif // CIRCLE_HPP
25.636364
69
0.624113
tonradev
b76e95ad56269768c9b154a898206dec99ddf816
922
hpp
C++
libs/parsejson/include/sge/parse/json/detail/is_iterable.hpp
cpreh/spacegameengine
313a1c34160b42a5135f8223ffaa3a31bc075a01
[ "BSL-1.0" ]
2
2016-01-27T13:18:14.000Z
2018-05-11T01:11:32.000Z
libs/parsejson/include/sge/parse/json/detail/is_iterable.hpp
cpreh/spacegameengine
313a1c34160b42a5135f8223ffaa3a31bc075a01
[ "BSL-1.0" ]
null
null
null
libs/parsejson/include/sge/parse/json/detail/is_iterable.hpp
cpreh/spacegameengine
313a1c34160b42a5135f8223ffaa3a31bc075a01
[ "BSL-1.0" ]
3
2018-05-11T01:11:34.000Z
2021-04-24T19:47:45.000Z
// Copyright Carl Philipp Reh 2006 - 2019. // 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) #ifndef SGE_PARSE_JSON_DETAIL_IS_ITERABLE_HPP_INCLUDED #define SGE_PARSE_JSON_DETAIL_IS_ITERABLE_HPP_INCLUDED #include <fcppt/preprocessor/disable_gcc_warning.hpp> #include <fcppt/preprocessor/pop_warning.hpp> #include <fcppt/preprocessor/push_warning.hpp> #include <fcppt/config/external_begin.hpp> #include <type_traits> #include <fcppt/config/external_end.hpp> namespace sge::parse::json::detail { FCPPT_PP_PUSH_WARNING FCPPT_PP_DISABLE_GCC_WARNING(-Weffc++) template <typename Type, typename Test = void> struct is_iterable : std::false_type { }; template <typename Type> struct is_iterable<Type, decltype(std::declval<Type>().begin())> : std::true_type { }; FCPPT_PP_POP_WARNING } #endif
24.918919
81
0.774403
cpreh
b777bad6394610c0727f4190adeb02bc5b7b35f0
5,115
cpp
C++
Board.cpp
nirklinger/Tetris
a4a51abda31f8dcab0e11ac9273497e8c994503f
[ "MIT" ]
null
null
null
Board.cpp
nirklinger/Tetris
a4a51abda31f8dcab0e11ac9273497e8c994503f
[ "MIT" ]
1
2021-03-29T17:47:16.000Z
2021-04-02T09:35:37.000Z
Board.cpp
nirklinger/Tetris
a4a51abda31f8dcab0e11ac9273497e8c994503f
[ "MIT" ]
null
null
null
#include "Board.h" void Board::draw() const { for (int y = 0; y < HEIGHT; y++) { for (int x = 0; x < WIDTH; x++) { char ch = ' '; if (field[y][x]) { ch = '#'; } Point(boardOffset.getX() + x, boardOffset.getY() + y).draw(ch); } } if (block) block->draw(); } void Board::clearRow(int y) { for (int x = 5; x < WIDTH; x++) { Point(boardOffset.getX() + x, boardOffset.getY() + y).draw(' '); Point(boardOffset.getX() + WIDTH - 1 - x, boardOffset.getY() + y).draw(' '); Sleep(CLEAR_ROW_DELAY); } } bool Board::isLost() const { return hasLost; } bool Board::checkIfLost() { int minY = block->getBlockMinY(); hasLost = minY - boardOffset.getY() < 0; return hasLost; } void Board::shrinkEmptyRow(int rowDeleted) { for (int y = rowDeleted; y > 0; y--) { field[y] = field[y - 1]; } fill(field[0].begin(), field[0].end(), 0); } void Board::rotateBlock(int quarters) { block->clearDraw(); block->rotateQuarterly(quarters); auto deltaX = getRightBorderDeviation(); bool isColiding = false; if (deltaX > 0) { isColiding = tryMoveBlock(-deltaX, 0, false); } else { deltaX = getLeftBorderDeviation(); if (deltaX < 0) { isColiding = tryMoveBlock(-deltaX, 0, false); } else { isColiding = checkBlockFieldColision(); } } if (isColiding) block->rotateQuarterly(-quarters); block->draw(); } bool Board::tryMoveBlock(int x, int y, bool shouldDraw) { if (shouldDraw) block->clearDraw(); block->move(x, y); bool isOut = isOutOfBounds(); // we should check the colision only if the block is in bounds bool isColiding = isOut ? isOutOfMaxY() : checkBlockFieldColision(); if (isOut || isColiding) block->move(-x, -y); if (shouldDraw) block->draw(); return isColiding; } void Board::rotateCounterClockwise() { rotateBlock(-1); } void Board::rotateClockwise() { rotateBlock(1); } void Board::moveRight() { tryMoveBlock(1, 0); } void Board::moveLeft() { tryMoveBlock(-1, 0); } bool Board::isOutOfBounds() const { return getLeftBorderDeviation() < 0 || getRightBorderDeviation() > 0 || isOutOfMaxY(); } int Board::getLeftBorderDeviation() const { int minX = block->getBlockMinX(); return minX - boardOffset.getX(); } int Board::getRightBorderDeviation() const { int maxX = block->getBlockMaxX(); return maxX - (boardOffset.getX() + WIDTH - 1); } bool Board::isOutOfMaxY() const { return block->getBlockMaxY() >= boardOffset.getY() + HEIGHT; } void Board::layBlockInField() { auto numPoints = block->getNumberOfPoints(); for (int i = 0; i < numPoints; i++) { Point p = block->getPoint(i); int y = p.getY() - boardOffset.getY(); int x = p.getX() - boardOffset.getX(); field[y][x] = 1; } } bool Board::checkBlockFieldColision() { for (int i = 0; i < 4; i++) { Point p = block->getPoint(i); int y = p.getY() - boardOffset.getY(); int x = p.getX() - boardOffset.getX(); if (y < 0) continue; bool isEmpty = !field[y][x]; if (!isEmpty) { return true; } } return false; } void Board::generateNewBlock() { if (block) { delete block; block = nullptr; } auto chance = getRandom(1, 20); bool shouldGenerateBomb = (chance == 10); //draw 1 specific number out of 20 is at 5% chance if (shouldGenerateBomb) { block = new Bomb(Point(boardOffset.getX() + WIDTH / 2 - 2, 0)); } else { block = new Block(Point(boardOffset.getX() + WIDTH / 2 - 2, 0)); } } void Board::checkForCompletedRows(int bottom, int top) { for (int y = bottom; y <= top; y++) { int occupiedCells = count(field[y].begin(), field[y].end(), 1); if (occupiedCells == WIDTH) { clearRow(y); shrinkEmptyRow(y); draw(); } } } void Board::step() { if (hasLost) { shouldDropBlock = false; return; } bool isColiding = tryMoveBlock(0, 1); if (isColiding) { if (checkIfLost()) { return; } layBlockInField(); int bottom = block->getBlockMinY() - boardOffset.getY(); int top = block->getBlockMaxY() - boardOffset.getY(); auto bomb = dynamic_cast<Bomb*>(block); if (bomb) { Point explotionStartIndex; int diameter = bomb->getDiameter(); bomb->explode(field, boardOffset, explotionStartIndex, HEIGHT, WIDTH - 1); delete bomb; block = nullptr; reduceExplosion(explotionStartIndex, diameter); } else { checkForCompletedRows(bottom, top); } shouldDropBlock = false; generateNewBlock(); } else if (shouldDropBlock) { Sleep(DROP_SPEED); this->step(); } } void Board::reduceExplosion(Point startIndex, int diameter) { int maxX = min(startIndex.getX() + diameter, WIDTH - 1); for (int i = 0; i < HEIGHT - startIndex.getY(); i++) { for (int y = i + startIndex.getY() - 1; y >= 0; y--) { for (int x = startIndex.getX(); x <= maxX; x++) { if (y < HEIGHT && field[y+1][x] == 0) { field[y+1][x] = field[y][x]; field[y][x] = 0; } } } draw(); Sleep(DROP_SPEED); } }
21.049383
94
0.595699
nirklinger
b77d6d7b2835515eab9f94800839e5f9243d489a
577
cpp
C++
Matrix_Chain_Multiplication/mem.cpp
sujoyyyy/Dynamic-Programming
af4315baf30f7d9ebabd9d3035029c5a6f60e99f
[ "MIT" ]
2
2020-09-08T13:30:40.000Z
2022-01-24T07:48:16.000Z
Matrix_Chain_Multiplication/mem.cpp
sujoyyyy/Dynamic-Programming
af4315baf30f7d9ebabd9d3035029c5a6f60e99f
[ "MIT" ]
null
null
null
Matrix_Chain_Multiplication/mem.cpp
sujoyyyy/Dynamic-Programming
af4315baf30f7d9ebabd9d3035029c5a6f60e99f
[ "MIT" ]
2
2020-09-14T03:20:37.000Z
2021-02-28T14:40:15.000Z
#include<bits/stdc++.h> using namespace std; int t[1001][1001]; int solve(int arr[],int i,int j) { if(i>=j) { return 0; } if(t[i][j]!=-1) { return t[i][j]; } int min = INT_MAX; for(int k=i;k<j;k++) { int temp = solve(arr,i,k)+solve(arr,k+1,j)+arr[i-1]*arr[k]*arr[j]; if(min>temp) { min=temp; } } t[i][j]=min; return t[i][j]; } int main() { memset(t,-1,sizeof(t)); int arr[]={40,30,20,30}; cout<<solve(arr,1,(sizeof(arr)/sizeof(arr[0])-1)); return 0; }
16.970588
74
0.459272
sujoyyyy
b781cf3ce2c8bbeff254dd5414972a519d5be15b
5,899
cpp
C++
example/consensus/main/src/consensusserver.cpp
joydit/solidframe
0539b0a1e77663ac4c701a88f56723d3e3688e8c
[ "BSL-1.0" ]
null
null
null
example/consensus/main/src/consensusserver.cpp
joydit/solidframe
0539b0a1e77663ac4c701a88f56723d3e3688e8c
[ "BSL-1.0" ]
null
null
null
example/consensus/main/src/consensusserver.cpp
joydit/solidframe
0539b0a1e77663ac4c701a88f56723d3e3688e8c
[ "BSL-1.0" ]
null
null
null
#include "example/consensus/server/serverobject.hpp" #include "example/consensus/core/consensusmanager.hpp" #include "example/consensus/core/consensusrequests.hpp" #include "consensus/consensusregistrar.hpp" #include "frame/service.hpp" #include "frame/scheduler.hpp" #include "frame/aio/aioselector.hpp" #include "frame/aio/aiosingleobject.hpp" #include "frame/objectselector.hpp" #include "frame/ipc/ipcservice.hpp" #include "system/debug.hpp" #include "system/socketaddress.hpp" #include <iostream> #include "boost/program_options.hpp" using namespace std; using namespace solid; typedef frame::IndexT IndexT; typedef frame::Scheduler<frame::aio::Selector> AioSchedulerT; typedef frame::Scheduler<frame::ObjectSelector> SchedulerT; typedef DynamicSharedPointer<ServerConfiguration> ServerConfigurationSharedPointerT; typedef DynamicPointer<consensus::server::Configuration> ConfigurationPointerT; //------------------------------------------------------------------ //------------------------------------------------------------------ struct Params{ Params():cfgptr(new ServerConfiguration){} int ipc_port; string dbg_levels; string dbg_modules; string dbg_addr; string dbg_port; bool dbg_buffered; bool dbg_console; bool log; ServerConfigurationSharedPointerT cfgptr; }; bool parseArguments(Params &_par, int argc, char *argv[]); int main(int argc, char *argv[]){ Params p; if(parseArguments(p, argc, argv)) return 0; Thread::init(); #ifdef UDEBUG { string dbgout; Debug::the().levelMask(p.dbg_levels.c_str()); Debug::the().moduleMask(p.dbg_modules.c_str()); if(p.dbg_addr.size() && p.dbg_port.size()){ Debug::the().initSocket( p.dbg_addr.c_str(), p.dbg_port.c_str(), p.dbg_buffered, &dbgout ); }else if(p.dbg_console){ Debug::the().initStdErr( p.dbg_buffered, &dbgout ); }else{ Debug::the().initFile( *argv[0] == '.' ? argv[0] + 2 : argv[0], p.dbg_buffered, 3, 1024 * 1024 * 64, &dbgout ); } cout<<"Debug output: "<<dbgout<<endl; dbgout.clear(); Debug::the().moduleNames(dbgout); cout<<"Debug modules: "<<dbgout<<endl; } #endif { if(!p.cfgptr->init(p.ipc_port)){ //cout<<"Failed ServerParams::init: "<<p.p.errorString()<<endl; idbg("Failed ServerParams::init: "<<p.cfgptr->errorString()); return 0; } //cout<<p.p; idbg(*p.cfgptr); } { frame::Manager m; AioSchedulerT aiosched(m); SchedulerT objsched(m); frame::ipc::Service ipcsvc(m, new frame::ipc::BasicController(aiosched)); mapSignals(ipcsvc); ServerObject::dynamicRegister(); ServerObject::registerMessages(ipcsvc); m.registerService(ipcsvc); { frame::ipc::Configuration cfg; ResolveData rd = synchronous_resolve("0.0.0.0", p.ipc_port, 0, SocketInfo::Inet4, SocketInfo::Datagram); //frame::aio::Error err; bool err; cfg.baseaddr = rd.begin(); err = ipcsvc.reconfigure(cfg); if(!err){ //TODO: //cout<<"Error starting ipcservice: "<<err.toString()<<endl; Thread::waitAll(); return 0; } } ConfigurationPointerT cfgptr(p.cfgptr); DynamicPointer<ServerObject> objptr(new ServerObject(ipcsvc, cfgptr)); objptr->serverIndex(consensus::Registrar::the().registerObject(m.registerObject(*objptr))); objsched.schedule(objptr); char c; cout<<"> "<<flush; cin>>c; m.stop(); } Thread::waitAll(); return 0; } bool parseArguments(Params &_par, int argc, char *argv[]){ using namespace boost::program_options; try{ options_description desc("SolidFrame distributed concept server application"); desc.add_options() ("help,h", "List program options") ("ipc_port,i", value<int>(&_par.ipc_port)->default_value(2000),"Base port") ("debug_levels,L", value<string>(&_par.dbg_levels)->default_value("view"),"Debug logging levels") ("debug_modules,M", value<string>(&_par.dbg_modules)->default_value("any"),"Debug logging modules") ("debug_address,A", value<string>(&_par.dbg_addr), "Debug server address (e.g. on linux use: nc -l 2222)") ("debug_port,P", value<string>(&_par.dbg_port), "Debug server port (e.g. on linux use: nc -l 2222)") ("debug_console,C", value<bool>(&_par.dbg_console)->implicit_value(true)->default_value(false), "Debug console") ("debug_unbuffered,S", value<bool>(&_par.dbg_buffered)->implicit_value(false)->default_value(true), "Debug unbuffered") ("use_log,l", value<bool>(&_par.log)->implicit_value(true)->default_value(false), "Debug buffered") ("server_addrs,a", value< vector<string> >(&_par.cfgptr->addrstrvec), "Server addresses") /* ("verbose,v", po::value<int>()->implicit_value(1), "enable verbosity (optionally specify level)")*/ /* ("listen,l", po::value<int>(&portnum)->implicit_value(1001) ->default_value(0,"no"), "listen on a port.") ("include-path,I", po::value< vector<string> >(), "include path") ("input-file", po::value< vector<string> >(), "input file")*/ ; variables_map vm; store(parse_command_line(argc, argv, desc), vm); notify(vm); if (vm.count("help")) { cout << desc << "\n\n"; cout<<"Examples:"<<endl<<endl; cout<<"$ ./example_consensus_client -a 127.0.0.1:2000 -a 127.0.0.1:3000 -a 127.0.0.1:4000 -C -M \"any\" -s \"i10\""<<endl; cout<<"New terminal:"<<endl; cout<<"$ ./example_consensus_server -i 2000 -a 127.0.0.1:2000 -a 127.0.0.1:3000 -a 127.0.0.1:4000 -C -M \"any\""<<endl; cout<<"New terminal:"<<endl; cout<<"$ ./example_consensus_server -i 3000 -a 127.0.0.1:2000 -a 127.0.0.1:3000 -a 127.0.0.1:4000 -C -M \"any\""<<endl; cout<<"New terminal:"<<endl; cout<<"$ ./example_consensus_server -i 4000 -a 127.0.0.1:2000 -a 127.0.0.1:3000 -a 127.0.0.1:4000 -C -M \"any\""<<endl; return true; } return false; }catch(exception& e){ cout << e.what() << "\n"; return true; } }
30.564767
125
0.651297
joydit
b783083af556e82ba509c8653fc292fe86216276
36
cpp
C++
make/ddk_build/cpprtl_test.sys.project/eh_test_suite.syslib/test05.cpp
133a/project_ntke_cpprtl
f2d3fd36a2c44f968f7b10c344abe7e0b7aa2e4c
[ "MIT" ]
12
2016-08-02T19:22:26.000Z
2022-02-28T21:20:18.000Z
make/ddk_build/cpprtl_test.sys.project/eh_test_suite.syslib/test05.cpp
133a/project_ntke_cpprtl
f2d3fd36a2c44f968f7b10c344abe7e0b7aa2e4c
[ "MIT" ]
null
null
null
make/ddk_build/cpprtl_test.sys.project/eh_test_suite.syslib/test05.cpp
133a/project_ntke_cpprtl
f2d3fd36a2c44f968f7b10c344abe7e0b7aa2e4c
[ "MIT" ]
6
2018-04-15T16:51:40.000Z
2021-04-23T19:32:34.000Z
#include <eh_test_suite/test05.cpp>
18
35
0.805556
133a
b78b47e87117f0de2c7cd2ef0130ac8c93588c9f
3,755
cxx
C++
src/rtkResourceProbesCollector.cxx
agravgaard/RTK
419f71cdaf0600fcb54e4faca643121b7832ea96
[ "Apache-2.0", "BSD-3-Clause" ]
167
2015-02-26T08:39:33.000Z
2022-03-31T04:40:35.000Z
src/rtkResourceProbesCollector.cxx
agravgaard/RTK
419f71cdaf0600fcb54e4faca643121b7832ea96
[ "Apache-2.0", "BSD-3-Clause" ]
270
2015-02-26T15:34:32.000Z
2022-03-22T09:49:24.000Z
src/rtkResourceProbesCollector.cxx
agravgaard/RTK
419f71cdaf0600fcb54e4faca643121b7832ea96
[ "Apache-2.0", "BSD-3-Clause" ]
117
2015-05-01T14:56:49.000Z
2022-03-11T03:18:26.000Z
/*========================================================================= * * Copyright RTK Consortium * * 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.txt * * 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 "rtkResourceProbesCollector.h" #include <iostream> namespace rtk { void ResourceProbesCollector::Start(const char * id) { // if the probe does not exist yet, it is created. this->m_TimeProbes[id].SetNameOfProbe(id); this->m_TimeProbes[id].Start(); this->m_MemoryProbes[id].SetNameOfProbe(id); this->m_MemoryProbes[id].Start(); #ifdef RTK_USE_CUDA this->m_CudaMemoryProbes[id].SetNameOfProbe(id); this->m_CudaMemoryProbes[id].Start(); #endif } void ResourceProbesCollector::Stop(const char * id) { IdType tid = id; auto pos = this->m_TimeProbes.find(tid); if (pos == this->m_TimeProbes.end()) { itkGenericExceptionMacro(<< "The probe \"" << id << "\" does not exist. It can not be stopped."); return; } pos->second.Stop(); m_MemoryProbes[tid].Stop(); #ifdef RTK_USE_CUDA m_CudaMemoryProbes[tid].Stop(); #endif } void ResourceProbesCollector::Report(std::ostream & os) const { auto tProbe = this->m_TimeProbes.begin(); auto tEnd = this->m_TimeProbes.end(); if (tProbe == tEnd) { return; } unsigned int maxlength = sizeof("Probe Tag") / sizeof(char); while (tProbe != tEnd) maxlength = std::max(maxlength, (unsigned int)(tProbe++)->first.size()); maxlength += 2; tProbe = this->m_TimeProbes.begin(); auto mProbe = this->m_MemoryProbes.begin(); #ifdef RTK_USE_CUDA auto cProbe = this->m_CudaMemoryProbes.begin(); #endif os << std::endl << std::endl; #ifdef RTK_USE_CUDA os.width(maxlength + 10 + 10 + 15 + 15 + 15); #else os.width(maxlength + 10 + 10 + 15 + 15); #endif os << std::setfill('*') << "" << std::endl << std::setfill(' '); os.width(maxlength); os << std::left; os << "Probe Tag"; os.width(10); os << "Starts"; os.width(10); os << "Stops"; os.width(15); os << std::string(tProbe->second.GetType() + " (" + tProbe->second.GetUnit() + ")"); os.width(15); os << std::string(mProbe->second.GetType() + " (" + mProbe->second.GetUnit() + ")"); #ifdef RTK_USE_CUDA os.width(15); os << std::string(cProbe->second.GetType() + " (" + cProbe->second.GetUnit() + ")"); #endif os << std::endl; #ifdef RTK_USE_CUDA os.width(maxlength + 10 + 10 + 15 + 15 + 15); #else os.width(maxlength + 10 + 10 + 15 + 15); #endif os << std::setfill('*') << "" << std::endl << std::setfill(' '); while (tProbe != tEnd) { os.width(maxlength); os << tProbe->first; os.width(10); os << tProbe->second.GetNumberOfStarts(); os.width(10); os << tProbe->second.GetNumberOfStops(); os.width(15); os << tProbe++->second.GetMean(); os.width(15); os << mProbe++->second.GetMean(); #ifdef RTK_USE_CUDA os.width(15); os << cProbe++->second.GetMean(); #endif os << std::endl; } os << std::setfill('*') << "" << std::endl << std::setfill(' '); } void ResourceProbesCollector::Clear() { this->m_TimeProbes.clear(); this->m_MemoryProbes.clear(); #ifdef RTK_USE_CUDA this->m_CudaMemoryProbes.clear(); #endif } } // end namespace rtk
26.258741
101
0.618642
agravgaard
b78f27a5495c29885bd6c57e1e3d8e8e4181cafb
12,121
hpp
C++
demos/game_of_life/gol_widget.hpp
skvl/TermOx
35761f9ba0e300b7d8edd4e2a0c7dd33ef8fb934
[ "MIT" ]
null
null
null
demos/game_of_life/gol_widget.hpp
skvl/TermOx
35761f9ba0e300b7d8edd4e2a0c7dd33ef8fb934
[ "MIT" ]
null
null
null
demos/game_of_life/gol_widget.hpp
skvl/TermOx
35761f9ba0e300b7d8edd4e2a0c7dd33ef8fb934
[ "MIT" ]
1
2021-08-06T10:17:28.000Z
2021-08-06T10:17:28.000Z
#ifndef TERMOX_DEMOS_GAME_OF_LIFE_GOL_WIDGET_HPP #define TERMOX_DEMOS_GAME_OF_LIFE_GOL_WIDGET_HPP #include <chrono> #include <cstdint> #include <string> #include <string_view> #include <signals_light/signal.hpp> #include <termox/painter/glyph.hpp> #include <termox/painter/painter.hpp> #include <termox/system/key.hpp> #include <termox/system/mouse.hpp> #include <termox/widget/area.hpp> #include <termox/widget/pipe.hpp> #include <termox/widget/point.hpp> #include <termox/widget/widget.hpp> #include "colors.hpp" #include "game_of_life_engine.hpp" #include "pattern.hpp" #include "rule.hpp" namespace gol { class GoL_widget : public ox::Widget { public: using Period_t = std::chrono::milliseconds; public: GoL_widget() { *this | ox::pipe::strong_focus(); this->set_rules("B3/S23"); } public: /// Change the animation rate, in milliseconds. void set_period(Period_t period) { period_ = period; this->update_period(); } /// Start animation, no-op if already running. void start() { this->enable_animation(period_); } /// Pause auto generation increment. void pause() { this->disable_animation(); } /// Progress to the next iteration of the game. void step() { if (this->is_animated()) return; engine_.get_next_generation(); this->update(); } /// Set Hi-Resolution Mode. void enable_hi_res(bool enabled = true) { hi_res_ = enabled; if (enabled) this->set_offset({offset_.x / 2, offset_.y / 4}); else this->set_offset({offset_.x * 2, offset_.y * 4}); this->update(); } /// Alternate between Hi-Resolution mode and Low-Resolution Mode void toggle_hi_res() { this->enable_hi_res(!hi_res_); } /// Set the birth/survivor neighbor counts. /** conwaylife.com/wiki/Rulestring * B/S Format: B\d*\/S\d* * S/B Format: \d*\/\d* * Throws std::invalid_argument if string is not in proper format. */ void set_rules(std::string_view rule_string) { auto const r = parse_rule_string(rule_string); engine_.set_rules(r); rule_changed(r); } /// Directly set the Game of Life rules. void set_rules(Rule r) { engine_.set_rules(r); rule_changed(r); } // TODO this and import pattern should be the same. /// Directly set the Pattern, rule; doesn't clear the screen before setting. void set_pattern(Pattern const& pattern) { engine_.import(pattern); rule_changed(pattern.rule); this->update(); } /// Clear the screen and reset the pattern to be all dead cells. void clear() { engine_.kill_all(); this->update(); } /// Enable/disable a background grid for easier pattern creation. void toggle_grid() { grid_ = !grid_; if (grid_) this->set_wallpaper(L'┼' | fg(color::Teal)); else this->set_wallpaper(dead_cell); this->update(); } /// Import and reset the pattern to the file contents. /** File extension and headers are used to determine the filetype. Can * parse Life 1.05, Life 1.06, Plaintext, and RLE files. */ void import_file(std::string const& filename); /// Import a pattern, set the rules, and reset the generation count. /** This does not clear the current alive cells. */ void import_pattern(Pattern pattern); /// Export the current state as file. /** File extension is used to determine the filetype to export as. Can * export as Life 1.05(.lif), Life 1.06(.life), Plaintext(.cell), and * RLE(.rle) */ void export_to_file(std::string const& filename); /// Set the engine coordinates that are at the center of the screen. void set_offset(Coordinate offset) { offset_ = offset; offset_changed(offset_); this->update(); } /// Return the engine coordinates that are at the center of the screen. auto offset() const -> Coordinate { return offset_; } void enable_rainbow() { cell_color_ = color::Rainbow; this->update(); } void disable_rainbow() { cell_color_ = color::White; this->update(); } void toggle_rainbow() { if (cell_color_ == color::White) this->enable_rainbow(); else this->disable_rainbow(); } protected: auto paint_event() -> bool override { if (hi_res_) this->paint_hi_res(); else this->paint_low_res(); return Widget::paint_event(); } auto mouse_press_event(ox::Mouse const& m) -> bool override { auto const c = transform_to_engine(m.local); if (m.button == ox::Mouse::Button::Right) { if (hi_res_) this->decrement_at(c); else engine_.kill(c); this->update(); } else if (m.button == ox::Mouse::Button::Left) { if (hi_res_) this->increment_at(c); else engine_.create_life(c); this->update(); } return Widget::mouse_press_event(m); } auto mouse_wheel_event(ox::Mouse const& m) -> bool override { auto const c = transform_to_engine(m.local); if (m.button == ox::Mouse::Button::ScrollUp) { if (m.modifiers.ctrl) this->set_offset({offset_.x, offset_.y - 1}); else if (m.modifiers.shift) this->set_offset({offset_.x - 1, offset_.y}); else if (hi_res_) this->increment_at(c); else engine_.create_life(c); this->update(); } else if (m.button == ox::Mouse::Button::ScrollDown) { if (m.modifiers.ctrl) this->set_offset({offset_.x, offset_.y + 1}); else if (m.modifiers.shift) this->set_offset({offset_.x + 1, offset_.y}); else if (hi_res_) this->decrement_at(c); else engine_.kill(c); this->update(); } return Widget::mouse_wheel_event(m); } auto timer_event() -> bool override { engine_.get_next_generation(); this->update(); return Widget::timer_event(); } auto key_press_event(ox::Key k) -> bool override { auto new_offset = this->offset(); switch (k) { using ox::Key; case Key::Arrow_left: --new_offset.x; break; case Key::Arrow_right: ++new_offset.x; break; case Key::Arrow_up: --new_offset.y; break; case Key::Arrow_down: ++new_offset.y; break; default: break; } this->set_offset(new_offset); return Widget::key_press_event(k); } auto resize_event(ox::Area new_size, ox::Area old_size) -> bool override { // Can't use new_size, since width takes Border into account. half_width_ = static_cast<int>(this->width() / 2); half_height_ = static_cast<int>(this->height() / 2); return Widget::resize_event(new_size, old_size); } private: Game_of_life_engine engine_; bool hi_res_ = true; bool grid_ = false; Period_t period_{40}; Coordinate offset_{0, 0}; ox::Color cell_color_ = color::White; int half_width_ = 0; int half_height_ = 0; static auto constexpr dead_cell = ox::Glyph{L' '}; private: /// Update the period if currently running. void update_period() { if (this->is_animated()) { this->disable_animation(); this->enable_animation(period_); } } /// Convert unsigned screen Point to engine Coordinate. /** Engine coordinate (0, 0) is at the center of the display. */ auto transform_to_engine(ox::Point p) const -> Coordinate { auto x = static_cast<std::int16_t>(p.x - half_width_ + offset_.x); auto y = static_cast<std::int16_t>(p.y - half_height_ + offset_.y); if (hi_res_) { x *= 2; y *= 4; } return {x, y}; } void paint_low_res() { auto const width = this->width(); auto const height = this->height(); auto p = ox::Painter{*this}; for (auto x = 0uL; x < width; ++x) { for (auto y = 0uL; y < height; ++y) { auto const coords = transform_to_engine({x, y}); if (engine_.alive_at(coords)) p.put(L'█' | fg(cell_color_), {x, y}); } } } void paint_hi_res() { auto const width = this->width(); auto const height = this->height(); auto p = ox::Painter{*this}; for (auto x = 0uL; x < width; ++x) { for (auto y = 0uL; y < height; ++y) { auto const braille = braille_at(ox::Point{x, y}); if (braille != L'\0') p.put(braille | fg(cell_color_), {x, y}); } } } auto braille_at(ox::Point p) const -> wchar_t { return braille_at(transform_to_engine(p)); } /// Find the braille representation of the Coordinates at \p p. auto braille_at(Coordinate c) const -> wchar_t { auto result = L'\0'; if (engine_.alive_at(c)) result |= L'⠁'; if (engine_.alive_at({c.x, c.y + 1})) result |= L'⠂'; if (engine_.alive_at({c.x, c.y + 2})) result |= L'⠄'; if (engine_.alive_at({c.x, c.y + 3})) result |= L'⡀'; if (engine_.alive_at({c.x + 1, c.y})) result |= L'⠈'; if (engine_.alive_at({c.x + 1, c.y + 1})) result |= L'⠐'; if (engine_.alive_at({c.x + 1, c.y + 2})) result |= L'⠠'; if (engine_.alive_at({c.x + 1, c.y + 3})) result |= L'⢀'; return result; } void increment_at(Coordinate c) { auto b = this->braille_at(c); // wrapping increment if (b == L'⣿') b = L'⠀'; else ++b; change_state(c, b); } void decrement_at(Coordinate c) { auto b = this->braille_at(c); // wrapping decrement if (b == L'⠀') b = L'⣿'; else --b; change_state(c, b); } auto has_bit_set(wchar_t subject, wchar_t bit) -> bool { return (subject - L'⠀') & (bit - L'⠀'); } void change_state(Coordinate c, wchar_t bits) { if (has_bit_set(bits, L'⠁')) engine_.create_life(c); else engine_.kill(c); if (has_bit_set(bits, L'⠂')) engine_.create_life({c.x, c.y + 1}); else engine_.kill({c.x, c.y + 1}); if (has_bit_set(bits, L'⠄')) engine_.create_life({c.x, c.y + 2}); else engine_.kill({c.x, c.y + 2}); if (has_bit_set(bits, L'⡀')) engine_.create_life({c.x, c.y + 3}); else engine_.kill({c.x, c.y + 3}); if (has_bit_set(bits, L'⠈')) engine_.create_life({c.x + 1, c.y}); else engine_.kill({c.x + 1, c.y}); if (has_bit_set(bits, L'⠐')) engine_.create_life({c.x + 1, c.y + 1}); else engine_.kill({c.x + 1, c.y + 1}); if (has_bit_set(bits, L'⠠')) engine_.create_life({c.x + 1, c.y + 2}); else engine_.kill({c.x + 1, c.y + 2}); if (has_bit_set(bits, L'⢀')) engine_.create_life({c.x + 1, c.y + 3}); else engine_.kill({c.x + 1, c.y + 3}); } public: sl::Signal<void(Coordinate)> offset_changed; sl::Signal<void(Rule)> rule_changed; sl::Signal<void(std::uint32_t)>& generation_count_changed{ engine_.generation_count_changed}; }; } // namespace gol #endif // TERMOX_DEMOS_GAME_OF_LIFE_GOL_WIDGET_HPP
28.453052
80
0.541952
skvl
b79005d9b102f9bd367def20b14d03913ab0d0b9
1,961
cpp
C++
dumptag.cpp
Llewellynvdm/id3
b6413124856b1eb170f81b2f66cecf1f13235673
[ "BSD-2-Clause" ]
108
2015-01-16T16:05:07.000Z
2022-03-31T12:13:51.000Z
dumptag.cpp
Llewellynvdm/id3
b6413124856b1eb170f81b2f66cecf1f13235673
[ "BSD-2-Clause" ]
26
2015-05-27T00:00:51.000Z
2022-02-20T15:03:44.000Z
dumptag.cpp
Llewellynvdm/id3
b6413124856b1eb170f81b2f66cecf1f13235673
[ "BSD-2-Clause" ]
11
2016-07-18T22:15:22.000Z
2022-03-13T00:45:31.000Z
#include <cstdio> #include <cstring> #include <string> #include <utility> #include "dumptag.h" /* serializing tag info to/from human-readable text copyright (c) 2015 squell <squell@alumina.nl> use, modification, copying and distribution of this software is permitted under the conditions described in the file 'COPYING'. */ namespace tag { using namespace std; #define DIRECTIVE "#" #define COMPACT false void output(metadata::array::const_iterator begin, metadata::array::const_iterator end, FILE* out) { while(begin < end) { const pair<string,string> line = *begin++; const char* key = line.first.c_str(); const char* value = line.second.c_str(); const char* lnbrk = strchr(value, '\n'); if(COMPACT && !lnbrk && !strchr(key, ':')) { // emit one a single line fprintf(out, "{%s}\t%s\n", key, value); } else { // emit as header-paragraph fprintf(out, "{%s}\n", key); while(lnbrk) { int const span = (lnbrk - value) & 0xFFFF; fprintf(out, "\t%.*s\n", (int)span, value); value = lnbrk+1; lnbrk = strchr(value, '\n'); } fprintf(out, "\t%s\n", value); } } } void output(combined<reader> const& tags, const char* filename, FILE* out) { fprintf(out, DIRECTIVE"file\t%s\n", filename); combined<reader>::const_iterator p = tags.begin(); while( p != tags.end() ) { std::auto_ptr<metadata> info( (*p++)->read(filename) ); if(info.get() && *info) { metadata::array list = info->listing(); const pair<string,string> hdr = list[0]; fprintf(out, DIRECTIVE"tag\t%s %s\n", hdr.first.c_str(), hdr.second.c_str()); output(list.begin()+1, list.end(), out); } } fprintf(out, "\n"); if(ferror(out)) throw failure("could not emit tag data"); } }
28.838235
98
0.564508
Llewellynvdm
b792b1d72b07429aa4dd30799c3bf4744e8e55ae
69
cpp
C++
def_lang/src/ts/Serialization.cpp
jeanleflambeur/silkopter
cdbc67ee2c85f5c95eb4f52e2e0ba24514962dd8
[ "BSD-3-Clause" ]
36
2015-03-09T16:47:14.000Z
2021-02-04T08:32:04.000Z
def_lang/src/ts/Serialization.cpp
jeanlemotan/silkopter
cdbc67ee2c85f5c95eb4f52e2e0ba24514962dd8
[ "BSD-3-Clause" ]
42
2017-02-11T11:15:51.000Z
2019-12-28T16:00:44.000Z
def_lang/src/ts/Serialization.cpp
jeanleflambeur/silkopter
cdbc67ee2c85f5c95eb4f52e2e0ba24514962dd8
[ "BSD-3-Clause" ]
5
2015-10-15T05:46:48.000Z
2020-05-11T17:40:36.000Z
#include "def_lang/Serialization.h" #include "def_lang/ts_assert.h"
17.25
35
0.782609
jeanleflambeur
b797c1363d9c099cbda44971d496c97f94bf7d6b
598
cpp
C++
SAVKONO.cpp
kunwar-vikrant/Codechef
96d89e5efd0f32e88fdf2b9199adac99ef33804d
[ "MIT" ]
1
2019-12-24T06:00:08.000Z
2019-12-24T06:00:08.000Z
SAVKONO.cpp
kunwar-vikrant/Codechef
96d89e5efd0f32e88fdf2b9199adac99ef33804d
[ "MIT" ]
null
null
null
SAVKONO.cpp
kunwar-vikrant/Codechef
96d89e5efd0f32e88fdf2b9199adac99ef33804d
[ "MIT" ]
null
null
null
#include<iostream> #include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin>>t; while(t--){ int n, z; cin>>n>>z; // int arr[n]; priority_queue<int> pq; for(int i = 0; i < n; i++){ int x; cin>>x; pq.push(x); } int times = 0; while(pq.top() != 0 && z > 0){ int t = pq.top(); int new_t = t/2; z = z-t; pq.pop(); pq.push(new_t); times++; } if(z > 0){ cout<<"Evacuate"<<endl; }else{ cout<<times<<endl; } } return 0; }
12.204082
35
0.464883
kunwar-vikrant